Skip to content

Commit

Permalink
[Blueprints] Add a new example file for using user-assigned MSI (#6297)
Browse files Browse the repository at this point in the history
* Update rest API examples with a user-assigned MSI request/response example

* flatten the example structure

* while there, update the subscriptionIds to generic subIds

* one escaped
  • Loading branch information
filizt authored and jhendrixMSFT committed Jun 20, 2019
1 parent b115123 commit 2f48d30
Show file tree
Hide file tree
Showing 35 changed files with 159 additions and 75 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"subscriptionId": "f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint",
"assignment": {
"identity": {
Expand Down Expand Up @@ -68,7 +68,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"subscriptionId": "f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
Expand Down Expand Up @@ -38,7 +38,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"subscriptionId": "f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"subscriptionId": "00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
Expand Down Expand Up @@ -38,7 +38,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"subscriptionId": "f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b"
"subscriptionId": "00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
Expand Down Expand Up @@ -39,7 +39,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,8 @@
"operationId": "Assignments_CreateOrUpdate",
"description": "Create or update a blueprint assignment.",
"x-ms-examples": {
"Assignment": {
"$ref": "./examples/BlueprintAssignment_Create.json"
}
"Assignment with system-assigned managed identity": { "$ref": "./examples/BlueprintAssignment_Create_SystemAssignedMSI.json" },
"Assignment with user-assigned managed identity": { "$ref": "./examples/BlueprintAssignment_Create_UserAssignedMSI.json" }
},
"parameters": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint",
"assignmentOperationName": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f"
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"type": "microsoft.blueprint/blueprintAssignments/operations",
"name": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"properties": {
Expand All @@ -22,7 +22,7 @@
"kind": "azureResource",
"action": "put",
"jobState": "succeeded",
"requestUri": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"requestUri": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"result": {
"resources": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
"200": {
"body": {
"value": [
{
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.blueprint/blueprintAssignments/assignSimpleBlueprint/assignmentOperations/fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"type": "microsoft.blueprint/blueprintAssignments/operations",
"name": "fb5d4dcb-7ce2-4087-ba7a-459aa74e5e0f",
"properties": {
Expand All @@ -23,7 +23,7 @@
"kind": "azureResource",
"action": "put",
"jobState": "succeeded",
"requestUri": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"requestUri": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/microsoft.deployments/deployments/48432786-2f1b-4925-8032-a5d57bcb5b6e",
"result": {
"resources": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint",
"assignment": {
"identity": {
Expand Down Expand Up @@ -68,7 +68,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint",
"assignment": {
"identity": {
"type": "UserAssigned",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {}
}
},
"location": "eastus",
"properties": {
"description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
"blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
"parameters": {
"storageAccountType": {
"value": "Standard_LRS"
},
"costCenter": {
"value": "Contoso/Online/Shopping/Production"
},
"owners": {
"value": [
"[email protected]",
"[email protected]"
]
}
},
"resourceGroups": {
"storageRG": {
"name": "defaultRG",
"location": "eastus"
}
}
}
}
},
"responses": {
"201": {
"body": {
"identity": {
"type": "UserAssigned",
"tenantId": "00000000-0000-0000-0000-000000000000",
"userAssignedIdentities": {
"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resource-group/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity": {
"principalId": "00000000-0000-0000-0000-000000000000",
"clientId": "00000000-0000-0000-0000-000000000000"
}
}
},
"location": "eastus",
"properties": {
"description": "enforce pre-defined simpleBlueprint to this XXXXXXXX subscription.",
"provisioningState": "creating",
"blueprintId": "/providers/Microsoft.Management/managementGroups/ContosoOnlineGroup/providers/Microsoft.Blueprint/blueprints/simpleBlueprint",
"parameters": {
"storageAccountType": {
"value": "Standard_LRS"
},
"costCenter": {
"value": "Contoso/Online/Shopping/Production"
},
"owners": {
"value": [
"[email protected]",
"[email protected]"
]
}
},
"resourceGroups": {
"storageRG": {
"name": "defaultRG",
"location": "eastus"
}
}
},
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
Expand Down Expand Up @@ -38,7 +38,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
Expand Down Expand Up @@ -38,7 +38,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2017-11-11-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b"
"scope": "subscriptions/00000000-0000-0000-0000-000000000000"
},
"responses": {
"200": {
Expand Down Expand Up @@ -39,7 +39,7 @@
}
}
},
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprintAssignments/assignSimpleBlueprint",
"type": "Microsoft.Blueprint/Assignment",
"name": "assignSimpleBlueprint"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/{subscriptionId}",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"assignmentName": "assignSimpleBlueprint"
},
"responses": {
"200": {
"body": {
"objectId": "00000000-0000-0000-0000-000000000000"
"objectId": "00000000-1111-0000-1111-000000000000"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"blueprintName": "simpleBlueprint",
"artifactName": "storageTemplate",
"artifact": {
Expand Down Expand Up @@ -108,7 +108,7 @@
}
},
"kind": "template",
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "storageTemplate"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"blueprintName": "simpleBlueprint",
"artifactName": "storageTemplate"
},
Expand Down Expand Up @@ -57,7 +57,7 @@
}
},
"kind": "template",
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "storageTemplate"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"parameters": {
"api-version": "2018-11-01-preview",
"scope": "subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b",
"scope": "subscriptions/00000000-0000-0000-0000-000000000000",
"blueprintName": "simpleBlueprint",
"artifactName": "storageTemplate"
},
Expand Down Expand Up @@ -57,7 +57,7 @@
}
},
"kind": "template",
"id": "/subscriptions/f8df94f2-2f5a-4f4a-bcaf-1bb992fb564b/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"id": "/subscriptions/00000000-0000-0000-0000-000000000000/providers/Microsoft.Blueprint/blueprints/simpleBlueprint/artifacts/storageTemplate",
"type": "Microsoft.Blueprint/blueprints/artifacts",
"name": "storageTemplate"
}
Expand Down
Loading

0 comments on commit 2f48d30

Please sign in to comment.