Azure PowerShell ForbiddenError: The server failed to authenticate the request. Verify the certificate is valid and is associated with this subscription.

 Hi There,

 You might be here reading this blog because of the below error!

ForbiddenError: The server failed to authenticate the request. Verify the certificate is valid and is associated with this subscription. You might get this error when you are working on Azure PowerShell and this being most common error when working with PowerShell.

clip_image002

How to fix this?

Turns out to be simple pretty straight forward, but I spent almost 3 hours in mid night figuring out what’s wrong in command or what's wrong with certificate  and the below command does the magic of clearing your azure profile which is existing.

Clear-AzureProfile

 

You can also consider deleting the content of the folder C:\Users\AppData\Roaming\Windows Azure Powershell  manually . After which again run Add-AzureAccount to get the fresh/new one by entering your subscription details and  then execute any Azure PowerShell commands that you wish to run Smile

Hope it helps!

PS: Thanks to Wriju for sharing this tip.

Comments

  • Anonymous
    July 19, 2015
    Thank you so much for posting this, it was giving me a complete headache. much appreciated!!!

  • Anonymous
    July 26, 2015
    I would have lost almost all my morning on this if it was not for you. Thanks a lot.

  • Anonymous
    August 17, 2015
    I tried the same but that didnt worked on VM

  • Anonymous
    August 25, 2015
    @Aakash: Clear-AzureProfile should help, let me kniow what error you're getting

  • Anonymous
    October 19, 2015
    The comment has been removed