Skip to content

Azure PowerShell Module Shows Warnings About AzureRM Retirement #23000

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

Closed
agerasimchikeg opened this issue Oct 17, 2023 · 7 comments
Closed

Azure PowerShell Module Shows Warnings About AzureRM Retirement #23000

agerasimchikeg opened this issue Oct 17, 2023 · 7 comments
Labels
AzureRM 6.x customer-reported needs-team-attention This issue needs attention from Azure service team or SDK team

Comments

@agerasimchikeg
Copy link

Description

If you install both the “Azure” and the “AzureRM” modules, when using "Azure" module cmdlets you receive warnings about “AzureRM” module retirement:

'Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.'

The “Azure” and “AzureRM” PowerShell modules comes with their own copies of an internal library called Microsoft.WindowsAzure.Commands.Common.dll. This library contains various infrastructure-logic and it’s this library which produce the retirement-warning. There appears to be an issue with the DLL search order when this library is loaded - when you are using the Azure module, the AzureRM-copy of this library is loaded.

Reproducing the issue:

  1. Create a new Azure Virtual Machine of type Windows Server 2022 Datacenter Azure Edition.
  2. Log on to the VM.
  3. Run the PowerShell command “Install-Module Azure” to install the Azure module.
  4. Run the PowerShell command “Install-Module AzureRM” to install the AzureRM module.
  5. Open a new PowerShell prompt and run the command Get-AzureDeployment. (This command is part of the “Azure” module)
  6. When prompted for service name, enter an arbitrary string.

Issue script & Debug output

PS C:\Windows\system32> get-azuredeployment

cmdlet Get-AzureDeployment at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
ServiceName: test
DEBUG: 8:38:06 AM - GetAzureDeploymentCommand begin processing with ParameterSet '__AllParameterSets'.
WARNING: Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM
modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.
get-azuredeployment : No default subscription has been designated. Use Select-AzureSubscription -Default
<subscriptionName> to set the default subscription.
At line:1 char:1
+ get-azuredeployment
+ ~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError: (:) [Get-AzureDeployment], ApplicationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentComma
   nd

DEBUG: AzureQoSEvent: CommandName - Get-AzureDeployment; IsSuccess - False; Duration - 00:00:00.1488013; Exception -
System.ApplicationException: No default subscription has been designated. Use Select-AzureSubscription -Default
<subscriptionName> to set the default subscription.
   at
Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateClient[TClient](IAzureContextContainer
profile, IAzureSubscription subscription, String endpoint)
   at System.Lazy`1.CreateValue()
   at System.Lazy`1.LazyInitValue()
   at
Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand.<OnProcessRecord>b__8_0()
   at
Microsoft.WindowsAzure.Commands.Utilities.Common.ServiceManagementBaseCmdlet.ExecuteClientActionNewSM[TResult](Object
input, String operationDescription, Func`1 action, Func`3 contextFactory);
DEBUG: Finish sending metric.
DEBUG: 8:38:07 AM - GetAzureDeploymentCommand end processing.
DEBUG: 8:38:07 AM - GetAzureDeploymentCommand end processing.

Environment data

Name                           Value
----                           -----
PSVersion                      5.1.22000.2538
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.22000.2538
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1

Module versions

ModuleType Version    Name                                ExportedCommands
---------- -------    ----                                ----------------
Script     5.8.4      AzureRM.Profile                     {Add-AzureRmEnvironment, Clear-AzureRmContext, Clear-Azure...

Error output

PS C:\Windows\system32> resolve-azurermerror
DEBUG: 8:39:57 AM - ResolveError begin processing with ParameterSet 'AnyErrorParameterSet'.
WARNING: Because the Az modules have all the capabilities of AzureRM modules and more, we will retire the AzureRM
modules on 29 February 2024. Learn more about the migration to Az: http://aka.ms/azpsmigrate.


   HistoryId: 5


Message        : No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName>
                 to set the default subscription.
StackTrace     :    at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateClient[TClient](IAz
                 ureContextContainer profile, IAzureSubscription subscription, String endpoint)
                    at System.Lazy`1.CreateValue()
                    at System.Lazy`1.LazyInitValue()
                    at Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand.<OnPr
                 ocessRecord>b__8_0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.ServiceManagementBaseCmdlet.ExecuteClientAction
                 NewSM[TResult](Object input, String operationDescription, Func`1 action, Func`3 contextFactory)
Exception      : System.ApplicationException
InvocationInfo : {Get-AzureDeployment}
Line           : get-azuredeployment -debug
Position       : At line:1 char:1
                 + get-azuredeployment -debug
                 + ~~~~~~~~~~~~~~~~~~~~~~~~~~
HistoryId      : 5



   HistoryId: 4


Message        : No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName>
                 to set the default subscription.
StackTrace     :    at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateClient[TClient](IAz
                 ureContextContainer profile, IAzureSubscription subscription, String endpoint)
                    at System.Lazy`1.CreateValue()
                    at System.Lazy`1.LazyInitValue()
                    at Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand.<OnPr
                 ocessRecord>b__8_0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.ServiceManagementBaseCmdlet.ExecuteClientAction
                 NewSM[TResult](Object input, String operationDescription, Func`1 action, Func`3 contextFactory)
Exception      : System.ApplicationException
InvocationInfo : {Get-AzureDeployment}
Line           : get-azuredeployment
Position       : At line:1 char:1
                 + get-azuredeployment
                 + ~~~~~~~~~~~~~~~~~~~
HistoryId      : 4



   HistoryId: 1


Message        : No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName>
                 to set the default subscription.
StackTrace     :    at Microsoft.Azure.Commands.Common.Authentication.Factories.ClientFactory.CreateClient[TClient](IAz
                 ureContextContainer profile, IAzureSubscription subscription, String endpoint)
                    at System.Lazy`1.CreateValue()
                    at System.Lazy`1.LazyInitValue()
                    at Microsoft.WindowsAzure.Commands.ServiceManagement.HostedServices.GetAzureDeploymentCommand.<OnPr
                 ocessRecord>b__8_0()
                    at Microsoft.WindowsAzure.Commands.Utilities.Common.ServiceManagementBaseCmdlet.ExecuteClientAction
                 NewSM[TResult](Object input, String operationDescription, Func`1 action, Func`3 contextFactory)
Exception      : System.ApplicationException
InvocationInfo : {Get-AzureDeployment}
Line           : get-azuredeployment
Position       : At line:1 char:1
                 + get-azuredeployment
                 + ~~~~~~~~~~~~~~~~~~~
HistoryId      : 1

DEBUG: AzureQoSEvent: CommandName - Resolve-AzureRmError; IsSuccess - True; Duration - 00:00:00.1259005; Exception - ;
DEBUG: Finish sending metric.
DEBUG: 8:39:57 AM - ResolveError end processing.
DEBUG: 8:39:57 AM - ResolveError end processing.
@agerasimchikeg agerasimchikeg added AzureRM 6.x needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Oct 17, 2023
@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported and removed needs-triage This is a new issue that needs to be triaged to the appropriate team. labels Oct 17, 2023
@isra-fel
Copy link
Member

Thanks for reporting! Could you try explicitly Import-Module Azure first?

@agerasimchikeg
Copy link
Author

Hello @isra-fel, unfortunately running Import-Module Azure has no change. The warning is still presented.

@isra-fel
Copy link
Member

You can suppress this specific warning by setting the environment variable "SuppressAzureRmModulesRetiringWarning" to "true".

$env:SuppressAzureRmModulesRetiringWarning = 'true'

@agerasimchikeg
Copy link
Author

/unresolve
@isra-fel I was aware that the warnings can be suppressed, the concern is that the commands will stop functioning when the AzureRM modules have been retired if the Azure modules are in fact using an incorrect dll. I have a Microsoft support case open as well and they were not able to confirm, so they directed me to open the issue here to have it investigated.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed issue-addressed labels Oct 19, 2023
@Nickos86
Copy link

Nickos86 commented Jan 8, 2024

@agerasimchikeg, did you get any update on this? I've got the same issue, same service management module. When removing AzureRM locally it works as expected but I'm unable to easily remove AzureRM modules from all our VMs.

@LokeshNagireddy
Copy link

Hi All, @agerasimchikeg, i too got the same error,

image

did you got some update on this issue?

@Alex-AZPS
Copy link

AzureRM already retired, closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AzureRM 6.x customer-reported needs-team-attention This issue needs attention from Azure service team or SDK team
Projects
None yet
Development

No branches or pull requests

5 participants