Deploy Azure Cloud Service failed

Hi Team,

We are deploying a cloud service via “Deploy an Azure Cloud Service”. The package only contains the
cspkg and cscfg files.

But the log throw error when running
NotSpecified: Exception has been thrown by the target of an invocation

Deploying package: C:\Octopus\OctopusServer\PackageCache\feeds-teamcity-packaged\BestMed.DEVCloud@S1.0.12422.41@AF2417167C01EE43B508326C1F0752C7.nupkg
March 13th 2020 00:19:06Info
No settings that match provided variables were found.
March 13th 2020 00:19:06Info
Uploading package to Azure blob storage: ‘C:\Octopus\Work\20200312131709-16830-369\staging\BestMed.Server.Services.ccproj.cspkg’
March 13th 2020 00:19:08Info
Package uploaded to https://bestmedstoragedevops.blob.core.windows.net/octopuspackages/BestMed.Server.Services.ccproj.1.0.12422.41_48954e48bc3cd350f2f27375a56b65e9cbfdac34.cspkg
March 13th 2020 00:19:08Info
Config file: C:\Octopus\Work\20200312131709-16830-369\staging\ServiceConfiguration.Cloud.cscfg
March 13th 2020 00:19:36Error
NotSpecified: Exception has been thrown by the target of an invocation.
March 13th 2020 00:19:36Error
At C:\Octopus\Work\20200312131709-16830-369\staging\DeployToAzure.ps1:48 char:5
March 13th 2020 00:19:36Error

  • New-AzureDeployment -Slot $OctopusAzureSlot -Package $OctopusAzur ... 
    

March 13th 2020 00:19:36Error

  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
    

March 13th 2020 00:19:36Error
at CreateNewDeployment, C:\Octopus\Work\20200312131709-16830-369\staging\DeployToAzure.ps1: line 48
March 13th 2020 00:19:36Error
at CreateOrUpdate, C:\Octopus\Work\20200312131709-16830-369\staging\DeployToAzure.ps1: line 32
March 13th 2020 00:19:36Error
at , C:\Octopus\Work\20200312131709-16830-369\staging\DeployToAzure.ps1: line 63
March 13th 2020 00:19:36Error
at , : line 1
March 13th 2020 00:19:36Error
at , C:\Octopus\Work\20200312131709-16830-369\staging\Octopus.AzureContext.ps1: line 152
March 13th 2020 00:19:36Error
at , C:\Octopus\Work\20200312131709-16830-369\staging\Bootstrap.Octopus.AzureContext.ps1: line 2033
March 13th 2020 00:19:36Error
at , : line 1
March 13th 2020 00:19:36Error
at , : line 1
March 13th 2020 00:19:36Error
Script ‘C:\Octopus\Work\20200312131709-16830-369\staging\DeployToAzure.ps1’ returned non-zero exit code: 1
March 13th 2020 00:19:36Error
Running rollback conventions…
March 13th 2020 00:19:36Error
Script ‘C:\Octopus\Work\20200312131709-16830-369\staging\DeployToAzure.ps1’ returned non-zero exit code: 1
March 13th 2020 00:19:36Fatal
The remote script failed with exit code 1
March 13th 2020 00:19:36Fatal
The action Deploy Worker on bestmedservicedev failed

I supsect this is Powershell problem but we have both variable OctopusUseBundledAzureModules and OctopusUseBundledAzureCLI set to True to use Octopus powershell bundle.

We’re using the latest Octopus version 2019.13.7

Thanks

Hi @lvhdung,

Thanks for getting in touch! I’m sorry to hear you’ve hit this unexpected issue. Did this same deployment work previously and just suddenly stop working? If so, did anything occur, like upgrading your Octopus server, that coincided to when this started occurring? (It seems like Microsoft has been slowly working towards retiring cloud services, so I’m also wondering if they’ve made some change on their end that could have caused this.)

Do you see any errors reported in the Azure console? If so, that underlying error message might help point us in the right direction.

I look forward to hearing back and getting to the bottom of this one!

Best regards,

Kenny

Hi @Kenneth_Bates,

This is the first time we start using the cloud service step.
I’ve tried also the PowerShell script and Azure PowerShell script step to manually log in and deploy but the error still the same, even with OctopusUseBundledAzureModules and OctopusUseBundledAzureCLI set to True or False.
I’m stuck because there is no other log other than above when I checked the raw log, it would be great if we can extract more info somewhere.

Thanks in advance
Dung

Hi,

Look like the Powershell included in Cloud service step has problem.
I’m able to make it work by switching to normal powershell step with below config

Change Octopus local system with the current user describe here

Use own Powershell version by turning OctopusUseBundledAzureModules and OctopusUseBundledAzureCLI to False

After that, I can use my own PowerShell version to deploy the cloud service.

Just share a thought to who suffer like me.

Thanks

Hi Dung,

Thanks for following up! Great to hear you’ve managed to figure out the issue and how to get around it, and I appreciate you letting me know the outcome. We might need to consider updating the Azure CLI tools we bundle with Octopus soon, and I’ll make sure to bring that up with the engineers. :slight_smile:

Don’t hesitate to reach out if you have any questions or concerns moving forward!

Best regards,

Kenny