Latest Azure Powershell

I need to “Update”, “Activate”, and “Set as default” an Azure Batch Application Package. The Azure Batch team updated their Azure Powershell CMDLets on 6/1/2016 to include functionality to do so, whereas it was previously relegated to the UI and C# libraries.

I got it working locally using the new “New-AzureRmBatchApplicationPackage” and “Set-AzureRmBatchApplication” CMDLets, but had trouble making it work on the Octopus Deploy server, since octopus uses it’s own version of the CMDLets, rather than the system installed one. I ended up trying the the solution mentioned at to set the “Octopus.Action.Azure.UseBundledAzurePowerShellModules” variable to “False”, but then it just failed in the bootstrap part of the script where it does the “Login-AzureRmAccount” with the service principal because it said it was not a valid CMDLet (couldn’t find the powershell stuff at all).

The solution (and I hesitate to call it that, exactly) I arrived at was to simply copy the entire Azure Powershell folder that came from the Web Platform Installer (C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell), over the Octopus Deploy Azure Powershell folder (C:\Octopus\Calamari\Azure\3.3.13\AzurePowershell). This made the thing work, but I get the sneaking suspicion I’m setting myself up for failure down the line with something or another.

Any recommendations on how to proceed, and any potential problems that could result from having done this?


Thanks for reaching out.

Just to take away your suspicion right away, the workaround you came up with makes perfect sense and shouldn’t be harmful in the future. The only problem I can see is that the next time you upgrade Calamari, you’re gonna have to manually update this again for the new calamari folder.

I’m wondering what might have happened the first time you set Octopus.Action.Azure.UseBundledAzurePowerShellModules to false.

If you wanna keep troubleshooting that we can totally give you a hand. You will though need to revert your workaround, put the old Azure module that came with Octopus(*), then follow the below steps to provide us a full deployment log

1) Add these 2 variables to your project

2) Create a new release (so the new variables take effect) and deploy it. If possible skip as many steps as you can and only leave step we are troubleshooting in order to avoid the noise in the log.

3) Send us the raw log of that deployment

(*) it doesn’t have to be exactly that module version. You can take the Azure module from a previous calamari version and put that one. The goal is to have a module that’s not the latest released by the Azure team