Azure Service Manager Account & Subscription Cache

If you are using the Azure Service Manager Module you will notice that the cmdlet’s such as Add-AzureAccount and Login-AzureAsAccount cache the subscriptions that the user has access to (the user which is specified in the credentials used to authenticate).

Where is this cache maintained locally on the client?

For Windows desktops it is in the users %appdata% directory.  For Windows 10, it is here:

C:\Users\CJOHNSTO\AppData\Roaming\Windows Azure Powershell

There are 2 files:

AzureProfile.json  :  lists which subscriptions and accounts have been authenticated
TokenCache.dat  :   caches the authentication token

If you need to cleanup this cache, you can use the cmdlet Remove-AzureAccount.  This cmdlet takes either an Account to remove, or a Subscription.  If you specify an account, it will remove all the subscriptions cached for that account.

category:

Leave a Reply