Is your feature request related to a problem? Please describe.
Sharing login context between Azure CLI and Azure PowerShell is not supported by now.
Describe the solution you'd like
Azure CLI and Azure PowerShell can share their login context so that users can choose to use either command:
Additional context
To share login context, Azure CLI and Azure PowerShell must share 2 things:
|
Azure CLI |
Azure PowerShell |
| context |
azureProfile.json |
AzureRmContext.json |
| token cache |
accessTokens.json |
TokenCache.dat |
For token cache, once both migrate to MSAL, TokenCache.dat and accessTokens.json will be merged into
C:\Users\<username>\AppData\Local\.IdentityService\msal.cache
so we get shared msal.cache out of the box.
But for AzureRmContext.json and azureProfile.json, it is very hard for Azure CLI to use AzureRmContext.json from Azure PowerShell given the internal implementation logic is such different.
Also, Azure CLI faces another issue for tenant/user isolation which should also be addressed first before sharing login context with Azure PowerShell: #15005.
If this is really something we need to achieve, drastic overhaul of Azure CLI and Azure PowerShell is necessary.
Is your feature request related to a problem? Please describe.
Sharing login context between Azure CLI and Azure PowerShell is not supported by now.
Describe the solution you'd like
Azure CLI and Azure PowerShell can share their login context so that users can choose to use either command:
az loginConnect-AzAccountaz account setSet-AzContextAdditional context
To share login context, Azure CLI and Azure PowerShell must share 2 things:
azureProfile.jsonAzureRmContext.jsonaccessTokens.jsonTokenCache.datFor token cache, once both migrate to MSAL,
TokenCache.datandaccessTokens.jsonwill be merged intoso we get shared
msal.cacheout of the box.But for
AzureRmContext.jsonandazureProfile.json, it is very hard for Azure CLI to useAzureRmContext.jsonfrom Azure PowerShell given the internal implementation logic is such different.Also, Azure CLI faces another issue for tenant/user isolation which should also be addressed first before sharing login context with Azure PowerShell: #15005.
If this is really something we need to achieve, drastic overhaul of Azure CLI and Azure PowerShell is necessary.