From e623d5fa4f0203ebc53816a6205cebf80bb1c7e4 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 21 Sep 2021 15:56:33 -0700 Subject: [PATCH 1/9] [IoT-Central] Added identity request and response objects for IoT Central APIs to support Managed Identities --- .../examples/Apps_CreateOrUpdate.json | 13 +++++++ .../stable/2021-06-01/examples/Apps_Get.json | 5 +++ .../examples/Apps_ListByResourceGroup.json | 5 +++ .../examples/Apps_ListBySubscription.json | 5 +++ .../2021-06-01/examples/Apps_Update.json | 8 +++++ .../stable/2021-06-01/iotcentral.json | 35 +++++++++++++++++++ 6 files changed, 71 insertions(+) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json index 9475c57e83b3..024bf03bd538 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_CreateOrUpdate.json @@ -13,6 +13,9 @@ "displayName": "My IoT Central App", "subdomain": "my-iot-central-app", "template": "iotc-pnp-preview@1.0.0" + }, + "identity": { + "type": "SystemAssigned" } } }, @@ -39,6 +42,11 @@ }, "sku": { "name": "ST2" + }, + "identity": { + "type": "SystemAssigned", + "tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd", + "principalId": "8988ab15-3e7a-4586-8a1c-ed07a73a53e9" } } }, @@ -65,6 +73,11 @@ }, "sku": { "name": "ST2" + }, + "identity": { + "type": "SystemAssigned", + "tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd", + "principalId": "8988ab15-3e7a-4586-8a1c-ed07a73a53e9" } } }, diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json index 490a605e453e..df36d17487ae 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Get.json @@ -28,6 +28,11 @@ }, "sku": { "name": "F1" + }, + "identity": { + "type": "SystemAssigned", + "tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd", + "principalId": "8988ab15-3e7a-4586-8a1c-ed07a73a53e9" } } }, diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json index bef602c32f24..5322d6def274 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListByResourceGroup.json @@ -28,6 +28,11 @@ }, "sku": { "name": "F1" + }, + "identity": { + "type": "SystemAssigned", + "tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd", + "principalId": "8988ab15-3e7a-4586-8a1c-ed07a73a53e9" } } ], diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json index 6692ed91fff9..c05dfc8c6f2f 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_ListBySubscription.json @@ -27,6 +27,11 @@ }, "sku": { "name": "F1" + }, + "identity": { + "type": "SystemAssigned", + "tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd", + "principalId": "8988ab15-3e7a-4586-8a1c-ed07a73a53e9" } } ], diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json index ac9b0261d5ab..697d2fb379aa 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/examples/Apps_Update.json @@ -7,6 +7,9 @@ "AppPatch": { "properties": { "displayName": "My IoT Central App 2" + }, + "identity": { + "type": "SystemAssigned" } } }, @@ -34,6 +37,11 @@ }, "sku": { "name": "ST2" + }, + "identity": { + "type": "SystemAssigned", + "tenantId": "f686d426-8d16-42db-81b7-ab578e110ccd", + "principalId": "8988ab15-3e7a-4586-8a1c-ed07a73a53e9" } } }, diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 03e20a917cb9..eeeca366ce2f 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -533,6 +533,33 @@ }, "readOnly": true }, + "ArmIdentity": { + "type": "object", + "properties": { + "principalId": { + "description": "Principal Id", + "type": "string", + "readOnly": true + }, + "tenantId": { + "description": "Tenant Id", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The type of identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", + "type": "string", + "enum": [ + "SystemAssigned", + "None" + ], + "x-ms-enum": { + "name": "ResourceIdentityType", + "modelAsString": false + } + } + } + }, "AppSkuInfo": { "description": "Information about the SKU of the IoT Central application.", "type": "object", @@ -567,6 +594,10 @@ "sku": { "description": "A valid instance SKU.", "$ref": "#/definitions/AppSkuInfo" + }, + "identity": { + "description": "The managed identities for the IoT Central application.", + "$ref": "#/definitions/ArmIdentity" } }, "allOf": [ @@ -597,6 +628,10 @@ "description": "The common properties of an IoT Central application.", "x-ms-client-flatten": true, "$ref": "#/definitions/AppProperties" + }, + "identity": { + "description": "The managed identities for the IoT Central application.", + "$ref": "#/definitions/ArmIdentity" } } }, From 33dfa672cbc04d00f5d83a480b5a22b40b20d2ff Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Tue, 21 Sep 2021 16:11:48 -0700 Subject: [PATCH 2/9] Updated model as string --- .../Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index eeeca366ce2f..3aef76c94bbb 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -555,7 +555,7 @@ ], "x-ms-enum": { "name": "ResourceIdentityType", - "modelAsString": false + "modelAsString": true } } } From 7cfb0b6eb89b3af68cf700177fddde7a86493687 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Wed, 22 Sep 2021 07:24:26 -0700 Subject: [PATCH 3/9] Updated case for none --- .../Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 3aef76c94bbb..3bb00afc46e1 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -551,7 +551,7 @@ "type": "string", "enum": [ "SystemAssigned", - "None" + "none" ], "x-ms-enum": { "name": "ResourceIdentityType", From fce54f522c65b61442762b2899fab6b7dda569b2 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Thu, 23 Sep 2021 15:57:07 -0700 Subject: [PATCH 4/9] Updated ArmIdentity to ManagedIdentity --- .../stable/2021-06-01/iotcentral.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 3bb00afc46e1..5bb5d291ceb1 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -533,7 +533,7 @@ }, "readOnly": true }, - "ArmIdentity": { + "ManagedIdentity": { "type": "object", "properties": { "principalId": { @@ -547,7 +547,7 @@ "readOnly": true }, "type": { - "description": "The type of identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", + "description": "The type of managed identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", "type": "string", "enum": [ "SystemAssigned", @@ -597,7 +597,7 @@ }, "identity": { "description": "The managed identities for the IoT Central application.", - "$ref": "#/definitions/ArmIdentity" + "$ref": "#/definitions/ManagedIdentity" } }, "allOf": [ @@ -631,7 +631,7 @@ }, "identity": { "description": "The managed identities for the IoT Central application.", - "$ref": "#/definitions/ArmIdentity" + "$ref": "#/definitions/ManagedIdentity" } } }, From fe64385cd87ec3675d6e50b125151b9f6be4d2fe Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Thu, 23 Sep 2021 16:15:57 -0700 Subject: [PATCH 5/9] Added description and title for ManagedIdentity --- .../Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 5bb5d291ceb1..502b4025bc89 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -534,6 +534,8 @@ "readOnly": true }, "ManagedIdentity": { + "description": "The managed identity for IoT Central application.", + "title": "Managed Identity", "type": "object", "properties": { "principalId": { From 14b5078e4234d69cb66fd0b1f5fca12b3a785e9d Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Thu, 23 Sep 2021 16:27:33 -0700 Subject: [PATCH 6/9] Updated casing for mI type --- .../Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 502b4025bc89..47dac2fd1b45 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -552,7 +552,7 @@ "description": "The type of managed identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", "type": "string", "enum": [ - "SystemAssigned", + "systemassigned", "none" ], "x-ms-enum": { From efb95856a59637135bdceb51a41fbd2cd17f50a5 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Thu, 23 Sep 2021 18:43:42 -0700 Subject: [PATCH 7/9] Reset casing for MI type --- .../Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 47dac2fd1b45..17055cb0da58 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -552,8 +552,8 @@ "description": "The type of managed identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", "type": "string", "enum": [ - "systemassigned", - "none" + "SystemAssigned", + "None" ], "x-ms-enum": { "name": "ResourceIdentityType", From f787af9a59c2f7ef6638556064785ef4fbb8c2c7 Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Wed, 29 Sep 2021 07:07:13 -0700 Subject: [PATCH 8/9] Updated comments for principalId and tenantId --- .../stable/2021-06-01/iotcentral.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 17055cb0da58..28f1bb091c6e 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -539,14 +539,14 @@ "type": "object", "properties": { "principalId": { - "description": "Principal Id", + "readOnly": true, "type": "string", - "readOnly": true + "description": "The principal ID of resource identity. Also known as the objectId." }, "tenantId": { - "description": "Tenant Id", + "readOnly": true, "type": "string", - "readOnly": true + "description": "The tenant ID of resource." }, "type": { "description": "The type of managed identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", From 4786db6fc83cc30ba71701a1e4cf351a657a246a Mon Sep 17 00:00:00 2001 From: Ganesh Viswanathan Date: Fri, 8 Oct 2021 07:53:55 -0700 Subject: [PATCH 9/9] Use common-types for supported system-assigned managed identities --- .../stable/2021-06-01/iotcentral.json | 33 ++----------------- 1 file changed, 2 insertions(+), 31 deletions(-) diff --git a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json index 28f1bb091c6e..59c41e92df94 100644 --- a/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json +++ b/specification/iotcentral/resource-manager/Microsoft.IoTCentral/stable/2021-06-01/iotcentral.json @@ -533,35 +533,6 @@ }, "readOnly": true }, - "ManagedIdentity": { - "description": "The managed identity for IoT Central application.", - "title": "Managed Identity", - "type": "object", - "properties": { - "principalId": { - "readOnly": true, - "type": "string", - "description": "The principal ID of resource identity. Also known as the objectId." - }, - "tenantId": { - "readOnly": true, - "type": "string", - "description": "The tenant ID of resource." - }, - "type": { - "description": "The type of managed identity used for the resource. 'SystemAssigned' refers to an implicitly created identity, while the type 'None' will remove any identities from the service.", - "type": "string", - "enum": [ - "SystemAssigned", - "None" - ], - "x-ms-enum": { - "name": "ResourceIdentityType", - "modelAsString": true - } - } - } - }, "AppSkuInfo": { "description": "Information about the SKU of the IoT Central application.", "type": "object", @@ -599,7 +570,7 @@ }, "identity": { "description": "The managed identities for the IoT Central application.", - "$ref": "#/definitions/ManagedIdentity" + "$ref": "../../../../../common-types/resource-management/v3/managedidentity.json#/definitions/SystemAssignedServiceIdentity" } }, "allOf": [ @@ -633,7 +604,7 @@ }, "identity": { "description": "The managed identities for the IoT Central application.", - "$ref": "#/definitions/ManagedIdentity" + "$ref": "../../../../../common-types/resource-management/v3/managedidentity.json#/definitions/SystemAssignedServiceIdentity" } } },