Skip to content

Commit

Permalink
Added check for 'Complete' deployment mode (#11431)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinodkumar3 authored Sep 30, 2019
1 parent 80746db commit 83e7451
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,6 @@
"loc.messages.LogDeploymentName": "Deployment name is %s",
"loc.messages.ResourceGroupNameNotProvided": "Resource Group name should be provided",
"loc.messages.LocationNotProvided": "Location is required for deployment",
"loc.messages.ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s"
"loc.messages.ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s",
"loc.messages.CompleteDeploymentModeNotSupported": "Deployment mode 'Complete' is not supported for deployment at '%s' scope"
}
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,11 @@ export class TaskParameters {
throw new Error(tl.loc("LocationNotProvided"));
}

//Deployment mode
this.deploymentMode = tl.getInput("deploymentMode");
if(!!this.deploymentMode && this.deploymentMode === "Complete" && this.deploymentScope != "Resource Group"){
throw new Error(tl.loc("CompleteDeploymentModeNotSupported", this.deploymentScope));
}

this.templateLocation = tl.getInput("templateLocation");
if (this.templateLocation === "Linked artifact") {
Expand All @@ -98,7 +103,6 @@ export class TaskParameters {
this.overrideParameters = tl.getInput("overrideParameters");
this.outputVariable = tl.getInput("outputVariable");
this.deploymentName = tl.getInput("deploymentName");
this.deploymentMode = tl.getInput("deploymentMode");
this.credentials = await this.getARMCredentials(this.connectedService);
this.deploymentOutputs = tl.getInput("deploymentOutputs");
this.addSpnToEnvironment = tl.getBoolInput("addSpnToEnvironment", false);
Expand Down
5 changes: 3 additions & 2 deletions Tasks/AzureResourceManagerTemplateDeploymentV3/task.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 3,
"Minor": 0,
"Patch": 0
"Patch": 1
},
"preview": "true",
"demands": [],
Expand Down Expand Up @@ -294,6 +294,7 @@
"LogDeploymentName": "Deployment name is %s",
"ResourceGroupNameNotProvided": "Resource Group name should be provided",
"LocationNotProvided": "Location is required for deployment",
"ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s"
"ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s",
"CompleteDeploymentModeNotSupported": "Deployment mode 'Complete' is not supported for deployment at '%s' scope"
}
}
5 changes: 3 additions & 2 deletions Tasks/AzureResourceManagerTemplateDeploymentV3/task.loc.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"version": {
"Major": 3,
"Minor": 0,
"Patch": 0
"Patch": 1
},
"preview": "true",
"demands": [],
Expand Down Expand Up @@ -294,6 +294,7 @@
"LogDeploymentName": "ms-resource:loc.messages.LogDeploymentName",
"ResourceGroupNameNotProvided": "ms-resource:loc.messages.ResourceGroupNameNotProvided",
"LocationNotProvided": "ms-resource:loc.messages.LocationNotProvided",
"ARMServiceConnectionScope": "ms-resource:loc.messages.ARMServiceConnectionScope"
"ARMServiceConnectionScope": "ms-resource:loc.messages.ARMServiceConnectionScope",
"CompleteDeploymentModeNotSupported": "ms-resource:loc.messages.CompleteDeploymentModeNotSupported"
}
}

0 comments on commit 83e7451

Please sign in to comment.