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.
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
Hope it helps!
PS: Thanks to Wriju for sharing this tip.