Hi
I have a problem with the Octopus Azure functionality.
When I use the step “Run an Azure Powershell script” it has started to fail in Octopus. It runs and does what it should, but the state in Octopus is failure.
Observations:
-
The scripts actually run successfully, but they end up with a failure status in Octopus deploy. I use them to swap Azure slot and run SQL - everything works. But the deploy fails in Octopus.
-
It seems that it is the initial Azure authentication that fails. It says that the Azure subscription doesn’t exist. The subscription in Azure has the exact same GUID.
-
The problems started somewhere between August 15th and August 23rd, 2018 - I am almost certain that nothing has been changed in my Azure account nor Octopus setup. Only Octopus Deploy has been regularly updated. The windows installation might have been updated.
-
The same account (which is registred in Infrastructure/Accounts) works with no errors in “Deploy an Azure Web App” and “SQL - Execute Script file” (Community template) steps
Details below…
Can you help?
Cheers,
Christian
In an example where the step based on “Run an Azure Powershell script”, named “Do nothing” and contains nothing but a comment:
#Do nothing
…the log from the execution is:
Error: %(D was unexpected at this time.
Error: ERROR: The subscription of ‘YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY’ doesn’t exist in cloud ‘AzureCloud’.
Fatal: The remote script failed with exit code 1
Fatal: The action Do nothing on myproduct Prod WebApp Test slot failed
The subscription exists and the step actually works, but it ends up with a failure status.
The full verbose log:
Verbose: Octopus Server version: 2018.8.0+Branch.master.Sha.c206660c295650f47189fab7d64d3ac71b0309a9
Verbose:
Environment Information:
OperatingSystem: Microsoft Windows NT 10.0.17134.0
OsBitVersion: x64
Is64BitProcess: True
CurrentUser: NT AUTHORITY\SYSTEM
MachineName: SRV-BUILD-01
ProcessorCount: 4
CurrentDirectory: C:\WINDOWS\system32
TempDirectory: C:\WINDOWS\TEMP
HostProcessName: Octopus.Server
PID: 15528
Verbose: Executing Do nothing (type Run an Azure PowerShell Script) on Octopus Server
Verbose: Using account ID ‘azureserviceprincipal-myproduct’
Verbose: Account variables are being contributed by the target
Verbose: Using Calamari.Cloud 4.8.3
Verbose: Using Octopus.Dependencies.AzureCmdlets 5.7.0
Verbose: Using Octopus.Dependencies.AzureCLI 2.0.42
Verbose: Running this script as the Octopus Server (NT AUTHORITY\SYSTEM)
Verbose: Starting C:\WINDOWS\system32\WindowsPowershell\v1.0\PowerShell.exe in working directory ‘C:\Octopus\Work\20180903123948-22063-30’ using ‘Western European (DOS)’ encoding running as ‘NT AUTHORITY\SYSTEM’ with the same environment variables as the launching process
Verbose: Octopus Deploy: Calamari version 4.8.3
Verbose: Environment Information:
Verbose: OperatingSystem: Microsoft Windows NT 10.0.17134.0
Verbose: OsBitVersion: x64
Verbose: Is64BitProcess: True
Verbose: CurrentUser: NT AUTHORITY\SYSTEM
Verbose: MachineName: SRV-BUILD-01
Verbose: ProcessorCount: 4
Verbose: CurrentDirectory: C:\Octopus\Work\20180903123948-22063-30
Verbose: TempDirectory: C:\WINDOWS\TEMP\
Verbose: HostProcessName: Calamari
Verbose: Performing variable substitution on ‘C:\Octopus\Work\20180903123948-22063-30\Script.ps1’
Verbose: Executing ‘C:\Octopus\Work\20180903123948-22063-30\Script.ps1’
Verbose: Name Value
Verbose: ---- -----
Verbose: PSVersion 5.1.17134.228
Verbose: PSEdition Desktop
Verbose: PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
Verbose: BuildVersion 10.0.17134.228
Verbose: CLRVersion 4.0.30319.42000
Verbose: WSManStackVersion 3.0
Verbose: PSRemotingProtocolVersion 2.3
Verbose: SerializationVersion 1.1.0.1
Verbose: PowerShell Environment Information:
Verbose: OperatingSystem: Microsoft Windows NT 10.0.17134.0
Verbose: OsBitVersion: x64
Verbose: Is64BitProcess: True
Verbose: CurrentUser: NT AUTHORITY\SYSTEM
Verbose: MachineName: SRV-BUILD-01
Verbose: ProcessorCount: 4
Verbose: CurrentDirectory: C:\Octopus\Work\20180903123948-22063-30
Verbose: CurrentLocation: C:\Octopus\Work\20180903123948-22063-30
Verbose: TempDirectory: C:\WINDOWS\TEMP\
Verbose: HostProcessName: powershell
Verbose: TotalPhysicalMemory: 16776756 KB
Verbose: AvailablePhysicalMemory: 11099356 KB
Verbose: Authenticating with Service Principal
Verbose: Account : XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
Verbose: SubscriptionName : myproduct
Verbose: SubscriptionId : YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY
Verbose: TenantId : ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ
Verbose: Environment : AzureCloud
Verbose: Azure CLI: Authenticating with Service Principal
Verbose: C:\Octopus\Work\20180903123948-22063-30> “C:\Octopus\OctopusServer\Tools\Octopus.Dependencies.AzureCLI\2.0.42\AzureCLI\wbin\…\python.exe” -IBm azure.cli login --service-principal -u XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX -p ******** --tenant ZZZZZZZZ-ZZZZ-ZZZZ-ZZZZ-ZZZZZZZZZZZZ
Error: %(D was unexpected at this time.
Verbose: Azure CLI: Setting active subscription to YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY
Error: ERROR: The subscription of ‘YYYYYYYY-YYYY-YYYY-YYYY-YYYYYYYYYYYY’ doesn’t exist in cloud ‘AzureCloud’.
Verbose: Successfully authenticated with the Azure CLI
Verbose: Invoking target script “C:\Octopus\Work\20180903123948-22063-30\Script.ps1” with parameters
Verbose: Process C:\WINDOWS\system32\WindowsPowershell\v1.0\PowerShell.exe in C:\Octopus\Work\20180903123948-22063-30 exited with code 1
Verbose: Updating manifest with output variables
Verbose: Updating manifest with action evaluated variables
Fatal: The remote script failed with exit code 1
Fatal: The action Do nothing on myproduct Prod WebApp Test slot failed