From 95ebd65eab2d0198f5b3d729b8f0ae43c0b14137 Mon Sep 17 00:00:00 2001 From: Maor Leger Date: Thu, 7 Oct 2021 17:19:46 -0700 Subject: [PATCH 1/4] wip --- sdk/keyvault/test-resources.json | 61 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 31 deletions(-) diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index ad5cd60f952d..709f03ef0bea 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -64,25 +64,19 @@ "description": "The base time to add 2 hours to for SAS token expiration. The default is the current time." } }, - "attestationImageName": { + "attestationImage": { "type": "string", - "defaultValue": "keyvault-mock-attestation", + "defaultValue": "keyvault-mock-attestation:latest", "metadata": { - "description": "The name of the secure key release attestation image to deploy. Only deployed when enableHsm is true." - } - }, - "attestationImageTag": { - "type": "string", - "defaultValue": "latest", - "metadata": { - "description": "The tag of the secure key release attestation image to use. The default is 'latest'. Only deployed when enableHsm is true." + "description": "The attestation image to use. The default is 'keyvault-mock-attestation:latest'." } } }, "variables": { "kvApiVersion": "2019-09-01", - "attestationImageId": "[concat('DOCKER|azsdkengsys.azurecr.io/', parameters('attestationImageName'), ':', parameters('attestationImageTag'))]", - "attestationAppName": "[concat(parameters('baseName'), '-skr-attestation')]", + "attestationFarm": "[concat(parameters('baseName'), 'farm')]", + "attestationSite": "[concat(parameters('baseName'), 'site')]", + "attestationImageUri": "[concat('DOCKER|azsdkengsys.azurecr.io/', parameters('attestationImage'))]", "kvName": "[parameters('baseName')]", "hsmApiVersion": "2020-04-01-preview", "hsmName": "[concat(parameters('baseName'), 'hsm')]", @@ -248,37 +242,42 @@ }, { "type": "Microsoft.Web/serverfarms", - "apiVersion": "2021-01-15", - "name": "[variables('attestationAppName')]", + "apiVersion": "2020-12-01", + "name": "[variables('attestationFarm')]", + "condition": "[parameters('enableHsm')]", "location": "[parameters('location')]", "kind": "linux", - "sku": { "name": "B1" }, + "sku": { + "name": "B1" + }, "properties": { - "reserved": true + "reserved": true } }, { "type": "Microsoft.Web/sites", - "apiVersion": "2016-08-01", - "name": "[variables('attestationAppName')]", + "apiVersion": "2020-12-01", + "name": "[variables('attestationSite')]", "condition": "[parameters('enableHsm')]", + "dependsOn": [ + "[resourceId('Microsoft.Web/serverfarms', variables('attestationFarm'))]" + ], "location": "[parameters('location')]", "properties": { "httpsOnly": true, - "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('attestationAppName'))]", + "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('attestationFarm'))]", "siteConfig": { - "name": "[variables('attestationAppName')]", - "alwaysOn": true, - "linuxFxVersion": "[variables('attestationImageId')]", - "appSettings": [ - { - "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", - "value": "false" - } - ] + "name": "[variables('attestationSite')]", + "alwaysOn": true, + "linuxFxVersion": "[variables('attestationImageUri')]", + "appSettings": [ + { + "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", + "value": "false" + } + ] } - }, - "dependsOn": ["[resourceId('Microsoft.Web/serverfarms', variables('attestationAppName'))]"] + } } ], "outputs": { @@ -318,7 +317,7 @@ "AZURE_KEYVAULT_ATTESTATION_URI": { "type": "string", "condition": "[parameters('enableHsm')]", - "value": "[concat('https://', reference(resourceId('Microsoft.Web/sites', variables('attestationAppName')), '2018-02-01').defaultHostName, '/')]" + "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]", } } } From 1a39829fe79268a8f814065bc8ad6324006d7828 Mon Sep 17 00:00:00 2001 From: Maor Leger Date: Fri, 8 Oct 2021 07:14:43 -0700 Subject: [PATCH 2/4] fix formatting --- sdk/keyvault/test-resources.json | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 709f03ef0bea..b66049a95fd5 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -248,10 +248,10 @@ "location": "[parameters('location')]", "kind": "linux", "sku": { - "name": "B1" + "name": "B1" }, "properties": { - "reserved": true + "reserved": true } }, { @@ -260,22 +260,22 @@ "name": "[variables('attestationSite')]", "condition": "[parameters('enableHsm')]", "dependsOn": [ - "[resourceId('Microsoft.Web/serverfarms', variables('attestationFarm'))]" + "[resourceId('Microsoft.Web/serverfarms', variables('attestationFarm'))]" ], "location": "[parameters('location')]", "properties": { "httpsOnly": true, "serverFarmId": "[resourceId('Microsoft.Web/serverfarms', variables('attestationFarm'))]", "siteConfig": { - "name": "[variables('attestationSite')]", - "alwaysOn": true, - "linuxFxVersion": "[variables('attestationImageUri')]", - "appSettings": [ - { - "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", - "value": "false" - } - ] + "name": "[variables('attestationSite')]", + "alwaysOn": true, + "linuxFxVersion": "[variables('attestationImageUri')]", + "appSettings": [ + { + "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", + "value": "false" + } + ] } } } From 3eef92a75b739a8961fb09574dda91c70b722687 Mon Sep 17 00:00:00 2001 From: Maor Leger Date: Fri, 8 Oct 2021 12:43:02 -0700 Subject: [PATCH 3/4] fix formatting --- sdk/keyvault/test-resources.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index b66049a95fd5..1725671043fe 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -272,8 +272,8 @@ "linuxFxVersion": "[variables('attestationImageUri')]", "appSettings": [ { - "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", - "value": "false" + "name": "WEBSITES_ENABLE_APP_SERVICE_STORAGE", + "value": "false" } ] } From bfac88e8a771fd84d8ff67513f7fa6f907178af5 Mon Sep 17 00:00:00 2001 From: Maor Leger Date: Fri, 8 Oct 2021 12:44:50 -0700 Subject: [PATCH 4/4] remove trailing slash --- sdk/keyvault/test-resources.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/keyvault/test-resources.json b/sdk/keyvault/test-resources.json index 1725671043fe..5bd8b80fd3c1 100644 --- a/sdk/keyvault/test-resources.json +++ b/sdk/keyvault/test-resources.json @@ -317,7 +317,7 @@ "AZURE_KEYVAULT_ATTESTATION_URI": { "type": "string", "condition": "[parameters('enableHsm')]", - "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]", + "value": "[format('https://{0}/', reference(variables('attestationSite')).defaultHostName)]" } } }