FIX: The current subscription type is not permitted to perform operations on any provider namespace

Please use a different subscription?

One of my automated scripts suddenly stopped working. I saw the following error message in Azure Automation:

Get-AzureRmStorageAccount : The current subscription type is not permitted to perform operations on any provider namespace. Please use a different subscription.

I was surprised because this script has been running daily for more than a year, why shouldn’t it work now?


An easy fix though…

Add the following command to your script and adjust the subscription to your own subscription.

Set-AzureRmContext -Subscription SUBSCRIPTION

The subscription with us has been the same for ages, so why I suddenly had to add this, I still do not understand. It will solve the problem though.

I thought you only added this if you have multiple subscriptions within your Azure environment. It may be that this has recently changed.

For more about Set-AzureRMContext, you can best go to this Docs post from Microsoft.


A little extra

This post contains PowerShell. Would you like to learn the basics better? I have created a new website to learn basic PowerShell in an ’emulator’ environment.

Click here to go learn Basic PowerShell.

Published by

Bas Wijdenes

My name is Bas Wijdenes and I work as a PowerShell DevOps Engineer. In my spare time I write about interesting stuff that I encounter during my work.

Leave a Reply

Your email address will not be published. Required fields are marked *