Skip to content

Commit

Permalink
Adding functionality for AzureResourceGroupDeploymentV2
Browse files Browse the repository at this point in the history
  • Loading branch information
issacnitinmsft committed Dec 3, 2019
1 parent 556c9e7 commit 2400c26
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,5 +191,6 @@
"loc.messages.LogDeploymentName": "Deployment name is %s",
"loc.messages.ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.",
"loc.messages.DeploymentGroupConfigurationNotSucceeded": "Deployment group configuration did not succeed on one or more Virtual Machine(s): %s",
"loc.messages.DeploymentGroupConfigurationFailedOnVM": "Failure for Virtual Machine '%s': %s"
"loc.messages.DeploymentGroupConfigurationFailedOnVM": "Failure for Virtual Machine '%s': %s",
"loc.messages.FindMoreDeploymentDetailsAzurePortal": "Find more details about your deployment at: %s"
}
10 changes: 10 additions & 0 deletions Tasks/AzureResourceGroupDeploymentV2/operations/ResourceGroup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ export class ResourceGroup {
}
if (result.error) {
this.writeDeploymentErrors(result.error);
tl.error(tl.loc("FindMoreDeploymentDetailsAzurePortal", this.getAzurePortalDeploymentURL()));
return reject(tl.loc("CreateTemplateDeploymentFailed"));
} else {
console.log(tl.loc("ValidDeployment"));
Expand All @@ -537,6 +538,7 @@ export class ResourceGroup {
return this.waitAndPerformAzureDeployment(armClient, deployment, retryCount);
}
this.writeDeploymentErrors(error);
tl.error(tl.loc("FindMoreDeploymentDetailsAzurePortal", this.getAzurePortalDeploymentURL()));
return reject(tl.loc("CreateTemplateDeploymentFailed"));
}
if (result && result["properties"] && result["properties"]["outputs"] && utils.isNonEmpty(this.taskParameters.deploymentOutputs)) {
Expand Down Expand Up @@ -569,6 +571,14 @@ export class ResourceGroup {
await this.performAzureDeployment(armClient, deployment, 3);
}

private getAzurePortalDeploymentURL() {
let portalUrl = this.taskParameters.endpointPortalUrl ? this.taskParameters.endpointPortalUrl : "https://portal.azure.com";
portalUrl += "/#blade/HubsExtension/DeploymentDetailsBlade/overview/id/";

let subscriptionSpecificURL = "/subscriptions/" + this.taskParameters.subscriptionId + "/resourceGroups/" + this.taskParameters.resourceGroupName + "/providers/Microsoft.Resources/deployments/" + this.taskParameters.deploymentName;
return portalUrl + subscriptionSpecificURL.replace(/\//g, '%2F');
}

private enablePrereqDG = "ConfigureVMWithDGAgent";
private enablePrereqWinRM = "ConfigureVMwithWinRM";
private enablePrereqNone = "None";
Expand Down
5 changes: 3 additions & 2 deletions Tasks/AzureResourceGroupDeploymentV2/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 2,
"Minor": 157,
"Patch": 7
"Patch": 8
},
"demands": [],
"minimumAgentVersion": "2.119.1",
Expand Down Expand Up @@ -480,6 +480,7 @@
"LogDeploymentName": "Deployment name is %s",
"ExpiredServicePrincipal": "Could not fetch access token for Azure. Verify if the Service Principal used is valid and not expired.",
"DeploymentGroupConfigurationNotSucceeded": "Deployment group configuration did not succeed on one or more Virtual Machine(s): %s",
"DeploymentGroupConfigurationFailedOnVM": "Failure for Virtual Machine '%s': %s"
"DeploymentGroupConfigurationFailedOnVM": "Failure for Virtual Machine '%s': %s",
"FindMoreDeploymentDetailsAzurePortal": "Find more details about your deployment at: %s"
}
}
5 changes: 3 additions & 2 deletions Tasks/AzureResourceGroupDeploymentV2/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 2,
"Minor": 157,
"Patch": 7
"Patch": 8
},
"demands": [],
"minimumAgentVersion": "2.119.1",
Expand Down Expand Up @@ -480,6 +480,7 @@
"LogDeploymentName": "ms-resource:loc.messages.LogDeploymentName",
"ExpiredServicePrincipal": "ms-resource:loc.messages.ExpiredServicePrincipal",
"DeploymentGroupConfigurationNotSucceeded": "ms-resource:loc.messages.DeploymentGroupConfigurationNotSucceeded",
"DeploymentGroupConfigurationFailedOnVM": "ms-resource:loc.messages.DeploymentGroupConfigurationFailedOnVM"
"DeploymentGroupConfigurationFailedOnVM": "ms-resource:loc.messages.DeploymentGroupConfigurationFailedOnVM",
"FindMoreDeploymentDetailsAzurePortal": "ms-resource:loc.messages.FindMoreDeploymentDetailsAzurePortal"
}
}

0 comments on commit 2400c26

Please sign in to comment.