Skip to content

Commit 3ad7a85

Browse files
tianxchen-msTianxiang Chen
andauthored
add deployment script and rename armTemplateDeployment to armTemplate (#16894)
* add deployment script and rename armTemplateDeployment to armTemplate * fix comments Co-authored-by: Tianxiang Chen <[email protected]>
1 parent d2411fc commit 3ad7a85

File tree

3 files changed

+109
-18
lines changed

3 files changed

+109
-18
lines changed

documentation/api-scenario/how-to/apiScenarioWithARMTemplate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ scenarios:
8585
description: Microsoft.SignalRService/signalR CRUD
8686
steps:
8787
- step: Generate_Unique_string
88-
armTemplateDeployment: ./generate_unique_string.json
88+
armTemplate: ./generate_unique_string.json
8989
- step: SignalR_checknameAvailability
9090
exampleFile: ../examples/SignalR_CheckNameAvailability.json
9191
- step: SignalR_CreateOrUpdate

documentation/api-scenario/references/ApiScenarioDefinition.md

Lines changed: 69 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variables:
1414
publicIpAddressName: pubipdns
1515
prepareSteps:
1616
- step: prepare_resources
17-
armTemplateDeployment: ./dep-something.json
17+
armTemplate: ./dep-something.json
1818
scenarios:
1919
- description: test_network_public_ip
2020
steps:
@@ -98,7 +98,8 @@ Should be one of the following:
9898
- [Step REST Call](#step-rest-call)
9999
- [REST Call](#rest-call)
100100
- [REST Call by ResourceName Tracking and Update](#rest-call-by-resourcename-tracking-and-update)
101-
- [Step ARM Template Deployment](#step-arm-template-deployment)
101+
- [Step ARM Template](#step-arm-template)
102+
- [Step ARM Deployment Script](#step-arm-deployment-script)
102103
103104
All of the above definitions share the following fields:
104105
@@ -109,28 +110,83 @@ All of the above definitions share the following fields:
109110
- **Type:** Required, String
110111
- Step name. Must be unique in the same file.
111112
112-
## Step ARM Template Deployment
113+
## Step ARM Template
113114
114-
See [Step ARM Template Deployment Schema](./v1.1/schema.json#L247).
115+
See [Step ARM Template Schema](./v1.1/schema.json#L250).
115116
116117
Step to deploy ARM template to the scope. Template parameters and outputs will also interact with variables automatically, see [Variables](./Variables.md).
117118
118119
**Example:**
119120
120121
```yaml
121-
step: prepare_resources
122-
armTemplateDeployment: ./dep-storage-account.json
122+
- step: prepare_resources
123+
armTemplate: ./dep-storage-account.json
123124
```
124125
125126
**Fields:**
126127
127-
- **armTemplateDeployment**
128+
- **armTemplate**
128129
- **Type:** Required, String
129130
- Path to ARM template json file. See [ARM Template](https://docs.microsoft.com/azure/templates/).
130131
132+
133+
## Step ARM Deployment Script
134+
135+
See [Step ARM Deployment Script Schema](./v1.1/schema.json#L266).
136+
137+
Step to deploy ARM deployment script to the scope. Template parameters and outputs will also interact with variables automatically, see [Variables](./Variables.md).
138+
139+
**Example:**
140+
141+
```yaml
142+
- step: Add_Dns_Cname_Record
143+
armDeploymentScript: ./templates/create_cname_record.ps1
144+
environmentVariables:
145+
- name: resourceGroupName
146+
value: $(dnsResourceGroup)
147+
- name: dnsZoneName
148+
value: $(customDomainName)
149+
- name: dnsCname
150+
value: $(dnsCname)
151+
- name: dnsCnameAlias
152+
value: $(serviceName).somedomain.com
153+
```
154+
155+
**Fields:**
156+
157+
- **armDeploymentScript**
158+
- **Type:** Required, String
159+
- Path to script file. See [ARM Deployment Script Template](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-script-template).
160+
- **arguments**
161+
- **Type:** Optional, String
162+
- Arguments for the script. Same as arguments in ARM Template. See [ARM Deployment Script Template](https://docs.microsoft.com/en-us/azure/azure-resource-manager/templates/deployment-script-template).
163+
- **environmentVariables**
164+
- **Type:** Optional, Array of [EnvironmentVariable](#EnvironmentVariable)
165+
- Specify the environment variables to pass over to the script.
166+
167+
### EnvironmentVariable
168+
169+
**Example:**
170+
171+
```yaml
172+
- name: dnsCname
173+
value: asc
174+
- name: dnsCnameAlias
175+
value: $(serviceName).somedomain.com
176+
```
177+
178+
**Fields:**
179+
180+
- **name**
181+
- **Type:** Required, String
182+
- Name of Variable.
183+
- **value**
184+
- **Type:** Required, String
185+
- See [Variables](./Variables.md).
186+
131187
## Step REST Call
132188
133-
See [Step REST Call Schema](./v1.1/schema.json#L205)
189+
See [Step REST Call Schema](./v1.1/schema.json#L208)
134190
135191
Step to run a swagger operation defined rest call. This may not be just one http call.
136192
@@ -150,11 +206,11 @@ Rest call will have computed **requestParameter** and **responseExpected** after
150206
**Example:**
151207
152208
```yaml
153-
step: Create_publicIPAddresses_pubipdns
154-
resourceName: publicIPAddresses_pubipdns
155-
exampleFile: ../examples/Create_publicIPAddresses_pubipdns_Generated.json
156-
operationId: PublicIPAddresses_CreateOrUpdate
157-
statusCode: 200
209+
- step: Create_publicIPAddresses_pubipdns
210+
resourceName: publicIPAddresses_pubipdns
211+
exampleFile: ../examples/Create_publicIPAddresses_pubipdns_Generated.json
212+
operationId: PublicIPAddresses_CreateOrUpdate
213+
statusCode: 200
158214
```
159215
160216
**Fields:**

documentation/api-scenario/references/v1.1/schema.json

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@
120120
"$ref": "#/definitions/StepRestOperation"
121121
},
122122
{
123-
"$ref": "#/definitions/StepArmTemplateDeployment"
123+
"$ref": "#/definitions/StepArmTemplate"
124+
},
125+
{
126+
"$ref": "#/definitions/StepArmDeploymentScript"
124127
},
125128
{
126129
"$ref": "#/definitions/StepRawCall"
@@ -244,22 +247,54 @@
244247
"resourceName"
245248
]
246249
},
247-
"StepArmTemplateDeployment": {
250+
"StepArmTemplate": {
248251
"type": "object",
249252
"allOf": [
250253
{
251254
"$ref": "#/definitions/StepBase"
252255
}
253256
],
254257
"properties": {
255-
"armTemplateDeployment": {
258+
"armTemplate": {
256259
"type": "string"
257260
}
258261
},
259262
"required": [
260-
"armTemplateDeployment"
263+
"armTemplate"
261264
]
262265
},
266+
"StepArmDeploymentScript": {
267+
"type": "object",
268+
"allOf": [
269+
{
270+
"$ref": "#/definitions/StepBase"
271+
}
272+
],
273+
"properties": {
274+
"armDeploymentScript": {
275+
"type": "string"
276+
},
277+
"arguments": {
278+
"type": "string"
279+
},
280+
"environmentVariables": {
281+
"type": "array",
282+
"items": {
283+
"type": "object",
284+
"properties": {
285+
"name": {
286+
"type": "string"
287+
},
288+
"value": {
289+
"type": "string"
290+
}
291+
},
292+
"required": ["name", "value"]
293+
}
294+
}
295+
},
296+
"required": ["armDeploymentScript"]
297+
},
263298
"StepRawCall": {
264299
"type": "object",
265300
"allOf": [

0 commit comments

Comments
 (0)