Skip to content

Commit b7eae5a

Browse files
authored
Added check for 'Complete' deployment mode (#11432)
1 parent af31033 commit b7eae5a

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,5 +81,6 @@
8181
"loc.messages.LogDeploymentName": "Deployment name is %s",
8282
"loc.messages.ResourceGroupNameNotProvided": "Resource Group name should be provided",
8383
"loc.messages.LocationNotProvided": "Location is required for deployment",
84-
"loc.messages.ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s"
84+
"loc.messages.ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s",
85+
"loc.messages.CompleteDeploymentModeNotSupported": "Deployment mode 'Complete' is not supported for deployment at '%s' scope"
8586
}

Tasks/AzureResourceManagerTemplateDeploymentV3/models/TaskParameters.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ export class TaskParameters {
8686
throw new Error(tl.loc("LocationNotProvided"));
8787
}
8888

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

9095
this.templateLocation = tl.getInput("templateLocation");
9196
if (this.templateLocation === "Linked artifact") {
@@ -98,7 +103,6 @@ export class TaskParameters {
98103
this.overrideParameters = tl.getInput("overrideParameters");
99104
this.outputVariable = tl.getInput("outputVariable");
100105
this.deploymentName = tl.getInput("deploymentName");
101-
this.deploymentMode = tl.getInput("deploymentMode");
102106
this.credentials = await this.getARMCredentials(this.connectedService);
103107
this.deploymentOutputs = tl.getInput("deploymentOutputs");
104108
this.addSpnToEnvironment = tl.getBoolInput("addSpnToEnvironment", false);

Tasks/AzureResourceManagerTemplateDeploymentV3/task.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 3,
1717
"Minor": 0,
18-
"Patch": 0
18+
"Patch": 1
1919
},
2020
"preview": "true",
2121
"demands": [],
@@ -294,6 +294,7 @@
294294
"LogDeploymentName": "Deployment name is %s",
295295
"ResourceGroupNameNotProvided": "Resource Group name should be provided",
296296
"LocationNotProvided": "Location is required for deployment",
297-
"ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s"
297+
"ARMServiceConnectionScope": "ARM Service Conection deployment scope - %s",
298+
"CompleteDeploymentModeNotSupported": "Deployment mode 'Complete' is not supported for deployment at '%s' scope"
298299
}
299300
}

Tasks/AzureResourceManagerTemplateDeploymentV3/task.loc.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"version": {
1616
"Major": 3,
1717
"Minor": 0,
18-
"Patch": 0
18+
"Patch": 1
1919
},
2020
"preview": "true",
2121
"demands": [],
@@ -294,6 +294,7 @@
294294
"LogDeploymentName": "ms-resource:loc.messages.LogDeploymentName",
295295
"ResourceGroupNameNotProvided": "ms-resource:loc.messages.ResourceGroupNameNotProvided",
296296
"LocationNotProvided": "ms-resource:loc.messages.LocationNotProvided",
297-
"ARMServiceConnectionScope": "ms-resource:loc.messages.ARMServiceConnectionScope"
297+
"ARMServiceConnectionScope": "ms-resource:loc.messages.ARMServiceConnectionScope",
298+
"CompleteDeploymentModeNotSupported": "ms-resource:loc.messages.CompleteDeploymentModeNotSupported"
298299
}
299300
}

0 commit comments

Comments
 (0)