diff --git a/.vscode/cspell.json b/.vscode/cspell.json index 9b609bf55904..26531b0a5988 100644 --- a/.vscode/cspell.json +++ b/.vscode/cspell.json @@ -1125,8 +1125,14 @@ "Nify", "ctxt", "unflattened", - "deseralize", - "wday" + "deseralize", + "wday" + ] + }, + { + "filename": "sdk/appconfiguration/test-resources.json", + "words": [ + "azconfig" ] } ], diff --git a/sdk/appconfiguration/test-resources.json b/sdk/appconfiguration/test-resources.json index cd4d0859565d..7cde9d6a443a 100644 --- a/sdk/appconfiguration/test-resources.json +++ b/sdk/appconfiguration/test-resources.json @@ -48,15 +48,30 @@ "defaultValue": "azconfig-net", "type": "string" }, - "endpointSuffix": { + "azConfigEndpointSuffix": { "defaultValue": ".azconfig.io", "type": "string" + }, + "keyVaultEndpointSuffix": { + "defaultValue": ".vault.azure.net", + "type": "string", + "metadata": { + "description": "Endpoint suffix for sovereign clouds, requires the proceeding '.'. The default uses the public Azure Cloud (.vault.azure.net)" + } + }, + "keyVaultSku": { + "type": "string", + "defaultValue": "premium", + "metadata": { + "description": "Key Vault SKU to deploy. The default is 'premium'" + } } }, "variables": { "roleDefinitionId": "[format('/subscriptions/{0}/providers/Microsoft.Authorization/roleDefinitions/5ae67dd6-50cb-40e7-96ff-dc2bfa4b606b', subscription().subscriptionId)]", "uniqueAzConfigName": "[format('{0}-{1}', parameters('baseName'), parameters('azConfigPrefix'))]", - "endpointValue": "[format('https://{0}-{1}.azconfig.io', parameters('baseName'), parameters('azConfigPrefix'))]" + "endpointValue": "[format('https://{0}-{1}{2}', parameters('baseName'), parameters('azConfigPrefix'), parameters('azConfigEndpointSuffix'))]", + "azureKeyVaultSecretUrl": "[format('https://{0}{1}/secrets/TestSecret', parameters('baseName'), parameters('keyVaultEndpointSuffix'))]" }, "resources": [ { @@ -79,10 +94,45 @@ "roleDefinitionId": "[variables('roleDefinitionId')]", "principalId": "[parameters('testApplicationOid')]" } + }, + { + "type": "Microsoft.KeyVault/vaults", + "apiVersion": "2016-10-01", + "name": "[parameters('baseName')]", + "location": "[parameters('location')]", + "properties": { + "sku": { + "family": "A", + "name": "[parameters('keyVaultSku')]" + }, + "tenantId": "[parameters('tenantId')]", + "accessPolicies": [ + { + "tenantId": "[parameters('tenantId')]", + "objectId": "[parameters('testApplicationOid')]", + "permissions": { + "secrets": [ + "get" + ] + } + } + ] + } + }, + { + "type": "Microsoft.KeyVault/vaults/secrets", + "name": "[concat(parameters('baseName'), '/TestSecret')]", + "apiVersion": "2016-10-01", + "location": "[parameters('location')]", + "dependsOn": [ + "[resourceId('Microsoft.KeyVault/vaults', parameters('baseName'))]" + ], + "properties": { + "value": "Very secret value" + } } ], "outputs": { - "APPCONFIGURATION_CONNECTION_STRING": { "type": "string", "value": "[listKeys(resourceId('Microsoft.AppConfiguration/configurationStores',variables('uniqueAzConfigName')), '2019-02-01-preview').value[0].connectionString]" @@ -90,6 +140,10 @@ "APPCONFIGURATION_ENDPOINT_STRING": { "type": "string", "value": "[variables('endpointValue')]" + }, + "KEYVAULT_SECRET_URL": { + "type": "string", + "value": "[variables('azureKeyVaultSecretUrl')]" } } } \ No newline at end of file