We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
Your Azure credentials have not been set up or have expired, please run Connect-AzureRmAccount to set up your Azure credentials.
Despite this being Az, not AzureRM, we get an error that tells you to use Connect-AzureRmAccount?
Also, this code worked fine on Windows, Windows PowerShell, using AzureRm. When reloading the saved file, it's not logging you back in
#region Login-Az()
Function Login-Az() { Param ([String]$Subscription, [String]$UPN)
$ProfilePath = (Split-Path $Profile.CurrentUserCurrentHost) + "/" $AzContext = Import-AzContext -Path $($ProfilePath + $UPN + "@$Subscription.json") -ErrorAction SilentlyContinue If ([string]::IsNullOrEmpty($AzContext)) { $AzContext = Connect-AzAccount -Subscription $Subscription -Environment "AzureCloud" Save-AzContext -Profile $AzContext -Path $($ProfilePath + $AzContext.Context.Account.Id + "@$Subscription.json") -Force # Get-AzureRmContext } Else { Select-AzSubscription -Name $AzContext.Context.Subscription.Name -Context $AzContext.Context } Return $AzContext
} #endregion Login-Az()
Get-Module -ListAvailable
$PSVersionTable
The text was updated successfully, but these errors were encountered:
This is related to these open / closed issues and a bug fix appears to be on its way.
#7110
#7456
#7949
Sorry, something went wrong.
No branches or pull requests
Description
Your Azure credentials have not been set up or have expired, please run Connect-AzureRmAccount to set up your Azure credentials.
Despite this being Az, not AzureRM, we get an error that tells you to use Connect-AzureRmAccount?
Also, this code worked fine on Windows, Windows PowerShell, using AzureRm. When reloading the saved file, it's not logging you back in
Script/Steps for Reproduction
#region Login-Az()
Function Login-Az()
{
Param ([String]$Subscription, [String]$UPN)
}
#endregion Login-Az()
Module Version
Environment Data
$PSVersionTable
Debug Output
The text was updated successfully, but these errors were encountered: