Skip to content

Commit 7eb7736

Browse files
committed
Minor update
1 parent 19a354f commit 7eb7736

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

shell/agents/Microsoft.Azure.Agent/Telemetry.cs

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,20 @@ internal static void Initialize()
1717
{
1818
InstallationId = null;
1919

20+
string azCLIProfilePath, azPSHProfilePath;
2021
string azureConfigDir = Environment.GetEnvironmentVariable("AZURE_CONFIG_DIR");
2122
string userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
22-
string azCLIProfilePath = Path.Combine(azureConfigDir ?? Path.Combine(userProfile, ".azure"), "azureProfile.json");
23-
string azPSHProfilePath = Path.Combine(azureConfigDir ?? Path.Combine(userProfile, ".Azure"), "AzureRmContextSettings.json");
23+
24+
if (string.IsNullOrEmpty(azureConfigDir))
25+
{
26+
azCLIProfilePath = Path.Combine(userProfile, ".azure", "azureProfile.json");
27+
azPSHProfilePath = Path.Combine(userProfile, ".Azure", "AzureRmContextSettings.json");
28+
}
29+
else
30+
{
31+
azCLIProfilePath = Path.Combine(azureConfigDir, "azureProfile.json");
32+
azPSHProfilePath = Path.Combine(azureConfigDir, "AzureRmContextSettings.json");
33+
}
2434

2535
try
2636
{

0 commit comments

Comments
 (0)