Uninstalling AZRM module from octopus server will beak octopus existing functionality?

Hi,

I have some azure plugins (Deploy an azure web app, deploy an azure cloud service, run an azure powershelgl script… etc…) on octopus shared instance. I also have AZRM module installed. Now Im trying to install AZ module and there is a conflict and Microsoft says we cannot have both modules. Now I’m planning to uninstall AZRM module. My question is will there be any impact on the Azure plugins or Octopus functionality if I uninstall AZRM module? or is there a way we can have both and handle from the code to pick only AZ modules?

Regards,
-Siva

Hi Siva,

Thanks for getting in touch! While the AZ module isn’t bundled into Octopus (and the issue linked below is to add this support), there is a workaround to use AZ in Octopus in the meantime.

The workaround outlined in the issue involves installing the module wherever the step is executed, running the Enable-AzureRmAlias -Scope LocalMachine command in an admin PowerShell session and turning off the bundled Azure module by setting a variable to your project called OctopusUseBundledAzureModules with a value of False.

I’d like to also note that while we haven’t tested this workaround specifically, we haven’t had any reports of issues from it.

I hope that helps get you going! Please don’t hesitate to reach out if you have any further questions going forward. :slight_smile:

Best regards,

Kenny

Thanks Kenny for your response.

Let me try and get back to you.

Another question - if we uninstall AZRM module…will it impact existing octopus functionality ?

Regards,
-Siva

I have tied the solution which you have provided.

  1. I have both the modules on octopus server.
  2. created a new variable “OctopusUseBundledAzureModules” and set the value to “FALSE”
  3. added a new Azure powershell step and added the command “Import-Module Az” & “Enable-AzureRmAlias”.

getting below error

Successfully authenticated with the Azure CLI
11:55:34 Verbose | Invoking target script “E:\Octopus.Tentacle.v4\v4-octopus.deploy.internal.cba\Work\20190829015516-87805-227\Script.ps1” with parameters
11:55:34 Warning | Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the ‘Uninstall-AzureRm’ cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide
11:55:34 Warning | AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the ‘Uninstall-AzureRm’ cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.
11:55:38 Error | Get-ChildItem : AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used
11:55:38 Error | in the same script or runbook. If you are running PowerShell in an environment you control you can use the
11:55:38 Error | ‘Uninstall-AzureRm’ cmdlet to remove all AzureRm modules from your machine. If you are running in Azure Automation,
11:55:38 Error | take care that none of your runbooks import both Az and AzureRM modules. More information can be found here:
11:55:38 Error | https://aka.ms/azps-migration-guide.

Hi Siva,

Thanks for following up! Sorry to hear you’re running into this issue. AZ is backwards compatible with older cmdlets, so you don’t need both and you can uninstall the AZRM module without impacting functionality. The caveat to this, however, is that you need to turn off the bundled modules (with that variable) on all of your relevant projects.

I hope this helps! Let me know how you go. :slight_smile:

Best regards,

Kenny

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