Octopus Deploy does not support just PowerShell Az module commands

Octopus Deploy server scripts, such as AzuerContext.ps1 (https://github.com/OctopusDeploy/Calamari/blob/master/source/Calamari.Azure/Scripts/AzureContext.ps1) works when AzureRM module installed or Enable-AzureRmAlias is turned on, though we are about to move off AzureRm from the box completely, can not do that as login to Azure that Octopus is doing using Service Principle Account, not working:
Attempt 1 of 5 failed: The term ‘Disable-AzureRMContextAutosave’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

Thanks,
Monika

Hi Monika,

Thanks for getting in touch! It looks like you may need to define a scope for the command or it will be restricted to the PowerShell session you are currently in.

Enable-AzureRmAlias -Scope LocalMachine

It looks like you are encountering the same issue as here.

If this does not help you get this working or if you still have any questions here, let me know. :slight_smile:

Best regards,
Daniel

Hi Daniel,

Thanks for response! Actually, I have Enabled aliases for Local Machine scope and made AzureRm migration to Az cmdlets. The problem is that I want to disable it… I dont want aliases running on Local Machine as migration is done. But I can not do that - Octopus is using old cmdlets. We are looking to know when / how octopus will support moving off azurerm cmdlets.

Monika

Hi Monika,

Thanks for the update here. I had a chat to the developers about this and it looks like we currently don’t have any plans to move off these cmdlets in the near future. The problem has to do with Microsoft moving the goal posts on us. Constantly keeping up has been a bit of a futile challenge for us so we are staying put for now.

The current solution to disable this here would be to run Disable-AzureRmAlias in a subsequent step in your deployment.

If you have further thoughts or questions on this let me know. I’m currently deferring to our developers for information on this so I’d be happy to bring any questions you have to them. :slight_smile:

Let me know if this helps.

Best regards,
Daniel

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.