Skip to content

Commit

Permalink
Merge pull request #2695 from Microsoft/users/hiyada/portCliFix
Browse files Browse the repository at this point in the history
azure cli "" in cmdlets, rg and cli patch increase, help text in azure rg
  • Loading branch information
hiyadav authored Sep 28, 2016
2 parents 08c4cbf + 2394631 commit 3df7fee
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 45 deletions.
18 changes: 9 additions & 9 deletions Tasks/AzureCLI/azureclitask.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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;
Expand Down Expand Up @@ -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)
Expand All @@ -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 + "\"");
}
}

Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureCLI/package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureCLI/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"version": {
"Major": "0",
"Minor": "2",
"Patch": "1"
"Patch": "2"
},
"minimumAgentVersion": "1.95.0",
"instanceNameFormat": "Azure CLI $(scriptPath)",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/AzureCLI/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"version": {
"Major": "0",
"Minor": "2",
"Patch": "1"
"Patch": "2"
},
"minimumAgentVersion": "1.95.0",
"instanceNameFormat": "ms-resource:loc.instanceNameFormat",
Expand Down
2 changes: 1 addition & 1 deletion Tasks/DeployAzureResourceGroup/AzureUtilityGTE1.0.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. \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, <br>–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).",
Expand Down
30 changes: 15 additions & 15 deletions Tasks/DeployAzureResourceGroup/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 90
"Patch": 91
},
"demands": [
"azureps"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -179,6 +165,20 @@
"helpMarkDown": "Specify the template parameters to override like, <br>–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. \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",
"Complete" : "Complete"
},
"visibleRule": "action = Create Or Update Resource Group"
},
{
"name": "enableDeploymentPrerequisitesForCreate",
"type": "boolean",
Expand Down
30 changes: 15 additions & 15 deletions Tasks/DeployAzureResourceGroup/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"version": {
"Major": 1,
"Minor": 0,
"Patch": 90
"Patch": 91
},
"demands": [
"azureps"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 3df7fee

Please sign in to comment.