azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

New PowerShell commands v.2.4.0 Az not being compatible with Azure classic v.5.3.0

Open monika3376 opened this issue 7 years ago • 2 comments

Microsoft hasn’t ended support for Classic Cloud Services, so description of issues found is below:

It is not possible to import module Azure as it depends on Azure.Storage which has commands mapping to Az.Storage after enable aliases is turned on: Import-Module Azure.Storage -MinimumVersion 4.3.0 -Scope Global -> from C:\Program Files\WindowsPowerShell\Modules\Azure\5.3.0\Azure.psm1

Azure.Storage using Import-Module AzureRM.Profile -MinimumVersion 5.6.0 -Scope Global -> from C:\Program Files\WindowsPowerShell\Modules\Azure.Storage\4.6.1\Azure.Storage.psm1

But we removed all AzureRM modules…

We hacked C:\Program Files\WindowsPowerShell\Modules\Azure\5.3.0\Azure.psm1 by changing Azure.Storage to Az.Storage, minimum version 1.5.0 – that fixed import issue.

Az commands break the ability to use Cert Auth in Azure cmdlets. This is important because there is not availability to let Service Principle become co-admin so we don’t have an easy way to using another account. This is failing with error:

Import-AzurePublishSettingsFile -PublishSettingsFile pub.set Select-AzureSubscription -SubscriptionId '$Id'

Get-AzureService -Debug

image

monika3376 avatar Jul 16 '19 06:07 monika3376

@monika3376 Hi. This is a known issue. You can track the work here: #8167 The workaround is to run Az and Azure modules in separate PowerShell sessions.

niander avatar Jul 16 '19 22:07 niander

@niander Sorry but I don't understand the workaround. this issue isn't running the cmdlets in the same session, its having then installed on the same box. install both, open prompt, log in to azure with cert, fun get-azureservices, fail.

timpoth avatar Jul 17 '19 12:07 timpoth