The OctopusUseBundledAzureModules variable has been used

After Upgrading Octopus Server from 2019.13.7 to 2022.2 I’m starting to see this warning in my Octopus Builds that have an in-line Powershell script.
Is there a way to turn off this warning?
I do see a variable OctopusUseBundledAzureModules set to false, but from googling this was for my previous versions.

Using the Azure tools bundled with Octopus Deploy is not recommended. Learn more about Azure Tools at Running Azure PowerShell - Octopus Deploy.

August 16th 2022 18:34:34

Warning

The OctopusUseBundledAzureModules variable has been used to disable using the bundled Azure PowerShell modules. Note that this variable is deprecated and will be removed in a future version, please use the bundling options on the step to control this behavior now.

Hi @jonathan.totaram,

Thanks for getting in touch! Since Octopus version 2020.1, we’ve added the option for whether or not you wish to bundle the tools as a part of our Azure steps. The following documentation has further information on this change.

If you remove the OctopusUseBundledAzureModules from the project variables and defer to the option on the step, you should no longer see the warning in your deployment.

If you have any questions or concerns here, please don’t hesitate to let me know.

Best regards,
Daniel

Daniel - there are two types of script to choose from:

  1. Run a Script
  2. Ran an Azure Script
    All of our Script are the first type with Powershell selected, the option in the article is when the 2nd type is chosen.
    I’ve removed the variable and that makes it worse, now the step fails almost immediately

Hi @jonathan.totaram,

Thanks for getting back. The Azure Script Step was added more recently and is designed to be used with any Azure Scripts you might run. I would suggest migrating your scripts from PowerShell script steps to Azure script steps where applicable. The new step uses account variables and will also fix the issue you’re seeing with the bundled variable message, as the option is directly on the step.

Let me know if you have any further questions here.

Best regards,
Daniel

Daniel, thanks. I will clone one Project and start from there. Is there any AZ tools, CLI that has to be installed on the hosted VM we are using? Or Powershell version?

Hi @jonathan.totaram,

I’m stepping in for Daniel as he is offline at the moment, but I’m happy to help!

In order to use the Azure script step you’ll need to have the Az Powershell commands installed, as well as a compatible version of PowerShell - within the documentation I linked it mentions the following acceptable versions: PowerShell 7.0.6 LTS, PowerShell 7.1.3, or higher.

Alternatively, you could set up your VM to allow for running execution containers, which would allow you to pull down the latest tools for this during deploy time. With this approach you would need to have Docker pre-installed on your worker so it can spin up the necessary container images for your deployment process - and in this case you could leverage the octopuslabs/azure-workertools image, which contains all the necessary dependencies for the Azure script step.

One last thing I wanted to mention is that if you are using any of the legacy AzureRM commands in your current process you may need to take an additional step to enable compatibility mode to allow for this, but this may not be required depending on the exact commands you are running in your script(s).

Hopefully this helps shed some light on the underlying requirements for this particular step template, but let me know if you have any additional questions.

Best regards,

Britton

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