Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
99 lines (93 sloc) 2.83 KB
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"acrName": {
"type": "string",
"minLength": 5,
"maxLength": 50,
"metadata": {
"description": "Name of your Azure Container Registry"
}
},
"acrAdminUserEnabled": {
"type": "bool",
"defaultValue": true,
"metadata": {
"description": "Enable admin user that have push / pull permission to the registry."
}
},
"acrStorageType": {
"type": "string",
"defaultValue": "Standard_LRS",
"allowedValues": [
"Standard_LRS",
"Standard_ZRS",
"Standard_GRS"
],
"metadata": {
"description": "Type of the storage account that will store container registry datas."
}
}
},
"variables": {
"acrStorageName": "[concat('acr', uniqueString(resourceGroup().id))]",
"acrStorageId": "[resourceId('Microsoft.Storage/storageAccounts', variables('acrStorageName'))]"
},
"resources": [
{
"name": "[variables('acrStorageName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2016-01-01",
"location": "[resourceGroup().location]",
"comments": "This storage account is used by Container Registry for storing its datas.",
"dependsOn": [],
"tags": {
"displayName": "ACR Image's storage",
"container.registry": "[parameters('acrName')]"
},
"kind": "Storage",
"sku": {
"name": "[parameters('acrStorageType')]"
}
},
{
"name": "[parameters('acrName')]",
"type": "Microsoft.ContainerRegistry/registries",
"apiVersion": "2017-03-01",
"location": "[resourceGroup().location]",
"comments": "Container registry for storing docker images",
"dependsOn": [
"[variables('acrStorageId')]"
],
"tags": {
"displayName": "Container Registry",
"container.registry": "[parameters('acrName')]"
},
"sku": {
"name": "Basic"
},
"properties": {
"adminUserEnabled": "[parameters('acrAdminUserEnabled')]",
"storageAccount": {
"accessKey": "[listKeys(variables('acrStorageId'),'2015-06-15').key1]",
"name": "[variables('acrStorageName')]"
}
}
}
],
"outputs": {
"registryServer": {
"value": "[reference(resourceId('Microsoft.ContainerRegistry/registries',parameters('acrName'))).loginServer]",
"type": "string"
},
"registryUsername": {
"value": "[parameters('acrName')]",
"type": "string"
},
"registryPassword": {
"value": "[listCredentials(resourceId('Microsoft.ContainerRegistry/registries',parameters('acrName')),'2017-03-01').passwords[0].value]",
"type": "string"
}
}
}