DeployToAzure.ps1 not able to use latest Azure Powershell cmdlets

Hi,

We are deploying a cloud service comprising of worker and web roles to Azure using Octopus. Our custom DeployToAzure.ps1 Powershell script uses newer Azure cmdlets such as New-AzureSchedulerJobCollection (see http://msdn.microsoft.com/en-us/library/azure/dn759640.aspx) which are not supported with the Azure module packaged up with the Octopus Tentacle. Is there a workaround to support this newer functionality?

One attempt at working around the problem was to install the latest Azure SDK onto the Octopus deployment server and then to re-import the Azure module with the latest version, i.e.

Remove-Module Azure                                              #Removes existing Azure module (cmdlets)
Import-Module c":\program files\.......\Azure.psd1"  #Import the latest Azure modules installed from the SDK

This unfortunately seems to lose Azure subscription details. Any ideas?

Thanks,

Paul.

I have solved this issue by changing the path to the Azure module in

C:\Program Files\Octopus Deploy\Tentacle\Scripts\BootstrapDeployToAzure.ps1

e.g. the line

Import-Module $OctopusAzureModulePath

becomes

Import-Module “C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1”

Is there anyway to specify an alternative value for $OctopusAzureModulePath as it doesn’t look like it can be done through the UI?

Hi Paul,

As discussed via email, what you have done is the only current workaround. The variable you list is not available to be modified.
I have created a GitHub issue that you can track here https://github.com/OctopusDeploy/Issues/issues/1385
This will contain the update needed.

Vanessa