diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ManagedInstances.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ManagedInstances.json index 758ab9e1b32d..84c7e9cb35ab 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ManagedInstances.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/ManagedInstances.json @@ -969,7 +969,7 @@ ], "properties": { "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "The Azure Active Directory identity of the managed instance.", "x-ms-mutability": [ "read", @@ -996,7 +996,7 @@ "description": "Managed instance sku" }, "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "Managed instance identity" }, "properties": { diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/Servers.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/Servers.json index aa4e10279057..b99f6785495b 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/Servers.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2020-11-01-preview/Servers.json @@ -736,7 +736,7 @@ ], "properties": { "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "The Azure Active Directory identity of the server.", "x-ms-mutability": [ "read", @@ -760,7 +760,7 @@ "type": "object", "properties": { "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "Server identity" }, "properties": { diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/ManagedInstances.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/ManagedInstances.json index 934a8280c2c7..1321783eb9dc 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/ManagedInstances.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/ManagedInstances.json @@ -978,7 +978,7 @@ ], "properties": { "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "The Azure Active Directory identity of the managed instance.", "x-ms-mutability": [ "read", @@ -1005,7 +1005,7 @@ "description": "Managed instance sku" }, "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "Managed instance identity" }, "properties": { diff --git a/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/Servers.json b/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/Servers.json index a54f852ae472..4e8657f0cdc8 100644 --- a/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/Servers.json +++ b/specification/sql/resource-manager/Microsoft.Sql/preview/2021-02-01-preview/Servers.json @@ -749,7 +749,7 @@ ], "properties": { "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "The Azure Active Directory identity of the server.", "x-ms-mutability": [ "read", @@ -773,7 +773,7 @@ "type": "object", "properties": { "identity": { - "$ref": "#/definitions/ResourceIdentityWithUserAssignedIdentities", + "$ref": "../../../common/v2/types.json#/definitions/ResourceIdentity", "description": "Server identity" }, "properties": { diff --git a/specification/sql/resource-manager/common/v2/types.json b/specification/sql/resource-manager/common/v2/types.json new file mode 100644 index 000000000000..9cd1182902d7 --- /dev/null +++ b/specification/sql/resource-manager/common/v2/types.json @@ -0,0 +1,66 @@ +{ + "swagger": "2.0", + "info": { + "version": "v2", + "title": "Common types" + }, + "paths": {}, + "definitions": { + "UserIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "type": "object", + "properties": { + "principalId": { + "format": "uuid", + "description": "The Azure Active Directory principal id.", + "type": "string", + "readOnly": true + }, + "clientId": { + "format": "uuid", + "description": "The Azure Active Directory client id.", + "type": "string", + "readOnly": true + } + } + }, + "ResourceIdentity": { + "description": "Azure Active Directory identity configuration for a resource.", + "type": "object", + "properties": { + "userAssignedIdentities": { + "description": "The resource ids of the user assigned identities to use", + "type": "object", + "additionalProperties": { + "$ref": "#/definitions/UserIdentity" + } + }, + "principalId": { + "format": "uuid", + "description": "The Azure Active Directory principal id.", + "type": "string", + "readOnly": true + }, + "type": { + "description": "The identity type. Set this to 'SystemAssigned' in order to automatically create and assign an Azure Active Directory principal for the resource.", + "enum": [ + "None", + "SystemAssigned", + "UserAssigned" + ], + "type": "string", + "x-ms-enum": { + "name": "IdentityType", + "modelAsString": true + } + }, + "tenantId": { + "format": "uuid", + "description": "The Azure Active Directory tenant id.", + "type": "string", + "readOnly": true + } + } + } + } +}