File size: 2,352 Bytes
065fee7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
{
  "$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."
      }
    },
    "location": {
      "type": "string",
      "defaultValue": "[resourceGroup().location]",
      "metadata": {
        "description": "The location of the resource. By default, this is the same as the resource group."
      }
    },
    "containerRegistryEndpointSuffix": {
      "defaultValue": ".azurecr.io",
      "type": "string"
    }
  },
  "variables": {
    "apiVersion": "2020-11-01-preview",
    "endpointValue": "[format('https://{0}{1}', parameters('baseName'), parameters('containerRegistryEndpointSuffix'))]",
    "anonRegistryName": "[format('{0}anon', parameters('baseName'))]",
    "anonEndpointValue": "[format('https://{0}{1}', variables('anonRegistryName'), parameters('containerRegistryEndpointSuffix'))]"
  },
  "resources": [
    {
      "type": "Microsoft.ContainerRegistry/registries",
      "apiVersion": "[variables('apiVersion')]",
      "name": "[parameters('baseName')]",
      "location": "[parameters('location')]",
      "properties": {
        "endpoint": "[variables('endpointValue')]",
      },
      "sku": {
        "name": "Basic",
        "tier": "Basic"
      }
    },
	{
      "type": "Microsoft.ContainerRegistry/registries",
      "apiVersion": "[variables('apiVersion')]",
      "name": "[variables('anonRegistryName')]",
      "location": "[parameters('location')]",
      "properties": {
        "endpoint": "[variables('anonEndpointValue')]",
        "anonymousPullEnabled": true
      },
      "sku": {
        "name": "Standard",
        "tier": "Standard"
      }
    }
  ],
  "outputs": {
    "CONTAINERREGISTRY_REGISTRY_NAME": {
      "type": "string",
      "value": "[parameters('baseName')]"
    },
    "CONTAINERREGISTRY_ENDPOINT": {
      "type": "string",
      "value": "[variables('endpointValue')]"
    },
    "CONTAINERREGISTRY_ANONREGISTRY_NAME": {
      "type": "string",
      "value": "[variables('anonRegistryName')]"
    },
    "CONTAINERREGISTRY_ANONREGISTRY_ENDPOINT": {
      "type": "string",
      "value": "[variables('anonEndpointValue')]"
    },
  }
}