Closed hnrkndrssn closed 9 years ago
Do you have a timeline for this? I need it urgently because I can now no longer deploy via Octopus without a manual step at the end.
Also can you guys look at either having a plan to keep these bundled cmdlets up to date or perhaps using the non-bundled Azure PS cmdlets if installed with a newer version?
This is actually a double up ticket. https://github.com/OctopusDeploy/Issues/issues/1385 Closing this one.
@richardp-au another customer did the following on their tentacle as a workaround without needing a manual step
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"
@vanessalove Awesome I'll try that. It'd be nice to have an option in Octopus to either use the bundled Azure cmdlets or the installed ones.
I tried the above suggestion of changing the Azure module path in the BootstrapDeployToAzure.ps1
file. However, it made no difference and I still got the error.
I then added some extra text to the Write-Host
lines to check that it was using the right file with my edits and found that the extra text did not make it to the Octopus task log. (I restarted both the Tentacle service and even the computer before rerunning just in case.)
I then took a look at the BootstrapDeployToAzure.ps1
and DeployToAzure.ps1
files that get copied to the C:\Octopus\Applications\(environment)\(package)\(version)\
folder. Both of these files did not have the modifications I made so they must be coming from somewhere else.
@richardp-au I managed to get around this by calling the following function at the start of DeployToAzure.ps1
function PatchAzureCmdletVersion()
{
Write-Host "Remove previous Windows Azure modules from $OctopusAzureModulePath"
Remove-Module azure
$OctopusAzureModulePath = "C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement\Azure\Azure.psd1"
Write-Host "Import Windows Azure modules from $OctopusAzureModulePath"
Import-Module $OctopusAzureModulePath
Add-Type -AssemblyName "System"
$certificate = new-object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList @($OctopusAzureCertificateFileName, $OctopusAzureCertificatePassword)
Write-Host "Resetting up the Azure subscription"
Set-AzureSubscription -CurrentStorageAccount $OctopusAzureStorageAccountName -SubscriptionName $OctopusAzureSubscriptionName -SubscriptionId $OctopusAzureSubscriptionId -Certificate $certificate
Select-AzureSubscription -SubscriptionName $OctopusAzureSubscriptionName
}
Many Thanks @quezlatch - That's worked a treat as I need the ILB in my deploy :-)
This thread has been automatically locked since there has not been any recent activity after it was closed. If you think you've found a related issue, please contact our support team so we can triage your issue, and make sure it's handled appropriately.
I've been deploying my Azure cloud service with Octopus successfully for some time now but I only started experiencing an error today. I am getting the following in the task log:
nagementClientException