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 http://docs.octopusdeploy.com/display/OD/Configuring+the+version+of+the+Azure+PowerShell+modules 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?