Azure / Azure/azure-powershell
Installation Id in `AzureRmContextSettings.json` cannot keep the same with AZ CLI under specific situations
- Dominant language
- C#
- Stars
- 4.8k
- Forks
- 4.3k
- Avg merge
- 3d 14h
- Merged PRs (30d)
- 54
Description
### Description
### Background
After Installing Azure PowerShell, during the first time importing Az.Accounts, we will generate a file called `AzureRmContextSettings.json`.
For the `InstallationId` session in this file, we follow the rules:
- If detected `azconfig.json` generated by AzCLI Installation id, reuse it.
- If not detected, randomly generate a new guid.
By doing so, we can identify the Machines calling AzCLI/ AzPS command by the installation Id.
### Issue
But we have some troubles while trying reusing this id. The Installation Id cannot keep the same with AZ CLI under situations when:
- Under case-sensitive systems, like Lunix/ MacOS.
- User defined a `AZURE_CONFIG_DIR` while installing AzCLI (*).
(*) How AzCLI generate an Installation Id:
- It first checks if the environment variable AZURE_CONFIG_DIR is set.
- If AZURE_CONFIG_DIR is not set, it defaults to ~/.azure/.
### Issue script & Debug output
N/A
### Environment data
N/A
### Module versions
N/A
### Error output
N/A
Contributor guide
Research direction
Start by tracing the first import of Az.Accounts that creates AzureRmContextSettings.json, then compare how it locates the Azure CLI azconfig.json when AZURE_CONFIG_DIR is set and on case-sensitive systems. Done means Azure PowerShell preserves the Azure CLI InstallationId in both described situations, with coverage for those configuration paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp, powershell
- Domain
- cli, cloud
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100