I have multiple Azure Subscriptions configured with my Microsoft Account (formerly Live ID) Some time back couple of subscriptions were disabled due to excessive usage, which is fine. However, at this time when I tried to manage the same using PowerShell I was getting the following error every time I tried to Import the Publish Settings file using Import-AzurePublishSettingsFile command.
I ran the following command
PS C:\> Import-AzurePublishSettingsFile -PublishSettingsFile 'C:\Final\<SUBSCRIPTION_NAME>.publishsettings'
I did not understand what was the problem around the same as every time I use the same method & it works. But never I faced any issue. I checked on to the management portal just to verify if it has created proper certificates. Here is the output.
I then decided to search online to see what was the problem. I found a link that explains the same behavior.
Interestingly the answer suggested by Neil was appropriate. The subscription data was stored earlier in the following folder C:\Users\aviraj\AppData\Roaming\Windows Azure Powershell
And that was the problem as the data included my disabled subscription details as well, which are not available in my newly downloaded Publish Settings File.
Just delete all the files in the folder C:\Users\<USER>\AppData\Roaming\Windows Azure Powershell
And try to re-run the same command Import-PublishSettingsFile & voila problem is solved
FYI, I found that this would not work until PowerShell was closed and re-opened.
Thanks Aviraj :) It worked for me as well, like Robin after restarting powershell
Thanks for this, I removed a certificate from my machine and was then getting this error getting any Azure commands. I couldn't even list which certificates had been set or remove the old entries. Manually removed them from this config file worked.