3

Context

I've just installed PowerShell 7. I am trying to run my working tested Azure related scripts... So I installed and imported AzureAd and AzureRM modules.

When trying to log in either Connect-AzureAD or Connect-AzureRmAccountboth gave me the following error (keep reading)

Could not load type 'System.Security.Cryptography.SHA256Cng'

OK, this is because the Azure Modules are looking for that API, which is not available in .NET Core, so I used the Import-Module with the -UseWindowsPowerShell parameter, which solved the issue but only for the AzureAD module

Question

For the command Import-Module AzureRm -UseWindowsPowerShell I got the following error message:

Import-Module: Failed to generate proxies for remote module 'AzureRM'. Running the Get-Command command in a remote session returned no results.

So I still can not use Connect-AzureRmAccount Any ideas?

1 Answer 1

8

The AzureRm is incompatible with PowerShell 7, and it has been deprecated and will not be updated.

Your option is to use the Az module, just uninstall the AzureRm module and install the Az module.

Install-Module -Name Az -Force

Fore more details, see Introducing the new Azure PowerShell Az module.

Then use the Connect-AzAccount to login, if you don't want to change your existing script which uses AzureRm command, just use Enable-AzureRmAlias before all the commands.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.