Asib27's picture
try 1
065fee7 verified
raw
history blame
7.88 kB
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The base resource name."
}
},
"tenantId": {
"type": "string",
"metadata": {
"description": "The tenant ID to which the application and resources belong."
}
},
"testApplicationOid": {
"type": "string",
"metadata": {
"description": "The client OID to grant access to test resources."
}
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]",
"metadata": {
"description": "The location of the resource. By default, this is the same as the resource group."
}
},
"sku": {
"defaultValue": "Standard",
"type": "string"
},
"azConfigPrefix": {
"defaultValue": "azconfig-python",
"type": "string"
},
"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}{2}', parameters('baseName'), parameters('azConfigPrefix'), parameters('azConfigEndpointSuffix'))]",
"azureKeyVaultUrl": "[format('https://{0}{1}/', parameters('baseName'), parameters('keyVaultEndpointSuffix'))]",
"azureKeyVaultSecretUrl": "[format('https://{0}{1}/secrets/TestSecret', parameters('baseName'), parameters('keyVaultEndpointSuffix'))]"
},
"resources": [
{
"type": "Microsoft.AppConfiguration/configurationStores",
"apiVersion": "2019-10-01",
"name": "[variables('uniqueAzConfigName')]",
"location": "[parameters('location')]",
"sku": {
"name": "[parameters('sku')]"
},
"properties": {
"endpoint": "[variables('endpointValue')]"
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2018-09-01-preview",
"name": "[guid(resourceGroup().id)]",
"properties": {
"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"
}
},
{
"type": "Microsoft.AppConfiguration/configurationStores/keyValues",
"apiVersion": "2020-07-01-preview",
"name": "[concat(variables('uniqueAzConfigName'), '/', 'message')]",
"dependsOn": [
"[variables('uniqueAzConfigName')]"
],
"properties": {
"value": "hi"
}
},
{
"type": "Microsoft.AppConfiguration/configurationStores/keyValues",
"apiVersion": "2020-07-01-preview",
"name": "[concat(variables('uniqueAzConfigName'), '/', 'message$dev')]",
"dependsOn": [
"[variables('uniqueAzConfigName')]"
],
"properties": {
"value": "test"
}
},
{
"type": "Microsoft.AppConfiguration/configurationStores/keyValues",
"apiVersion": "2020-07-01-preview",
"name": "[concat(variables('uniqueAzConfigName'), '/', 'my_json')]",
"dependsOn": [
"[variables('uniqueAzConfigName')]"
],
"properties": {
"value": "{\"key\": \"value\"}",
"contentType": "application/json"
}
},
{
"type": "Microsoft.AppConfiguration/configurationStores/keyValues",
"apiVersion": "2020-07-01-preview",
"name": "[concat(variables('uniqueAzConfigName'), '/', 'test.trimmed')]",
"dependsOn": [
"[variables('uniqueAzConfigName')]"
],
"properties": {
"value": "key"
}
},
{
"type": "Microsoft.AppConfiguration/configurationStores/keyValues",
"apiVersion": "2020-07-01-preview",
"name": "[concat(variables('uniqueAzConfigName'), '/', '.appconfig.featureflag~2FAlpha')]",
"dependsOn": [
"[variables('uniqueAzConfigName')]"
],
"properties": {
"value": "{\"id\":\"Alpha\",\"description\":\"\",\"enabled\":false,\"conditions\":{\"client_filters\":[]}}",
"contentType": "application/vnd.microsoft.appconfig.ff+json;charset=utf-8"
}
}
],
"outputs": {
"APPCONFIGURATION_CONNECTION_STRING": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.AppConfiguration/configurationStores',variables('uniqueAzConfigName')), '2019-02-01-preview').value[0].connectionString]"
},
"APPCONFIGURATION_ENDPOINT_STRING": {
"type": "string",
"value": "[variables('endpointValue')]"
},
"KEYVAULT_URL": {
"type": "string",
"value": "[variables('azureKeyVaultUrl')]"
},
"KEYVAULT_SECRET_URL": {
"type": "string",
"value": "[variables('azureKeyVaultSecretUrl')]"
},
"APPCONFIGURATION_KEYVAULT_SECRET_URL": {
"type": "string",
"value": "[variables('azureKeyVaultSecretUrl')]"
}
}
}