From 44baa84dee98d0af11bd49ef660d5610a1789683 Mon Sep 17 00:00:00 2001 From: Samir Solanki Date: Wed, 26 Aug 2020 18:19:41 -0700 Subject: [PATCH 1/5] update namedvalue contract for keyvault --- .../2020-06-01-preview/definitions.json | 50 ++++++++++++++++++- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json index 51dfac6d821d..02593a32064f 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json @@ -2636,6 +2636,42 @@ ], "description": "Issue contract Update Properties." }, + "KeyVaultContractProperties": { + "properties": { + "secretIdentifier": { + "type": "string", + "description": "Key vault secret ID for fetching secret." + }, + "identityClientId": { + "type": "string", + "description": "SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret." + }, + "lastStatus": { + "$ref": "#/definitions/KeyVaultLastAccessStatusContractProperties", + "description": "Last time sync and refresh status of secret from key vault.", + "readonly": true + } + }, + "description": "KeyVault contract details." + }, + "KeyVaultLastAccessStatusContractProperties": { + "properties": { + "code": { + "type": "string", + "description": "Last status code for sync and refresh of secret from key vault." + }, + "message": { + "type": "string", + "description": "Details of the error else empty." + }, + "lastTimeStampUtc": { + "type": "string", + "format": "date-time", + "description": "Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n" + } + }, + "description": "Issue contract Update Properties." + }, "LoggerCollection": { "properties": { "value": { @@ -3663,8 +3699,11 @@ "value": { "type": "string", "description": "Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", - "minLength": 1, "maxLength": 4096 + }, + "keyVault": { + "$ref": "#/definitions/KeyVaultContractProperties", + "description": "KeyVault location details of the namedValue." } }, "allOf": [ @@ -3705,8 +3744,11 @@ "value": { "type": "string", "description": "Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace. This property will not be filled on 'GET' operations! Use '/listSecrets' POST request to get the value.", - "minLength": 1, "maxLength": 4096 + }, + "keyVault": { + "$ref": "#/definitions/KeyVaultContractProperties", + "description": "KeyVault location details of the namedValue." } }, "allOf": [ @@ -3750,6 +3792,10 @@ "description": "Value of the NamedValue. Can contain policy expressions. It may not be empty or consist only of whitespace.", "minLength": 1, "maxLength": 4096 + }, + "keyVault": { + "$ref": "#/definitions/KeyVaultContractProperties", + "description": "KeyVault location details of the namedValue." } }, "allOf": [ From d631cdb6d9fe3f9db3f5514d7cdb03e399433013 Mon Sep 17 00:00:00 2001 From: Samir Solanki Date: Fri, 11 Sep 2020 13:38:57 -0700 Subject: [PATCH 2/5] add examples --- .../2020-06-01-preview/apimnamedvalues.json | 6 ++ .../2020-06-01-preview/definitions.json | 2 +- ...anagementCreateNamedValueWithKeyVault.json | 76 +++++++++++++++++++ ...piManagementGetNamedValueWithKeyVault.json | 34 +++++++++ .../ApiManagementListNamedValues.json | 14 +++- 5 files changed, 128 insertions(+), 4 deletions(-) create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json create mode 100644 specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetNamedValueWithKeyVault.json diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimnamedvalues.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimnamedvalues.json index f591d8e0a408..f2963834eab4 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimnamedvalues.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/apimnamedvalues.json @@ -152,6 +152,9 @@ "x-ms-examples": { "ApiManagementGetNamedValue": { "$ref": "./examples/ApiManagementGetNamedValue.json" + }, + "ApiManagementGetNamedValueWithKeyVault": { + "$ref": "./examples/ApiManagementGetNamedValueWithKeyVault.json" } }, "parameters": [ @@ -201,6 +204,9 @@ "x-ms-examples": { "ApiManagementCreateNamedValue": { "$ref": "./examples/ApiManagementCreateNamedValue.json" + }, + "ApiManagementCreateNamedValueWithKeyVault": { + "$ref": "./examples/ApiManagementCreateNamedValueWithKeyVault.json" } }, "parameters": [ diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json index 02593a32064f..1d4b022cd4ef 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json @@ -2664,7 +2664,7 @@ "type": "string", "description": "Details of the error else empty." }, - "lastTimeStampUtc": { + "timeStampUtc": { "type": "string", "format": "date-time", "description": "Last time secret was accessed. The date conforms to the following format: `yyyy-MM-ddTHH:mm:ssZ` as specified by the ISO 8601 standard.\n" diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json new file mode 100644 index 000000000000..d05c79bfbe1a --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json @@ -0,0 +1,76 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2020-06-01-preview", + "subscriptionId": "subid", + "namedValueId": "testprop6", + "parameters": { + "properties": { + "displayName": "prop6namekv", + "keyVault": { + "IdentityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0", + "SecretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert" + }, + "tags": [ + "foo", + "bar" + ], + "secret": false + } + } + }, + "responses": { + "202": { + "headers": { + "location": "https://management.azure.com/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6?api-version=2020-06-01-preview&asyncId=5c730e343244df1b9cb56e85&asyncCode=201" + } + }, + "201": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6", + "type": "Microsoft.ApiManagement/service/namedValues", + "name": "testprop6", + "properties": { + "displayName": "prop6namekv", + "keyVault": { + "secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert", + "identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0", + "lastStatus": { + "code": "Success", + "timeStampUtc": "2020-09-11T00:54:31.8024882Z" + } + }, + "tags": [ + "foo", + "bar" + ], + "secret": true + } + } + }, + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6", + "type": "Microsoft.ApiManagement/service/namedValues", + "name": "testprop6", + "properties": { + "displayName": "prop6namekv", + "keyVault": { + "secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert", + "identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0", + "lastStatus": { + "code": "Success", + "timeStampUtc": "2020-09-11T00:54:31.8024882Z" + } + }, + "tags": [ + "foo", + "bar" + ], + "secret": true + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetNamedValueWithKeyVault.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetNamedValueWithKeyVault.json new file mode 100644 index 000000000000..57d4b52e8cb8 --- /dev/null +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementGetNamedValueWithKeyVault.json @@ -0,0 +1,34 @@ +{ + "parameters": { + "serviceName": "apimService1", + "resourceGroupName": "rg1", + "api-version": "2020-06-01-preview", + "subscriptionId": "subid", + "namedValueId": "testprop6" + }, + "responses": { + "200": { + "body": { + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6", + "type": "Microsoft.ApiManagement/service/namedValues", + "name": "testprop6", + "properties": { + "displayName": "prop6namekv", + "keyVault": { + "secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert", + "identityClientId": "2d2df842-44d8-4885-8dec-77cc1a984a31", + "lastStatus": { + "code": "Success", + "timeStampUtc": "2020-09-11T00:54:31.8024882Z" + } + }, + "tags": [ + "foo", + "bar" + ], + "secret": true + } + } + } + } +} diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListNamedValues.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListNamedValues.json index 6b065d68a783..eb5c84ef99f0 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListNamedValues.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementListNamedValues.json @@ -20,11 +20,19 @@ } }, { - "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testarmTemplateproperties2", + "id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.ApiManagement/service/apimService1/namedValues/testprop6", "type": "Microsoft.ApiManagement/service/namedValues", - "name": "testarmTemplateproperties2", + "name": "testprop6", "properties": { - "displayName": "propName", + "displayName": "prop6namekv", + "keyVault": { + "secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert", + "identityClientId": "2d2df842-44d8-4885-8dec-77cc1a984a31", + "lastStatus": { + "code": "Success", + "timeStampUtc": "2020-09-11T00:54:31.8024882Z" + } + }, "tags": [ "foo", "bar" From 1626b41ab593aac0d4dc865d5698942a5e062df8 Mon Sep 17 00:00:00 2001 From: Samir Solanki Date: Fri, 11 Sep 2020 13:58:44 -0700 Subject: [PATCH 3/5] separate out create contract --- .../2020-06-01-preview/definitions.json | 22 ++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json index 1d4b022cd4ef..6fff5c42fa3b 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json @@ -2636,11 +2636,24 @@ ], "description": "Issue contract Update Properties." }, + "KeyVaultContractCreateProperties" :{ + "properties": { + "secretIdentifier": { + "type": "string", + "description": "Key vault secret identifier for fetching secret." + }, + "identityClientId": { + "type": "string", + "description": "SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret." + } + }, + "description": "Create keyVault contract details." + }, "KeyVaultContractProperties": { "properties": { "secretIdentifier": { "type": "string", - "description": "Key vault secret ID for fetching secret." + "description": "Key vault secret identifier for fetching secret." }, "identityClientId": { "type": "string", @@ -2648,8 +2661,7 @@ }, "lastStatus": { "$ref": "#/definitions/KeyVaultLastAccessStatusContractProperties", - "description": "Last time sync and refresh status of secret from key vault.", - "readonly": true + "description": "Last time sync and refresh status of secret from key vault." } }, "description": "KeyVault contract details." @@ -3702,7 +3714,7 @@ "maxLength": 4096 }, "keyVault": { - "$ref": "#/definitions/KeyVaultContractProperties", + "$ref": "#/definitions/KeyVaultContractCreateProperties", "description": "KeyVault location details of the namedValue." } }, @@ -3794,7 +3806,7 @@ "maxLength": 4096 }, "keyVault": { - "$ref": "#/definitions/KeyVaultContractProperties", + "$ref": "#/definitions/KeyVaultContractCreateProperties", "description": "KeyVault location details of the namedValue." } }, From 7cbbf9451c6fa18cee8f861927b95726b672292a Mon Sep 17 00:00:00 2001 From: Samir Solanki Date: Fri, 11 Sep 2020 14:02:20 -0700 Subject: [PATCH 4/5] common create contract --- .../preview/2020-06-01-preview/definitions.json | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json index 6fff5c42fa3b..90d0054beded 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json @@ -2636,7 +2636,7 @@ ], "description": "Issue contract Update Properties." }, - "KeyVaultContractCreateProperties" :{ + "KeyVaultContractCreateProperties": { "properties": { "secretIdentifier": { "type": "string", @@ -2651,19 +2651,16 @@ }, "KeyVaultContractProperties": { "properties": { - "secretIdentifier": { - "type": "string", - "description": "Key vault secret identifier for fetching secret." - }, - "identityClientId": { - "type": "string", - "description": "SystemAssignedIdentity or UserAssignedIdentity Client Id which will be used to access key vault secret." - }, "lastStatus": { "$ref": "#/definitions/KeyVaultLastAccessStatusContractProperties", "description": "Last time sync and refresh status of secret from key vault." } }, + "allOf": [ + { + "$ref": "#/definitions/KeyVaultContractCreateProperties" + } + ], "description": "KeyVault contract details." }, "KeyVaultLastAccessStatusContractProperties": { From 2144c49e7e86637ab452efb154e26337836a3ee7 Mon Sep 17 00:00:00 2001 From: Samir Solanki Date: Fri, 11 Sep 2020 14:14:07 -0700 Subject: [PATCH 5/5] fix examples --- .../preview/2020-06-01-preview/definitions.json | 3 +-- .../examples/ApiManagementCreateNamedValueWithKeyVault.json | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json index 90d0054beded..8a695675bc3d 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/definitions.json @@ -3721,8 +3721,7 @@ } ], "required": [ - "displayName", - "value" + "displayName" ], "description": "NamedValue Contract properties." }, diff --git a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json index d05c79bfbe1a..a111ca2ba347 100644 --- a/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json +++ b/specification/apimanagement/resource-manager/Microsoft.ApiManagement/preview/2020-06-01-preview/examples/ApiManagementCreateNamedValueWithKeyVault.json @@ -9,8 +9,8 @@ "properties": { "displayName": "prop6namekv", "keyVault": { - "IdentityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0", - "SecretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert" + "identityClientId": "ceaa6b06-c00f-43ef-99ac-f53d1fe876a0", + "secretIdentifier": "https://rpbvtkeyvaultintegration.vault-int.azure-int.net/secrets/msitestingCert" }, "tags": [ "foo",