azureazure-devopsazure-pipelinesazure-pipelines-release-task

How to perform AzureRM update for release tasks


We started receiving warnings regarding the AzureRM for updates since it is retiring soon:

2024-09-27T01:14:07.8264879Z ##[warning]You're using AzureRM which will be retired soon, please schedule an update.

After conducting an investigation, we identified that while we are not using scripts that directly call the AzureRM commands, the task defined in our release pipeline is utilizing Azure Resource Manager.

Issue:

We did not find any documentation mentioning the retirement of this specific task definition. This raises the following questions:

  1. Are we supposed to update this task to use the Az PowerShell task?

  2. How long will this task be supported

https://learn.microsoft.com/en-us/powershell/azure/azurerm-retirement-overview?view=azps-12.3.0


Solution

  • I think you might be confusing the module (AzureRM) with the pipeline task (AzurePowerShell).

    ##[warning]You're using AzureRM which will be retired soon, please schedule an update.

    The above warning is related to the AzureRM PowerShell module, which has been officially deprecated as of February 29, 2024. Users are advised to migrate from AzureRM to the Az PowerShell module to ensure continued support and updates.

    We did not find any documentation mentioning the retirement of this specific task definition

    AFAIK there is no plan to deprecate/retire the pipeline task. Also, there's no such thing as an "Az PowerShell task" (i.e. task that uses exclusively the Az module). You can continue using the AzurePowerShell@x tasks to run any PowerShell scripts within an Azure environment.

    EDIT

    As per Azure Pipelines Tasks - issue #19843, using Powershell core might prevent the warning from being displayed:

    - task: AzurePowerShell@5
      inputs:
        # ...
        #pwsh: true # Use PowerShell Core
    

    Adding environment variable RETIRE_AZURERM_POWERSHELL_MODULE and setting it to true will also dismiss the warning. However, Uninstall-AzureRM is called on every execution:

    - task: AzurePowerShell@5
      inputs:
        # ...
      env:
        RETIRE_AZURERM_POWERSHELL_MODULE: true
    

    Please refer to the link above for more details.