Corrupted project? Cannot utilize Azure Powershell any longer

Hi all,

I have run into a rather odd issue.

I have a project set up that deploys to an Azure Web App. There are a couple of Azure Powershell scripts that I run before and after the deploy step.

The deployment process was working fine, until I started receiving “Subscription does not exist” errors when trying to run the pre-deploy azure powershell steps.

I verified that the subscription was set up correctly and still did exist, and recreated my Azure account in Octopus Deploy just to be sure. I also removed all scripts, and replaced them with a single Script step that executes “Get-AzureSubscription”. This also fails with the same error messages:

Select-AzureSubscription : The subscription name doesn’t exist.
Parameter name: name
*At C:\Octopus\Work\20150807161714-14\Bootstrap.Octopus.AzureContext.ps1:173 *

Set-AzureSubscription : The subscription id doesn’t exist.
Parameter name: id
*At C:\Octopus\Work\20150807161714-14\Bootstrap.Octopus.AzureContext.ps1:174 *

I can’t tell if it is running an older/cached version of my script, but I cannot see “Get-AzureSubscription” called anywhere.

If I open the script console and run “Get-AzureSubscription” against my project, it works fine.

I also recreated the Azure Web App target, but that did not fix the issue.

Also, if I create a new project with the same scripts/setup, it works fine - but obviously we do not want to recreate entire projects if they become corrupted like this.



Hi Adam,

Thanks for reaching out. After you made the changes to your deployment process (when you added only get-azuresubscription) did you create a new release or just re-deployed one that was created prior to your change? You need to create a new release for the changes to take effect. The fact that this worked from the script console and from the new project leads me to believe you were re-deploying the same old release.