File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed
shell/agents/Microsoft.Azure.Agent Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -17,10 +17,20 @@ internal static void Initialize()
1717 {
1818 InstallationId = null ;
1919
20- string azureConfigDir = Environment . GetEnvironmentVariable ( "AZURE_CONFIG_DIR" )
21- ?? Path . Combine ( Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) , ".azure" ) ;
22- string azCLIProfilePath = Path . Combine ( azureConfigDir , "azureProfile.json" ) ;
23- string azPSHProfilePath = Path . Combine ( azureConfigDir , "AzureRmContextSettings.json" ) ;
20+ string azCLIProfilePath , azPSHProfilePath ;
21+ string azureConfigDir = Environment . GetEnvironmentVariable ( "AZURE_CONFIG_DIR" ) ;
22+ string userProfile = Environment . GetFolderPath ( Environment . SpecialFolder . UserProfile ) ;
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 {
You can’t perform that action at this time.
0 commit comments