Create a gist now

Instantly share code, notes, and snippets.

{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "LoremVault",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "CHANGETO-YOUR-USER-GUID-000000000000",
"permissions": {
"keys": [ "All" ],
"secrets": [ "All" ]
}
}
]
}
},
{
"type": "Microsoft.Storage/storageAccounts",
"kind": "Storage",
"name": "loremipsumstore",
"apiVersion": "2016-01-01",
"sku": {
"name": "Standard_LRS"
},
"location": "[resourceGroup().location]"
},
{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "LoremVault/SomeSecret",
"apiVersion": "2015-06-01",
"properties": {
"contentType": "text/plain",
"value": "ThisIpsemIsSecret"
},
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', 'LoremVault')]"
]
},
{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "LoremVault/SomeCertificate",
"apiVersion": "2015-06-01",
"properties": {
"contentType": "application/x-pkcs12",
"value": "MIIV0QIBAzCC...LoremIpsum...RIJcq3QACAggA"
},
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', 'LoremVault')]"
]
},
{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "LoremVault/ConnectionString",
"apiVersion": "2015-06-01",
"properties": {
"contentType": "text/plain",
"value": "[concat('DefaultEndpointsProtocol=https;AccountName=loremipsumstore;AccountKey=', listKeys(resourceId('Microsoft.Storage/storageAccounts', 'loremipsumstore'), providers('Microsoft.Storage', 'storageAccounts').apiVersions[0]).keys[0].value, ';')]"
},
"dependsOn": [
"[resourceId('Microsoft.KeyVault/vaults', 'LoremVault')]",
"[resourceId('Microsoft.Storage/storageAccounts', 'loremipsumstore')]"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment