Is your feature request related to a problem? Please describe.
The Azure CLI shared context across multiple applications and sessions is a shared resource that will cause a race condition if a customer uses multiple environments simultaneously. E.g., an Azure Stack user who also accesses the Azure Cloud.
The only alternative is to run any interaction with Azure and Azure Stack sequentially, which is not always feasible, e.g., if a customer has a pipeline with integration tests that runs code in parallel accessing Azure or Azure Stack simultaneously on the same VM. Furthermore, SDKs and tools may consume Azure CLI, which does not inherently support multiple simultaneous contexts, therefore propagating the race condition issue to other tools.
Is your feature request related to a problem? Please describe.
The Azure CLI shared context across multiple applications and sessions is a shared resource that will cause a race condition if a customer uses multiple environments simultaneously. E.g., an Azure Stack user who also accesses the Azure Cloud.
Describe the solution you'd like
A configuration that can modularize contexts by session so that it is no longer a shared resource. This feature would be similar to the
-scope
parameter for Azure PowerShell below, which saves a log-in context to the current PowerShell session: https://docs.microsoft.com/en-us/powershell/azure/context-persistence?view=azps-7.4.0&viewFallbackFrom=azps-7.1.0#save-azure-contexts-across-powershell-sessionsDescribe alternatives you've considered
The only alternative is to run any interaction with Azure and Azure Stack sequentially, which is not always feasible, e.g., if a customer has a pipeline with integration tests that runs code in parallel accessing Azure or Azure Stack simultaneously on the same VM. Furthermore, SDKs and tools may consume Azure CLI, which does not inherently support multiple simultaneous contexts, therefore propagating the race condition issue to other tools.
Additional context
Related issue: https://github.com/Azure/login/issues/202