Azure Powershell deployment error - Azure CLI related?

I’m recently getting an error on an Azure PowerShell step, and I’m getting the same error for Web App deployment steps. I think I have narrowed it to the Azure CLI, which is not behaving as expected when running in a USGov azure region. The powershell script executed fine (and does not use the Azure CLI btw). Here’s the log output:

03:24:04   Verbose  |       Authenticating with Service Principal
03:24:04   Verbose  |       Account          : <redacted>
03:24:04   Verbose  |       SubscriptionName : <redacted>
03:24:04   Verbose  |       SubscriptionId   : <redacted>
03:24:04   Verbose  |       TenantId         : <redacted>
03:24:04   Verbose  |       Environment      : AzureUSGovernment
03:24:06   Error    |       ERROR: No subscriptions were found for '<redacted>'. If this is expected, use '--allow-no-subscriptions' to have tenant level accesses
03:24:08   Error    |       ERROR: The subscription of '<redacted>' doesn't exist in cloud 'AzureCloud'.
03:24:08   Verbose  |       Successfully authenticated with the Azure CLI
03:24:08   Verbose  |       Invoking target script "C:\Octopus\Work\20180829032401-57804-1496\Script.ps1" with  parameters
03:24:08   Info     |       Loading Existing AppSettings
03:24:09   Info     |       Applying New AppSettings
03:24:09   Info     |       Saving AppSettings
03:24:11   Info     |       AppSettings Updated
03:24:12   Verbose  |       Process C:\Windows\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20180829032401-57804-1496 exited with code 1
03:24:12   Verbose  |       Updating manifest with output variables
03:24:12   Verbose  |       Updating manifest with action evaluated variables
03:24:12   Fatal    |       The remote script failed with exit code 1
03:24:12   Fatal    |       The action Configure App on <redacted> failed

What jumps out at me is the following since this is in AzureUSGovernment:
ERROR: The subscription of '<redacted>' doesn't exist in cloud 'AzureCloud'.

Forgot to mention we are on version 2018.7.14

Hi Bryce,

Thanks for getting in touch and sorry you’re experiencing this error.

When you say you’re recently getting this error, does that mean this used to work but started failing recently? If so, can you confirm when this stopped working and at what version (if possible)?

Is your Octopus instance running any other Azure-related deployment tasks at the same time that may be causing the Azure Cli to get confused about which environment it’s supposed to be running against? This won’t happen in PowerShell because any variables that are set occur within the context of the PowerShell session, but we’re wondering if the Cli is running into some sort of concurrency issue.

Unfortunately we don’t have a US Government subscription with Azure to test, but we do have a Germany subscription which is another isolated environment, so we’ll try and reproduce this issue using that.

Can you please confirm if this is happening consistently or sporadically? Hopefully some of your answers will help us narrow this down.


Hi Bryce,

We have an open issue for this. Hopefully, we will have a fix out by Friday.

Apologies for the inconvenience.


1 Like
  • Last successful deployment of the project in question was 8/15
  • Likely no other Azure tasks on this tentacle at the same time, and even if so, they would have also been for GOV :wink:
  • It is constant, as of 8/28 every deployment for that project fails

Thanks for the additional information Bryce.

As Ben mentioned, we have found a bug with regards to non-default Azure Clouds, described by this issue. Unfortunately due to some release issues today, this will most likely be released early next week (not today).

Sorry for the inconvenience.