Upgraded to 3.3, now I can't deploy to Azure

Getting this error in the log:
‘C:\Octopus\Calamari\Azure\3.3.0\AzurePowershell’ was not loaded because no valid module file was found in any module directory.

I was on 3.2 before and everything worked fine.

Hi,

Sorry for the troubles you have found. Could you provide the full deployment log?
Which version of 3.2 did you upgrade from?

Hopefully we can figure this out for you.
Vanessa

Hello,

Attached.

I was on 3.2 I think the latest build, I upgraded like 1-2 weeks ago.

Thanks,
/Hakan

Hakan Lindestaf
Vice President Software Development

EZLinks Golf LLC

Hi Hakan,

Can you please have a look if there is anything in the following folder: C:\Octopus\Calamari\Azure
Could you delete the 3.3.0 folder and then retry your deployment.

It looks like the version of Calamari was maybe started as a push and somehow got corrupted.

Let me know if that helps.
Vanessa

I tried to empty out that folder (and all folders until Calamari) but I get the exact same issue. When I run the deployment the folder is re-created. Attached is a list of all files under the 3.3.0/AzurePowershell folder.

This is starting to become urgent, I haven’t been able to deploy for two days now.

Thanks,
/Hakan

Hakan Lindestaf
Vice President Software Development

EZLinks Golf LLC

files.txt (138 KB)

Banessa,

The issue seems to be with our PostDeploy.ps1. This exact script has worked in since version 2, I’ve attached it here for your reference. If I remove this script then it deploys fine.

Shutdown Staging

Write-Host “Post Deploy”

Write-Host “Azure deployment parameters: "
Write-Host " Subscription ID: $OctopusAzureSubscriptionId”
Write-Host " Subscription name: $OctopusAzureSubscriptionName"
Write-Host " Cloud service name: $OctopusAzureServiceName"
Write-Host " KillSlot: $AzureKillSlot"
#Write-Host " CertFilename: $OctopusAzureCertificateFileName"

Write-Host “Importing Windows Azure modules”

Import-Module $OctopusAzureModulePath

Write-Host “Loading the management certificate”

Add-Type -AssemblyName “System”
$certificate = new-object System.Security.Cryptography.X509Certificates.X509Certificate2 -ArgumentList @(“C:\Temp\Certificate.pfx”, “73e28acd-63f8-45a1-b051-76c0525c3e49”)

Write-Host “Setting up the Azure subscription”

Set-AzureSubscription -CurrentStorageAccount $OctopusAzureStorageAccountName -SubscriptionName $OctopusAzureSubscriptionName -SubscriptionId $OctopusAzureSubscriptionId -Certificate $certificate

try
{
Select-AzureSubscription -SubscriptionName $OctopusAzureSubscriptionName

Write-Host "Starting the Azure deployment process"

            if ($AzureKillSlot -ne $null)
            {
                            Write-Host "Shutting down instance"
                            Remove-AzureDeployment -ServiceName $OctopusAzureServiceName -Slot $AzureKillSlot -Force
            }

}
finally
{
Remove-AzureSubscription -SubscriptionName $OctopusAzureSubscriptionName -Force
}

Write-Host “Post Deploy…Done”

Thanks,
/Hakan

Hakan Lindestaf
Vice President Software Development

EZLinks Golf LLC

PostDeploy.ps1 (1 KB)

Hi Hakan,

It is this line: Import-Module $OctopusAzureModulePath that was changed in 3.3 we are trying to figure out why it was changed but also could you explain why you use the script? Was it to mimic what we now do with Azure?

Vanessa

Yes, this script was from Octopus 2 when Azure support wasn’t great. I think we used it to stop the staging slots after deployment to save cost, but we haven’t used that feature in a long time, the script just stayed with the package, probably didn’t do anything.

Sent from Outlook Mobilehttps://aka.ms/blhgte

Hi Hakan,

You should be able to remove the one line I mention and have the script still work, but if you are finding your deployment is fine without it that might be best!

Let me know If i can be of further assistance.
And a big high five to Rob who did all the exploration finding what was going on with your ticket!
Vanessa

Ok, yea I don’t think I need it.

Thanks Rob, but I was kinda finding this out on my own.

Thanks,
/Hakan

Hakan Lindestaf
Vice President Software Development

EZLinks Golf LLC