Skip to content

Commit 3df7fee

Browse files
author
himanshu yadav
authored
Merge pull request #2695 from Microsoft/users/hiyada/portCliFix
azure cli "" in cmdlets, rg and cli patch increase, help text in azure rg
2 parents 08c4cbf + 2394631 commit 3df7fee

File tree

8 files changed

+45
-45
lines changed

8 files changed

+45
-45
lines changed

Tasks/AzureCLI/azureclitask.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ export class azureclitask {
120120
//set the azure mode to arm to use azureRM commands
121121
this.throwIfError(tl.execSync("azure", "config mode arm"));
122122
//login using svn
123-
this.throwIfError(tl.execSync("azure", "login -u " + servicePrincipalId + " -p " + servicePrincipalKey + " --tenant " + tenantId + " --service-principal"));
123+
this.throwIfError(tl.execSync("azure", "login -u \"" + servicePrincipalId + "\" -p \"" + servicePrincipalKey + "\" --tenant \"" + tenantId + "\" --service-principal"));
124124
this.isLoggedIn = true;
125125
//set the subscription imported to the current subscription
126-
this.throwIfError(tl.execSync("azure", "account set " + subscriptionName));
126+
this.throwIfError(tl.execSync("azure", "account set \"" + subscriptionName + "\""));
127127
}
128128

129129
private static loginAzureClassic(connectedService):void {
@@ -136,20 +136,20 @@ export class azureclitask {
136136
var subscriptionId:string = tl.getEndpointDataParameter(connectedService, "SubscriptionId", true);
137137
const publishSettingFileName:string = path.join(os.tmpdir() ,"subscriptions" + new Date().getTime() + ".publishsettings");
138138
this.createPublishSettingFile(subscriptionName, subscriptionId, bytes, publishSettingFileName);
139-
var resultOfToolExecution = tl.execSync("azure", "account import " + publishSettingFileName);
139+
var resultOfToolExecution = tl.execSync("azure", "account import \"" + publishSettingFileName + "\"");
140140
this.deleteFile(publishSettingFileName);
141141
this.throwIfError(resultOfToolExecution);
142142
this.isLoggedIn = true;
143143
//set the subscription imported to the current subscription
144-
this.throwIfError( tl.execSync("azure", "account set " + subscriptionName));
144+
this.throwIfError( tl.execSync("azure", "account set \"" + subscriptionName + "\""));
145145
}
146146
else if (endpointAuth.scheme === "UsernamePassword") {
147147
var username:string = endpointAuth.parameters["username"];
148148
var passwd:string = endpointAuth.parameters["password"];
149-
this.throwIfError(tl.execSync("azure", "login -u " + username + " -p " + passwd));
149+
this.throwIfError(tl.execSync("azure", "login -u \"" + username + "\" -p \"" + passwd + "\""));
150150
this.isLoggedIn = true;
151151
//set the subscription imported to the current subscription
152-
this.throwIfError(tl.execSync("azure", "account set " + subscriptionName));
152+
this.throwIfError(tl.execSync("azure", "account set \"" + subscriptionName + "\""));
153153
}
154154
else {
155155
var err;
@@ -179,7 +179,7 @@ export class azureclitask {
179179
private static logoutAzureRM(connectedService:string)
180180
{
181181
var subscriptionName:string = tl.getEndpointDataParameter(connectedService, "SubscriptionName", true);
182-
tl.execSync("azure", " account clear -s " + subscriptionName);
182+
tl.execSync("azure", " account clear -s \"" + subscriptionName + "\"");
183183
}
184184

185185
private static logoutAzureClassic(connectedService:string)
@@ -188,11 +188,11 @@ export class azureclitask {
188188
if(endpointAuth["scheme"] === "usernamePassword")
189189
{
190190
var username:string = endpointAuth.parameters["username"];
191-
tl.execSync("azure", "logout -u " + username);
191+
tl.execSync("azure", "logout -u \"" + username + "\"");
192192
}
193193
else {
194194
var subscriptionName:string = tl.getEndpointDataParameter(connectedService, "SubscriptionName", true);
195-
tl.execSync("azure", " account clear -s " + subscriptionName);
195+
tl.execSync("azure", " account clear -s \"" + subscriptionName + "\"");
196196
}
197197
}
198198

Tasks/AzureCLI/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vsts-tasks-azurecli",
3-
"version": "0.2.1",
3+
"version": "0.2.2",
44
"description": "VSTS Azure CLI Task",
55
"main": "azureclitask.js",
66
"scripts": {

Tasks/AzureCLI/task.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"version": {
1515
"Major": "0",
1616
"Minor": "2",
17-
"Patch": "1"
17+
"Patch": "2"
1818
},
1919
"minimumAgentVersion": "1.95.0",
2020
"instanceNameFormat": "Azure CLI $(scriptPath)",

Tasks/AzureCLI/task.loc.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
"version": {
1818
"Major": "0",
1919
"Minor": "2",
20-
"Patch": "1"
20+
"Patch": "2"
2121
},
2222
"minimumAgentVersion": "1.95.0",
2323
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",

Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function Validation-Deploy-AzureResourceGroup
4545
}
4646
else
4747
{
48-
$azureResourceGroupValidationError = Test-AzureRmResourceGroupDeployment -ResourceGroupName $azureResourceName -TemplateFile $csmFile -TemplateParameterFile $csmParametersFile $overrideParameters -Verbose -ErrorAction silentlyContinue
48+
$azureResourceGroupValidationError = Test-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $csmFile -TemplateParameterFile $csmParametersFile $overrideParameters -Verbose -ErrorAction silentlyContinue
4949
}
5050

5151
$azureResourceGroupValidationError

Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@
1919
"loc.input.help.cloudService": "Provide the name of the cloud service.",
2020
"loc.input.label.location": "Location",
2121
"loc.input.help.location": "Location for deploying the resource group. If the resource group already exists in the subscription, then this value will be ignored.",
22-
"loc.input.label.deploymentMode": "Deployment Mode",
23-
"loc.input.help.deploymentMode": "Specify the deployment mode for Azure Resource Manager template.",
2422
"loc.input.label.csmFile": "Template",
2523
"loc.input.help.csmFile": "Specify the path to the Azure Resource Manager template. For more information about the templates see https://aka.ms/azuretemplates. To get started immediately use template https://aka.ms/sampletemplate.",
2624
"loc.input.label.csmParametersFile": "Template Parameters",
2725
"loc.input.help.csmParametersFile": "Specify the path for the parameters file for the Azure Resource Manager Template.",
2826
"loc.input.label.overrideParameters": "Override Template Parameters",
27+
"loc.input.label.deploymentMode": "Deployment Mode",
28+
"loc.input.help.deploymentMode": "Incremental mode handles deployments as incremental updates to the resource group . It leaves unchanged resources that exist in the resource group but are not specified in the template. \n\n Complete mode deletes resources that are not in your template. \n\n Validate mode enables you to find problems with the template before creating actual resources. \n\n By default, Incremental mode is used.",
2929
"loc.input.help.overrideParameters": "Specify the template parameters to override like, <br>–storageName fabrikam –adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) –azureKeyVaultName $(fabrikamFibre).",
3030
"loc.input.label.enableDeploymentPrerequisitesForCreate": "Enable Deployment Prerequisites",
3131
"loc.input.help.enableDeploymentPrerequisitesForCreate": "Enabling this option configures Windows Remote Management (WinRM) listener over HTTPS protocol on port 5986, using a self-signed certificate. This configuration is required for performing deployment operation on Azure machines. If the target Virtual Machines are backed by a Load balancer, ensure Inbound NAT rules are configured for target port (5986).",

Tasks/DeployAzureResourceGroup/task.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 90
16+
"Patch": 91
1717
},
1818
"demands": [
1919
"azureps"
@@ -138,20 +138,6 @@
138138
},
139139
"visibleRule": "action = Create Or Update Resource Group"
140140
},
141-
{
142-
"name": "deploymentMode",
143-
"type": "pickList",
144-
"label": "Deployment Mode",
145-
"defaultValue": "Incremental",
146-
"required": true,
147-
"helpMarkDown": "Specify the deployment mode for Azure Resource Manager template.",
148-
"options": {
149-
"Validation": "Validation Only",
150-
"Incremental" : "Incremental Mode",
151-
"Complete" : "Complete Mode"
152-
},
153-
"visibleRule": "action = Create Or Update Resource Group"
154-
},
155141
{
156142
"name": "csmFile",
157143
"type": "filePath",
@@ -179,6 +165,20 @@
179165
"helpMarkDown": "Specify the template parameters to override like, <br>–storageName fabrikam –adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) –azureKeyVaultName $(fabrikamFibre).",
180166
"visibleRule": "action = Create Or Update Resource Group"
181167
},
168+
{
169+
"name": "deploymentMode",
170+
"type": "pickList",
171+
"label": "Deployment Mode",
172+
"defaultValue": "Incremental",
173+
"required": true,
174+
"helpMarkDown": "Incremental mode handles deployments as incremental updates to the resource group . It leaves unchanged resources that exist in the resource group but are not specified in the template. \n\n Complete mode deletes resources that are not in your template. \n\n Validate mode enables you to find problems with the template before creating actual resources. \n\n By default, Incremental mode is used.",
175+
"options": {
176+
"Validation": "Validation Only",
177+
"Incremental" : "Incremental",
178+
"Complete" : "Complete"
179+
},
180+
"visibleRule": "action = Create Or Update Resource Group"
181+
},
182182
{
183183
"name": "enableDeploymentPrerequisitesForCreate",
184184
"type": "boolean",

Tasks/DeployAzureResourceGroup/task.loc.json

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"version": {
1414
"Major": 1,
1515
"Minor": 0,
16-
"Patch": 90
16+
"Patch": 91
1717
},
1818
"demands": [
1919
"azureps"
@@ -138,20 +138,6 @@
138138
},
139139
"visibleRule": "action = Create Or Update Resource Group"
140140
},
141-
{
142-
"name": "deploymentMode",
143-
"type": "pickList",
144-
"label": "ms-resource:loc.input.label.deploymentMode",
145-
"defaultValue": "Incremental",
146-
"required": true,
147-
"helpMarkDown": "ms-resource:loc.input.help.deploymentMode",
148-
"options": {
149-
"Validation": "Validation Only",
150-
"Incremental": "Incremental Mode",
151-
"Complete": "Complete Mode"
152-
},
153-
"visibleRule": "action = Create Or Update Resource Group"
154-
},
155141
{
156142
"name": "csmFile",
157143
"type": "filePath",
@@ -179,6 +165,20 @@
179165
"helpMarkDown": "ms-resource:loc.input.help.overrideParameters",
180166
"visibleRule": "action = Create Or Update Resource Group"
181167
},
168+
{
169+
"name": "deploymentMode",
170+
"type": "pickList",
171+
"label": "ms-resource:loc.input.label.deploymentMode",
172+
"defaultValue": "Incremental",
173+
"required": true,
174+
"helpMarkDown": "ms-resource:loc.input.help.deploymentMode",
175+
"options": {
176+
"Validation": "Validation Only",
177+
"Incremental": "Incremental",
178+
"Complete": "Complete"
179+
},
180+
"visibleRule": "action = Create Or Update Resource Group"
181+
},
182182
{
183183
"name": "enableDeploymentPrerequisitesForCreate",
184184
"type": "boolean",

0 commit comments

Comments
 (0)