Have a function that just runs:
Login-AzureRmAccount
Note the error:
{
"Exception": {
"Source": "Microsoft.Azure.Commands.Common.Authentication.Abstractions",
"StackTrace": " at Microsoft.Azure.Commands.Common.Authentication.AzureSession.get_Instance()
at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing()\n
at System.Management.Automation.Cmdlet.DoBeginProcessing()
at System.Management.Automation.CommandProcessorBase.DoBegin()",
"Message": "The Azure PowerShell session has not been properly initialized. Please import the module and try again."
}
}
This same cmdlet works just fine in pwsh:
> Login-AzureRmAccount
WARNING: To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code AASFDASF to authenticate.
We can fix the above error by Import-Module AzureRm.Netcore but we should understand why this is needed.
Have a function that just runs:
Login-AzureRmAccountNote the error:
{ "Exception": { "Source": "Microsoft.Azure.Commands.Common.Authentication.Abstractions", "StackTrace": " at Microsoft.Azure.Commands.Common.Authentication.AzureSession.get_Instance() at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing()\n at System.Management.Automation.Cmdlet.DoBeginProcessing() at System.Management.Automation.CommandProcessorBase.DoBegin()", "Message": "The Azure PowerShell session has not been properly initialized. Please import the module and try again." } }This same cmdlet works just fine in
pwsh:We can fix the above error by
Import-Module AzureRm.Netcorebut we should understand why this is needed.