-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting session configuration path (especially/account/subscription/token) - AZURE_CONFIG_DIR equivalent #15456
Comments
PowerShell cmdlet syntax is different from CLI syntax. The syntax supports mandatory parameter or optional parameter. If mandatory parameter is changed to optional and relies on default setting, user cannot understand cmdlet original design and its corresponding rest API. Recently, we also found a problem on default resource group. Currently, some services allow to fetch resource across resource groups in one subscription. In that case, resource group becomes optional. Consequently, implementation of cmdlet cannot tell how to handle the logic when user doesn't provide resource group. Azure PowerShell is aiming to automation environment and user is sensitive to breaking change. We'd like to make cmdlet syntax more accurate and be conservative on syntax change. |
The But all that is beside the point - I am not suggesting any breaking change at all. I'm saying keep everything exactly as it is, but allow me to set an environment variable that will effectively create an additional "sandboxed" Az Powershell instance with its own context. Basically just save all the current context information you're already saving today to a different folder, instead of the currently hard-coded one inside
I can actually achieve this effect today by using multiple WSL instances, but it's just not as convenient - I have to update PowerShell in all of them, make sure all my other tools are there and generally manage multiple containers instead of one... |
@ohadschn Azure PowerShell has several cmdlets to manage contexts and offers the possibility to not save it on disk with We will be considering your suggestion for handling defaults parameters in Azure PowerShell more globally. |
@dcaro let me reiterate that I'm not suggesting any change at all to the way Az PowerShell behaves, be it in terms of global/default parameters, default context persistence, or otherwise. Nothing in my proposed change will cause any regression in any use case. If I'm just saying that whatever context you do persist, let me configure the folder where it's persisted (rather than the currently hard-coded one under So for a user that doesn't set this proposed This will allow the user to work against multiple accounts/clouds at the same time on the same machine, using multiple PowerShell sessions, each one configured against a different folder - exactly as they do in az cli: Azure/azure-cli#1347. |
Sorry for the misunderstanding, this in our backlog. |
Hi @ohadschn , We hope to evaluate the benefit of making it configurable. The folder has been introduced for couple years and changing it requires lots of efforts. For the time being, it sounds this configuration allows user to work with multiple accounts/clouds at the same time. Is it the common case? I believe user may use incorrect |
Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you! |
hi @dingmeng-xue,
|
Description of the new feature
az cli
supports setting its session configuration folder (including current account/context/subscription/token) via aAZURE_CONFIG_DIR
environment variable: https://docs.microsoft.com/en-us/cli/azure/azure-cli-configuration#cli-configuration-file.This is extremely useful for the case where one works concurrently against multiple accounts (even in different cloud instances, e.g. Public/Mooncake/Fairfax/BlackForest): Azure/azure-cli#1347
It might also provide a path for improving the PowerShell concurrency/
Start-Job
experience: #9448Proposed implementation details
Allow overriding the currently used %LOCALAPPDATA% with a user-supplied environment variable (e.g.
AZ_CONFIG_DIR
).The text was updated successfully, but these errors were encountered: