Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question]: Why am I getting a Warning about AzureRM? #19900

Closed
1 of 4 tasks
sc-mk opened this issue May 22, 2024 · 1 comment
Closed
1 of 4 tasks

[Question]: Why am I getting a Warning about AzureRM? #19900

sc-mk opened this issue May 22, 2024 · 1 comment

Comments

@sc-mk
Copy link

sc-mk commented May 22, 2024

Task name

Azure PowerShell

Task version

5.*

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows Server 2019

Question

Hi,
I run the Inline Script in Azure PowerShell task, I get the following Warning in Pipeline output:
"You're using AzureRM which will be retired soon, please schedule an update."
What is AzureRM in this script, please?

# Stop Azure VMs
Get-AzVM -ResourceGroupName $(ResourceGroupName1) | Stop-AzVM -NoWait -Force
# Get Azure VM status
$vm = Get-AzVM -ResourceGroupName $(ResourceGroupName1) -Status
# Wait for the virtual machines to stop
$expectedStatus = "VM deallocated"

foreach ($vms in $vm) {
    $statuscheck = Get-AzVM -ResourceGroupName $vms.ResourceGroupName -Name $vms.Name -Status 
    while ($statuscheck.Statuses.DisplayStatus[1] -ne $expectedStatus) {  
        Start-Sleep -Seconds 1
        Get-Date -Format "MM/dd/yyyy HH:mm.s"
        Write-Output "Stopping virtual machine: $($vms.Name)"
        $statuscheck = Get-AzVM -ResourceGroupName $vms.ResourceGroupName -Name $vms.Name -Status
        Write-Output "Virtual machine state: $($statuscheck.Statuses.DisplayStatus[1])"
    }
    Write-output "Virtual machine $($vms.Name) is already in stopped state."
}
@DmitriiBobreshev
Copy link
Contributor

DmitriiBobreshev commented May 22, 2024

Hi @mariankral, thank you for the question.
Right now our team is working on switching from AzureRM (which no longer supported from 29/02/2024) to Az. You can find some details in #19843 (comment).
If you'd like to help our team and switch to the new Az you can add environment or pipeline variable RETIRE_AZURERM_POWERSHELL_MODULE and set it to true. This will dismiss this warning and the task will be use only Az package to connect with Azure.

I'm closing the issue as duplicated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants