From 8aab0437c44a6f241cf1d5d875b13c029fffbbf1 Mon Sep 17 00:00:00 2001 From: hiyadav Date: Wed, 28 Sep 2016 10:57:24 +0530 Subject: [PATCH 1/6] deployment mode help text and placement above checkbox, "mode" removed from text shown --- .../resources.resjson/en-US/resources.resjson | 4 +-- Tasks/DeployAzureResourceGroup/task.json | 30 +++++++++---------- Tasks/DeployAzureResourceGroup/task.loc.json | 30 +++++++++---------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson b/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson index 692c8577a837..dd3bd4a80f36 100644 --- a/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson @@ -19,13 +19,13 @@ "loc.input.help.cloudService": "Provide the name of the cloud service.", "loc.input.label.location": "Location", "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.", - "loc.input.label.deploymentMode": "Deployment Mode", - "loc.input.help.deploymentMode": "Specify the deployment mode for Azure Resource Manager template.", "loc.input.label.csmFile": "Template", "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.", "loc.input.label.csmParametersFile": "Template Parameters", "loc.input.help.csmParametersFile": "Specify the path for the parameters file for the Azure Resource Manager Template.", "loc.input.label.overrideParameters": "Override Template Parameters", + "loc.input.label.deploymentMode": "Deployment Mode", + "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. Complete mode deletes resources that are not in your template. \n\n By default, incremental mode is used. \n\n Validate mode enables you to find problems with the template before creating actual resources.", "loc.input.help.overrideParameters": "Specify the template parameters to override like,
–storageName fabrikam –adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) –azureKeyVaultName $(fabrikamFibre).", "loc.input.label.enableDeploymentPrerequisitesForCreate": "Enable Deployment Prerequisites", "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).", diff --git a/Tasks/DeployAzureResourceGroup/task.json b/Tasks/DeployAzureResourceGroup/task.json index 7b37d48042a9..8a87b3028b61 100644 --- a/Tasks/DeployAzureResourceGroup/task.json +++ b/Tasks/DeployAzureResourceGroup/task.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 90 + "Patch": 91 }, "demands": [ "azureps" @@ -138,20 +138,6 @@ }, "visibleRule": "action = Create Or Update Resource Group" }, - { - "name": "deploymentMode", - "type": "pickList", - "label": "Deployment Mode", - "defaultValue": "Incremental", - "required": true, - "helpMarkDown": "Specify the deployment mode for Azure Resource Manager template.", - "options": { - "Validation": "Validation Only", - "Incremental" : "Incremental Mode", - "Complete" : "Complete Mode" - }, - "visibleRule": "action = Create Or Update Resource Group" - }, { "name": "csmFile", "type": "filePath", @@ -179,6 +165,20 @@ "helpMarkDown": "Specify the template parameters to override like,
–storageName fabrikam –adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) –azureKeyVaultName $(fabrikamFibre).", "visibleRule": "action = Create Or Update Resource Group" }, + { + "name": "deploymentMode", + "type": "pickList", + "label": "Deployment Mode", + "defaultValue": "Incremental", + "required": true, + "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. Complete mode deletes resources that are not in your template. \n\n By default, incremental mode is used. \n\n Validate mode enables you to find problems with the template before creating actual resources.", + "options": { + "Validation": "Validation Only", + "Incremental" : "Incremental", + "Complete" : "Complete" + }, + "visibleRule": "action = Create Or Update Resource Group" + }, { "name": "enableDeploymentPrerequisitesForCreate", "type": "boolean", diff --git a/Tasks/DeployAzureResourceGroup/task.loc.json b/Tasks/DeployAzureResourceGroup/task.loc.json index 17b9ff8d325f..676f9e2686ad 100644 --- a/Tasks/DeployAzureResourceGroup/task.loc.json +++ b/Tasks/DeployAzureResourceGroup/task.loc.json @@ -13,7 +13,7 @@ "version": { "Major": 1, "Minor": 0, - "Patch": 90 + "Patch": 91 }, "demands": [ "azureps" @@ -138,20 +138,6 @@ }, "visibleRule": "action = Create Or Update Resource Group" }, - { - "name": "deploymentMode", - "type": "pickList", - "label": "ms-resource:loc.input.label.deploymentMode", - "defaultValue": "Incremental", - "required": true, - "helpMarkDown": "ms-resource:loc.input.help.deploymentMode", - "options": { - "Validation": "Validation Only", - "Incremental": "Incremental Mode", - "Complete": "Complete Mode" - }, - "visibleRule": "action = Create Or Update Resource Group" - }, { "name": "csmFile", "type": "filePath", @@ -179,6 +165,20 @@ "helpMarkDown": "ms-resource:loc.input.help.overrideParameters", "visibleRule": "action = Create Or Update Resource Group" }, + { + "name": "deploymentMode", + "type": "pickList", + "label": "ms-resource:loc.input.label.deploymentMode", + "defaultValue": "Incremental", + "required": true, + "helpMarkDown": "ms-resource:loc.input.help.deploymentMode", + "options": { + "Validation": "Validation Only", + "Incremental": "Incremental", + "Complete": "Complete" + }, + "visibleRule": "action = Create Or Update Resource Group" + }, { "name": "enableDeploymentPrerequisitesForCreate", "type": "boolean", From af317cda938f8ee8d6a3d3a5a642855ba12cf3eb Mon Sep 17 00:00:00 2001 From: hiyadav Date: Wed, 28 Sep 2016 11:20:12 +0530 Subject: [PATCH 2/6] change in helpText --- .../Strings/resources.resjson/en-US/resources.resjson | 2 +- Tasks/DeployAzureResourceGroup/task.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson b/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson index dd3bd4a80f36..f9401d87a83c 100644 --- a/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson +++ b/Tasks/DeployAzureResourceGroup/Strings/resources.resjson/en-US/resources.resjson @@ -25,7 +25,7 @@ "loc.input.help.csmParametersFile": "Specify the path for the parameters file for the Azure Resource Manager Template.", "loc.input.label.overrideParameters": "Override Template Parameters", "loc.input.label.deploymentMode": "Deployment Mode", - "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. Complete mode deletes resources that are not in your template. \n\n By default, incremental mode is used. \n\n Validate mode enables you to find problems with the template before creating actual resources.", + "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.", "loc.input.help.overrideParameters": "Specify the template parameters to override like,
–storageName fabrikam –adminUsername $(vmusername) -adminPassword (ConvertTo-SecureString -String '$(password)' -AsPlainText -Force) –azureKeyVaultName $(fabrikamFibre).", "loc.input.label.enableDeploymentPrerequisitesForCreate": "Enable Deployment Prerequisites", "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).", diff --git a/Tasks/DeployAzureResourceGroup/task.json b/Tasks/DeployAzureResourceGroup/task.json index 8a87b3028b61..b93843a6e26c 100644 --- a/Tasks/DeployAzureResourceGroup/task.json +++ b/Tasks/DeployAzureResourceGroup/task.json @@ -171,7 +171,7 @@ "label": "Deployment Mode", "defaultValue": "Incremental", "required": true, - "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. Complete mode deletes resources that are not in your template. \n\n By default, incremental mode is used. \n\n Validate mode enables you to find problems with the template before creating actual resources.", + "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.", "options": { "Validation": "Validation Only", "Incremental" : "Incremental", From f403c0e7f6ef5ee7902406f3c20ad6e0adfd7637 Mon Sep 17 00:00:00 2001 From: hiyadav Date: Wed, 28 Sep 2016 15:29:18 +0530 Subject: [PATCH 3/6] putting command arguments in double quotes --- Tasks/AzureCLI/azureclitask.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Tasks/AzureCLI/azureclitask.ts b/Tasks/AzureCLI/azureclitask.ts index 89eb79dbe690..a2be08f33d5b 100644 --- a/Tasks/AzureCLI/azureclitask.ts +++ b/Tasks/AzureCLI/azureclitask.ts @@ -120,10 +120,10 @@ export class azureclitask { //set the azure mode to arm to use azureRM commands this.throwIfError(tl.execSync("azure", "config mode arm")); //login using svn - this.throwIfError(tl.execSync("azure", "login -u " + servicePrincipalId + " -p " + servicePrincipalKey + " --tenant " + tenantId + " --service-principal")); + this.throwIfError(tl.execSync("azure", "login -u \"" + servicePrincipalId + "\" -p \"" + servicePrincipalKey + "\" --tenant \"" + tenantId + "\" --service-principal")); this.isLoggedIn = true; //set the subscription imported to the current subscription - this.throwIfError(tl.execSync("azure", "account set " + subscriptionName)); + this.throwIfError(tl.execSync("azure", "account set \"" + subscriptionName + "\"")); } private static loginAzureClassic(connectedService):void { @@ -136,20 +136,20 @@ export class azureclitask { var subscriptionId:string = tl.getEndpointDataParameter(connectedService, "SubscriptionId", true); const publishSettingFileName:string = path.join(os.tmpdir() ,"subscriptions" + new Date().getTime() + ".publishsettings"); this.createPublishSettingFile(subscriptionName, subscriptionId, bytes, publishSettingFileName); - var resultOfToolExecution = tl.execSync("azure", "account import " + publishSettingFileName); + var resultOfToolExecution = tl.execSync("azure", "account import \"" + publishSettingFileName + "\""); this.deleteFile(publishSettingFileName); this.throwIfError(resultOfToolExecution); this.isLoggedIn = true; //set the subscription imported to the current subscription - this.throwIfError( tl.execSync("azure", "account set " + subscriptionName)); + this.throwIfError( tl.execSync("azure", "account set \"" + subscriptionName + "\"")); } else if (endpointAuth.scheme === "UsernamePassword") { var username:string = endpointAuth.parameters["username"]; var passwd:string = endpointAuth.parameters["password"]; - this.throwIfError(tl.execSync("azure", "login -u " + username + " -p " + passwd)); + this.throwIfError(tl.execSync("azure", "login -u \"" + username + "\" -p \"" + passwd + "\"")); this.isLoggedIn = true; //set the subscription imported to the current subscription - this.throwIfError(tl.execSync("azure", "account set " + subscriptionName)); + this.throwIfError(tl.execSync("azure", "account set \"" + subscriptionName + "\"")); } else { var err; @@ -179,7 +179,7 @@ export class azureclitask { private static logoutAzureRM(connectedService:string) { var subscriptionName:string = tl.getEndpointDataParameter(connectedService, "SubscriptionName", true); - tl.execSync("azure", " account clear -s " + subscriptionName); + tl.execSync("azure", " account clear -s \"" + subscriptionName + "\""); } private static logoutAzureClassic(connectedService:string) @@ -188,11 +188,11 @@ export class azureclitask { if(endpointAuth["scheme"] === "usernamePassword") { var username:string = endpointAuth.parameters["username"]; - tl.execSync("azure", "logout -u " + username); + tl.execSync("azure", "logout -u \"" + username + "\""); } else { var subscriptionName:string = tl.getEndpointDataParameter(connectedService, "SubscriptionName", true); - tl.execSync("azure", " account clear -s " + subscriptionName); + tl.execSync("azure", " account clear -s \"" + subscriptionName + "\""); } } From cac762029d177ce1342f322e504a1d42ab051133 Mon Sep 17 00:00:00 2001 From: hiyadav Date: Wed, 28 Sep 2016 17:18:35 +0530 Subject: [PATCH 4/6] patch increase in AzureCLI --- Tasks/AzureCLI/task.json | 2 +- Tasks/AzureCLI/task.loc.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tasks/AzureCLI/task.json b/Tasks/AzureCLI/task.json index ad9012696184..05c6928fee86 100644 --- a/Tasks/AzureCLI/task.json +++ b/Tasks/AzureCLI/task.json @@ -14,7 +14,7 @@ "version": { "Major": "0", "Minor": "2", - "Patch": "1" + "Patch": "2" }, "minimumAgentVersion": "1.95.0", "instanceNameFormat": "Azure CLI $(scriptPath)", diff --git a/Tasks/AzureCLI/task.loc.json b/Tasks/AzureCLI/task.loc.json index df896595c3a9..3e59bcea0dce 100644 --- a/Tasks/AzureCLI/task.loc.json +++ b/Tasks/AzureCLI/task.loc.json @@ -17,7 +17,7 @@ "version": { "Major": "0", "Minor": "2", - "Patch": "1" + "Patch": "2" }, "minimumAgentVersion": "1.95.0", "instanceNameFormat": "ms-resource:loc.instanceNameFormat", From b4ca1f3d05c5d831cb6fdd6decfba7212fe4b65f Mon Sep 17 00:00:00 2001 From: hiyadav Date: Wed, 28 Sep 2016 18:03:53 +0530 Subject: [PATCH 5/6] utilitygte1.0 command update for validation --- Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1 b/Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1 index f889a6615a5b..0af01bf9c6aa 100644 --- a/Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1 +++ b/Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1 @@ -45,7 +45,7 @@ function Validation-Deploy-AzureResourceGroup } else { - $azureResourceGroupValidationError = Test-AzureRmResourceGroupDeployment -ResourceGroupName $azureResourceName -TemplateFile $csmFile -TemplateParameterFile $csmParametersFile $overrideParameters -Verbose -ErrorAction silentlyContinue + $azureResourceGroupValidationError = Test-AzureRmResourceGroupDeployment -ResourceGroupName $resourceGroupName -TemplateFile $csmFile -TemplateParameterFile $csmParametersFile $overrideParameters -Verbose -ErrorAction silentlyContinue } $azureResourceGroupValidationError From 2394631275b3a8a933df915b67535f320f4487bd Mon Sep 17 00:00:00 2001 From: hiyadav Date: Wed, 28 Sep 2016 18:23:58 +0530 Subject: [PATCH 6/6] update the version in package.json --- Tasks/AzureCLI/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tasks/AzureCLI/package.json b/Tasks/AzureCLI/package.json index 535d3fcab104..a21a770ead20 100644 --- a/Tasks/AzureCLI/package.json +++ b/Tasks/AzureCLI/package.json @@ -1,6 +1,6 @@ { "name": "vsts-tasks-azurecli", - "version": "0.2.1", + "version": "0.2.2", "description": "VSTS Azure CLI Task", "main": "azureclitask.js", "scripts": {