Condividi tramite


Your Azure credentials have not been set up

I recently upgraded to version 0.8.16 of Azure PowerShell and I got the following error when trying Get-AzureVM: "Your Azure credentials have not been set up or have expired, please run Add-AzureAccount to set up your Azure credentials". JHealy has a blog post describing the error but his solution involved completing the Azure registration process; I've been registered and active for a while. The solution was in the comments thread of his post, though. I have a modified approach that suited my needs since I need to clean out several accounts

#Remove all accounts
Get-AzureAccount | %{Remove-AzureAccount -Name $_.Id}
Clear-AzureProfile

The comment in the other post also suggests running the Add-AzureAccount cmdlet but I re-registered using the Get-AzurePublishSettingsFile cmdlet and then then importing per the instructions below. They show up on the web page that is rendered when you execute Get-AzurePublishSettings. This solved my problem without having to execute Add-AzureAccount

Comments

  • Anonymous
    April 09, 2016
    Cheers for that little tip. Worked perfectly for me!
    Note to self: Azure creds expire in PowerShell
  • Anonymous
    May 28, 2016
    Very useful thanks