Skip to content

Commit a9fb800

Browse files
tianxchen-msTianxiang Chen
authored andcommitted
update schema and add roleassign doc (Azure#21469)
* update schema and add roleassign doc * fix comment Co-authored-by: Tianxiang Chen <[email protected]>
1 parent 6b73033 commit a9fb800

File tree

2 files changed

+55
-10
lines changed

2 files changed

+55
-10
lines changed

documentation/api-scenario/references/ApiScenarioDefinition.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ scenarios:
7272
7373
## Scenario
7474
75-
See [Scenario Schema](./v1.2/schema.json#L249).
75+
See [Scenario Schema](./v1.2/schema.json#L353).
7676
7777
It defines one API scenario that could go through on its own.
7878
@@ -109,7 +109,7 @@ variables:
109109
110110
## Step
111111
112-
See [Step Schema](./v1.2/schema.json#L280).
112+
See [Step Schema](./v1.2/schema.json#L383).
113113
114114
Defines one step in API scenario.
115115
@@ -120,6 +120,7 @@ Should be one of the following:
120120
- [REST Example](#rest-example)
121121
- [Step ARM Template](#step-arm-template)
122122
- [Step ARM Deployment Script](#step-arm-deployment-script)
123+
- [Step Role Assignment](#step-role-assignment)
123124
124125
All of the above definitions share the following fields:
125126
@@ -146,7 +147,7 @@ REST call step could be defined either by an operation, or by an example file. R
146147
147148
#### Operation based step
148149
149-
See [Step Operation Schema](./v1.2/schema.json#L339)
150+
See [Step Operation Schema](./v1.2/schema.json#L450)
150151
151152
**Example:**
152153
```yaml
@@ -183,7 +184,7 @@ See [Step Operation Schema](./v1.2/schema.json#L339)
183184
184185
#### ExampleFile based step
185186
186-
See [Step Example Schema](./v1.2/schema.json#L389)
187+
See [Step Example Schema](./v1.2/schema.json#L520)
187188
188189
**Example:**
189190
@@ -238,7 +239,7 @@ if (scope is 'ResourceGroup' && operation.verb in ('PUT', 'PATCH')) {
238239

239240
### Step ARM Template
240241

241-
See [Step ARM Template Schema](./v1.2/schema.json#L427).
242+
See [Step ARM Template Schema](./v1.2/schema.json#L566).
242243

243244
Step to deploy ARM template to the scope. Template parameters and outputs will also interact with variables automatically, see [Variables](./Variables.md).
244245

@@ -257,7 +258,7 @@ Step to deploy ARM template to the scope. Template parameters and outputs will a
257258

258259
### Step ARM Deployment Script
259260

260-
See [Step ARM Deployment Script Schema](./v1.2/schema.json#L448).
261+
See [Step ARM Deployment Script Schema](./v1.2/schema.json#L587).
261262

262263
Step to deploy ARM deployment script to the scope. Template parameters and outputs will also interact with variables automatically, see [Variables](./Variables.md).
263264

@@ -289,6 +290,42 @@ Step to deploy ARM deployment script to the scope. Template parameters and outpu
289290
- **Type:** Optional, Array of [EnvironmentVariable](#EnvironmentVariable)
290291
- Specify the environment variables to pass over to the script.
291292

293+
### Step Role Assignment
294+
295+
See [Step Role Assignment Schema](./v1.2/schema.json#L629).
296+
297+
Step to assign an Azure role to the scope.
298+
299+
**Example:**
300+
301+
```yaml
302+
- step: AssignDataOwnerRole
303+
roleAssignment:
304+
scope: $(configStoreId)
305+
principalId: a0b840b5-a7b4-4bb4-b125-ae0acf68cf16
306+
roleName: App Configuration Data Owner
307+
```
308+
309+
**Fields:**
310+
311+
- **scope**
312+
- **Type:** Required, String
313+
- The scope of the operation or resource. Valid scopes are: subscription (format: '/subscriptions/{subscriptionId}'), resource group (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}', or resource (format: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/[{parentResourcePath}/]{resourceType}/{resourceName}'.
314+
- **principalId**
315+
- **Type:** Required, String, GUID
316+
- The principal ID.
317+
- **principalType**
318+
- **Type:** Optional, Enum
319+
- **Enum:** User, Group, ServicePrincipal, ForeignGroup, Device
320+
- **Default:** ServicePrincipal
321+
- **OneOf**:
322+
- **roleName**
323+
- **Type:** Required, String
324+
- The built-in role name. [Azure built-in roles](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles)
325+
- **roleDefinitionId**
326+
- **Type:** Required, String, GUID
327+
- The role definition ID. For example: 5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b
328+
292329
#### EnvironmentVariable
293330

294331
**Example:**
@@ -313,7 +350,7 @@ Step to deploy ARM deployment script to the scope. Template parameters and outpu
313350

314351
### JsonPatchOp
315352

316-
See [Json Patch Operation Schema](./v1.2/schema.json#L490)
353+
See [Json Patch Operation Schema](./v1.2/schema.json#L674)
317354

318355
JsonPatchOp is used to define the update operation on json. You could add, remove, replace, copy, and move on json path.
319356
All the json path used in JsonPatchOp is in format of [JsonPointer](https://datatracker.ietf.org/doc/html/rfc6901).
@@ -514,7 +551,7 @@ result:
514551
515552
### JsonTestOp
516553
517-
See [Json Test Operation schema](./v1.2/schema.json#L619)
554+
See [Json Test Operation schema](./v1.2/schema.json#L767)
518555
519556
JsonTestOp is used to define the test operation on json. You could test if the json path is expected.
520557
The json path used in JsonPatchOp is in format of [JsonPointer](https://datatracker.ietf.org/doc/html/rfc6901).

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,17 @@
106106
"key": {
107107
"type": "string"
108108
},
109-
"headerName": {
109+
"name": {
110110
"type": "string",
111111
"default": "Authorization"
112+
},
113+
"in": {
114+
"type": "string",
115+
"enum": [
116+
"header",
117+
"query"
118+
],
119+
"default": "header"
112120
}
113121
},
114122
"required": [
@@ -463,7 +471,7 @@
463471
"minProperties": 1,
464472
"additionalProperties": false,
465473
"patternProperties": {
466-
"^([0-9]{3})$": {
474+
"^([2-5][0-9]{2})|([245]xx)$": {
467475
"oneOf": [
468476
{
469477
"type": "object",

0 commit comments

Comments
 (0)