Skip to content
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

Azure cli path undefined fix. #8953

Merged
merged 3 commits into from
Nov 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,6 @@
"loc.messages.AzureSDKNotFound": "Azure CLI 2.x is not installed on this machine.",
"loc.messages.FailedToLogout": "The following error occurred while logging out: %s",
"loc.messages.LoginFailed": "Azure login failed",
"loc.messages.ErrorInSettingUpSubscription": "Error in setting up subscription"
"loc.messages.ErrorInSettingUpSubscription": "Error in setting up subscription",
"loc.messages.SettingAzureConfigDir": "Setting AZURE_CONFIG_DIR env variable to: %s"
}
11 changes: 8 additions & 3 deletions Tasks/AzureCLIV1/azureclitask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,19 @@ export class azureclitask {

private static setConfigDirectory(): void {
var configDirName: string = "c" + new Date().getTime(); // 'c' denotes config
var basePath: string;
if (tl.osType().match(/^Win/)) {
this.azCliConfigPath = path.join(process.env.USERPROFILE, ".azclitask", configDirName);
basePath = process.env.USERPROFILE;
}
else {
this.azCliConfigPath = path.join(process.env.HOME, ".azclitask", configDirName);
basePath = process.env.HOME;
}

process.env['AZURE_CONFIG_DIR'] = this.azCliConfigPath;
if (!!basePath) {
this.azCliConfigPath = path.join(basePath, ".azclitask", configDirName);
console.log(tl.loc('SettingAzureConfigDir', this.azCliConfigPath));
process.env['AZURE_CONFIG_DIR'] = this.azCliConfigPath;
}
}

private static logoutAzure() {
Expand Down
7 changes: 4 additions & 3 deletions Tasks/AzureCLIV1/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"demands": [],
"version": {
"Major": 1,
"Minor": 143,
"Patch": 2
"Minor": 144,
"Patch": 1
},
"minimumAgentVersion": "2.0.0",
"instanceNameFormat": "Azure CLI $(scriptPath)",
Expand Down Expand Up @@ -134,6 +134,7 @@
"AzureSDKNotFound": "Azure CLI 2.x is not installed on this machine.",
"FailedToLogout": "The following error occurred while logging out: %s",
"LoginFailed": "Azure login failed",
"ErrorInSettingUpSubscription": "Error in setting up subscription"
"ErrorInSettingUpSubscription": "Error in setting up subscription",
"SettingAzureConfigDir": "Setting AZURE_CONFIG_DIR env variable to: %s"
}
}
7 changes: 4 additions & 3 deletions Tasks/AzureCLIV1/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
"demands": [],
"version": {
"Major": 1,
"Minor": 143,
"Patch": 2
"Minor": 144,
"Patch": 1
},
"minimumAgentVersion": "2.0.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down Expand Up @@ -134,6 +134,7 @@
"AzureSDKNotFound": "ms-resource:loc.messages.AzureSDKNotFound",
"FailedToLogout": "ms-resource:loc.messages.FailedToLogout",
"LoginFailed": "ms-resource:loc.messages.LoginFailed",
"ErrorInSettingUpSubscription": "ms-resource:loc.messages.ErrorInSettingUpSubscription"
"ErrorInSettingUpSubscription": "ms-resource:loc.messages.ErrorInSettingUpSubscription",
"SettingAzureConfigDir": "ms-resource:loc.messages.SettingAzureConfigDir"
}
}