In this post we are going to talk about the one cmdlet which would allow you to stay connected with your az account context even if you closed your PS Session.
Lets configure with the help of few easy commands :-
Connect-AzAccount
*Prompt would appear to login with user name and password*
Once you logged in either select or set the context -
Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"
Name Account SubscriptionName Environment TenantId
---- ------- ---------------- ----------- --------
Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x...
Now you need to enable the autosave az context , so that whenever you open the PS you would have the same context and no need to go thought the login process again - use this cmdlet -
Enable-AzContextAutosave
Once you run the above command you are all set until your credentials are not expired.
Lets configure with the help of few easy commands :-
Connect-AzAccount
*Prompt would appear to login with user name and password*
Once you logged in either select or set the context -
Set-AzContext -SubscriptionId "xxxx-xxxx-xxxx-xxxx"
Name Account SubscriptionName Environment TenantId
---- ------- ---------------- ----------- --------
Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x...
Now you need to enable the autosave az context , so that whenever you open the PS you would have the same context and no need to go thought the login process again - use this cmdlet -
Enable-AzContextAutosave
Once you run the above command you are all set until your credentials are not expired.
No comments:
Post a Comment