Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
armin30
az group create --name armin30 --location 'eastus'
az ad user show --id Ravikanth@azure.com --query objectId
az deployment group create --resource-group armin30 --template-file akv.json --parameters objectId=<objectId-value>
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"objectId": {
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "[concat('amrin30kv-', uniqueString(resourceGroup().id))]",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[parameters('objectId')]",
"permissions": {
"keys": [ "All" ],
"secrets": [ "All" ],
"certificates" : [ "All" ]
}
}
]
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"objectId": {
"type": "String"
},
"keyPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"create",
"update",
"delete"
]
},
"secretPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"set",
"delete"
]
},
"certificatePermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"delete",
"create",
"update"
]
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "[concat('amrin30kv-', uniqueString(resourceGroup().id))]",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
"enabledForDeployment" : true,
"enabledForTemplateDeployment" : true,
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[parameters('objectId')]",
"permissions": {
"keys": "[parameters('keyPermissions')]",
"secrets": "[parameters('secretPermissions')]",
"certificates" : "[parameters('certificatePermissions')]"
}
}
]
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"objectId": {
"type": "String"
},
"secretName" : {
"type" : "String"
},
"secretValue" : {
"type" : "SecureString"
},
"keyPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"create",
"update",
"delete"
]
},
"secretPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"set",
"delete"
]
},
"certificatePermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"delete",
"create",
"update"
]
}
},
"variables": {
"keyVaultName" : "[concat('amrin30kv-', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults",
"name": "[variables('keyVaultName')]",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
"enabledForDeployment" : true,
"enabledForTemplateDeployment" : true,
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[parameters('objectId')]",
"permissions": {
"keys": "[parameters('keyPermissions')]",
"secrets": "[parameters('secretPermissions')]",
"certificates" : "[parameters('certificatePermissions')]"
}
}
]
}
},
{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "[concat(variables('keyVaultName'), '/', parameters('secretName'))]",
"apiVersion": "2018-02-14",
"location": "[resourceGroup().location]",
"properties": {
"value": "[parameters('secretValue')]",
"contentType" : "string"
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"objectId": {
"type": "String"
},
"secretName" : {
"type" : "String"
},
"secretValue" : {
"type" : "SecureString"
},
"keyPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"create",
"update",
"delete"
]
},
"secretPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"set",
"delete"
]
},
"certificatePermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"delete",
"create",
"update"
]
}
},
"variables": {
"keyVaultName" : "[concat('amrin30kv-', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "[concat(variables('keyVaultName'), '/', parameters('secretName'))]",
"apiVersion": "2018-02-14",
"location": "[resourceGroup().location]",
"properties": {
"value": "[parameters('secretValue')]",
"contentType" : "string"
},
"dependsOn" : [
"[resourceId('Microsoft.KeyVault/vaults', variables('keyVaultName'))]"
]
},
{
"type": "Microsoft.KeyVault/vaults",
"name": "[variables('keyVaultName')]",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
"enabledForDeployment" : true,
"enabledForTemplateDeployment" : true,
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[parameters('objectId')]",
"permissions": {
"keys": "[parameters('keyPermissions')]",
"secrets": "[parameters('secretPermissions')]",
"certificates" : "[parameters('certificatePermissions')]"
}
}
]
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"objectId": {
"type": "String"
},
"secretName" : {
"type" : "String"
},
"secretValue" : {
"type" : "SecureString"
},
"keyPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"create",
"update",
"delete"
]
},
"secretPermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"set",
"delete"
]
},
"certificatePermissions" : {
"type" : "array",
"defaultValue" : [
"get",
"list",
"delete",
"create",
"update"
]
}
},
"variables": {
"keyVaultName" : "[concat('amrin30kv-', uniqueString(resourceGroup().id))]"
},
"resources": [
{
"type": "Microsoft.KeyVault/vaults/secrets",
"name": "[concat(variables('keyVaultName'), '/', parameters('secretName'))]",
"apiVersion": "2018-02-14",
"location": "[resourceGroup().location]",
"properties": {
"value": "[parameters('secretValue')]",
"contentType" : "string"
}
},
{
"type": "Microsoft.KeyVault/vaults",
"name": "[variables('keyVaultName')]",
"apiVersion": "2015-06-01",
"location": "[resourceGroup().location]",
"properties": {
"enabledForDeployment" : true,
"enabledForTemplateDeployment" : true,
"sku": {
"family": "A",
"name": "Standard"
},
"tenantId": "[subscription().tenantId]",
"accessPolicies": [
{
"tenantId": "[subscription().tenantId]",
"objectId": "[parameters('objectId')]",
"permissions": {
"keys": "[parameters('keyPermissions')]",
"secrets": "[parameters('secretPermissions')]",
"certificates" : "[parameters('certificatePermissions')]"
}
}
]
}
}
],
"outputs": {}
}
"files.associations": {
"*.azrm.json": "arm-template"
}
az group create --name armin30days --location "West US"
az deployment group create \
--resource-group 'armin30days' \
--template-uri 'https://gist.githubusercontent.com/rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2/raw/67d049f63e4637942e91c8f3dbf3553519d57e87/d4RgScopedStorageVNetTemplateFinal.azrm.json' \
--parameters storageAccountName=armin30storage storageAccountSku=Standard_LRS storageAccountTier=Standard virtualNetworkName=armin30vnet virtualNetworkSubnetAddressPrefix='10.0.1.0/24' VirtualNetworkSubnetName='armin30subnet' virtualNetworkAddressPrefix='(["10.0.0.0/16"])'
az group create --name armin30days --location "West US"
az deployment group create \
--resource-group armin30days \
--template-uri 'https://gist.githubusercontent.com/rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2/raw/67d049f63e4637942e91c8f3dbf3553519d57e87/d4RgScopedStorageVNetTemplateFinal.azrm.json' \
--parameters @d4-paramJson.json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"value": "" // TODO: Fill in parameter value
},
"storageAccountTier": {
"value": "Standard"
},
"storageAccountSku": {
"value": "Standard_LRS"
},
"virtualNetworkName": {
"value": "" // TODO: Fill in parameter value
},
"virtualNetworkAddressPrefix": {
"value": [
// TODO: Fill in parameter value
]
},
"VirtualNetworkSubnetName": {
"value": "" // TODO: Fill in parameter value
},
"virtualNetworkSubnetAddressPrefix": {
"value": "" // TODO: Fill in parameter value
}
}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName" : {
"type" : "string",
"minLength" : 3,
"maxLength" : 24,
"metadata" : {
"description" : "Specify a name for the storage account. This needs to be unique."
}
},
"storageAccountTier": {
"type" : "string",
"allowedValues" : [
"Standard",
"Premium"
],
"defaultValue" : "Standard",
"metadata" : {
"description" : "Select a storage SKU tier"
}
},
"storageAccountSku": {
"type" : "string",
"allowedValues" : [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS",
"Premium_ZRS",
"Standard_GZRS",
"Standard_RAGZRS"
],
"defaultValue" : "Standard_LRS",
"metadata" : {
"description" : "Select one of the available SKU names"
}
},
"virtualNetworkName" : {
"type" : "string",
"metadata" : {
"description" : "Specify a name for the virtual network"
}
},
"virtualNetworkAddressPrefix" : {
"type" : "array",
"metadata" : {
"description" : "Specify the address space(s) for this virtual network"
}
},
"VirtualNetworkSubnetName" : {
"type" : "string",
"metadata" : {
"description" : "Specify a name for a subnet in this virtual network"
}
},
"virtualNetworkSubnetAddressPrefix" : {
"type" : "string",
"metadata" : {
"description" : "Specify the address space for the subnet in the virtual network"
}
}
},
"functions": [],
"variables": {},
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"tags": {
"displayName": "[parameters('storageAccountName')]"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountSku')]",
"tier": "[parameters('storageAccountTier')]"
}
},
{
"name": "[parameters('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-11-01",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[parameters('virtualNetworkName')]"
},
"properties": {
"addressSpace": {
"addressPrefixes": "[parameters('virtualNetworkAddressPrefix')]"
},
"subnets": [
{
"name": "[parameters('VirtualNetworkSubnetName')]",
"properties": {
"addressPrefix": "[parameters('virtualNetworkSubnetAddressPrefix')]"
}
}
]
}
}
],
"outputs": { }
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName" : {
"type" : "string",
"minLength" : 3,
"maxLength" : 24,
"metadata" : {
"description" : "Specify a name for the storage account. This needs to be unique."
}
},
"storageAccountTier": {
"type" : "string",
"allowedValues" : [
"Standard",
"Premium"
],
"defaultValue" : "Standard",
"metadata" : {
"description" : "Select a storage SKU tier"
}
},
"storageAccountSku": {
"type" : "string",
"allowedValues" : [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS",
"Premium_ZRS",
"Standard_GZRS",
"Standard_RAGZRS"
],
"defaultValue" : "Standard_LRS",
"metadata" : {
"description" : "Select one of the available SKU names"
}
},
"virtualNetworkName" : {
"type" : "string",
"metadata" : {
"description" : "Specify a name for the virtual network"
}
}
},
"variables": {
"virtualNetworkAddressPrefix" : "10.0.0.0/16",
"VirtualNetworkSubnetName" : "[concat(parameters('virtualNetworkName'), '-', 'Subnet')]",
"virtualNetworkSubnetAddressPrefix" : "10.0.1.0/24"
},
"functions": [],
"resources": [
{
"name": "[parameters('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"tags": {
"displayName": "[parameters('storageAccountName')]"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountSku')]",
"tier": "[parameters('storageAccountTier')]"
}
},
{
"name": "[parameters('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-11-01",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[parameters('virtualNetworkName')]"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('virtualNetworkAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('VirtualNetworkSubnetName')]",
"properties": {
"addressPrefix": "[variables('virtualNetworkSubnetAddressPrefix')]"
}
}
]
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountTier": {
"type" : "string",
"allowedValues" : [
"Standard",
"Premium"
],
"defaultValue" : "Standard",
"metadata" : {
"description" : "Select a storage SKU tier"
}
},
"storageAccountSku": {
"type" : "string",
"allowedValues" : [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS",
"Premium_ZRS",
"Standard_GZRS",
"Standard_RAGZRS"
],
"defaultValue" : "Standard_LRS",
"metadata" : {
"description" : "Select one of the available SKU names"
}
}
},
"variables": {
"storageAccountName" : "[armin30.uniqueResourceName('sacct')]",
"virtualNetworkName" : "[armin30.uniqueResourceName('vnet')]",
"virtualNetworkSubnetName" : "[armin30.uniqueResourceName('subnet')]",
"virtualNetworkAddressPrefix" : "10.0.0.0/16",
"virtualNetworkSubnetAddressPrefix" : "10.0.1.0/24"
},
"functions": [
{
"namespace": "armin30",
"members": {
"uniqueResourceName": {
"parameters": [
{
"name": "prefix",
"type": "string"
}
],
"output": {
"type": "string",
"value": "[concat(toLower(parameters('prefix')), uniqueString(resourceGroup().id))]"
}
}
}
}
],
"resources": [
{
"name": "[variables('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"tags": {
"displayName": "[variables('storageAccountName')]"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountSku')]",
"tier": "[parameters('storageAccountTier')]"
}
},
{
"name": "[variables('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-11-01",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[variables('virtualNetworkName')]"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('virtualNetworkAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('virtualNetworkSubnetName')]",
"properties": {
"addressPrefix": "[variables('virtualNetworkSubnetAddressPrefix')]"
}
}
]
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountTier": {
"type" : "string",
"allowedValues" : [
"Standard",
"Premium"
],
"defaultValue" : "Standard",
"metadata" : {
"description" : "Select a storage SKU tier"
}
},
"storageAccountSku": {
"type" : "string",
"allowedValues" : [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS",
"Premium_ZRS",
"Standard_GZRS",
"Standard_RAGZRS"
],
"defaultValue" : "Standard_LRS",
"metadata" : {
"description" : "Select one of the available SKU names"
}
}
},
"variables": {
"storageAccountName" : "[armin30.uniqueResourceName('sacct')]",
"virtualNetworkName" : "[armin30.uniqueResourceName('vnet')]",
"bastionPipName" : "[armin30.uniqueResourceName('bastionPIP')]",
"virtualNetworkAddressPrefix" : "10.0.0.0/16",
"VirtualNetworkSubnetName" : "[concat(variables('virtualNetworkName'), '-', 'Subnet')]",
"virtualNetworkSubnetAddressPrefix" : "10.0.0.0/24",
"bastionSubnetAddressPrefix" : "10.0.1.0/24",
"bastionSubnetName" : "AzureBastionSubnet",
"bastionHostName" : "[armin30.uniqueResourceName('bastionHost')]"
},
"functions": [
{
"namespace": "armin30",
"members": {
"uniqueResourceName": {
"parameters": [
{
"name": "prefix",
"type": "string"
}
],
"output": {
"type": "string",
"value": "[concat(toLower(parameters('prefix')), uniqueString(resourceGroup().id))]"
}
}
}
}
],
"resources": [
{
"name": "[variables('storageAccountName')]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"tags": {
"displayName": "[variables('storageAccountName')]"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountSku')]",
"tier": "[parameters('storageAccountTier')]"
}
},
{
"name": "[variables('virtualNetworkName')]",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-11-01",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "[variables('virtualNetworkName')]"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"[variables('virtualNetworkAddressPrefix')]"
]
},
"subnets": [
{
"name": "[variables('VirtualNetworkSubnetName')]",
"properties": {
"addressPrefix": "[variables('virtualNetworkSubnetAddressPrefix')]"
}
},
{
"name": "[variables('bastionSubnetName')]",
"properties": {
"addressPrefix": "[variables('bastionSubnetAddressPrefix')]"
}
}
]
}
},
{
"type": "Microsoft.Network/publicIpAddresses",
"apiVersion": "2019-02-01",
"name": "[variables('bastionPipName')]",
"location": "[resourceGroup().location]",
"sku": {
"name": "Standard"
},
"properties": {
"publicIPAllocationMethod": "Static"
}
},
{
"type": "Microsoft.Network/bastionHosts",
"apiVersion": "2019-04-01",
"name": "[variables('bastionHostName')]",
"location": "[resourceGroup().location]",
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', variables('virtualNetworkName'))]",
"[resourceId('Microsoft.Network/publicIpAddresses', variables('bastionPipName'))]"
],
"properties": {
"ipConfigurations": [
{
"name": "IpConf",
"properties": {
"subnet": {
"id": "[resourceId('Microsoft.Network/virtualNetworks/subnets', variables('virtualNetworkName'), variables('bastionSubnetName'))]"
},
"publicIPAddress": {
"id": "[resourceId('Microsoft.Network/publicIpAddresses', variables('bastionPipName'))]"
}
}
}
]
}
}
],
"outputs": {}
}
az deployment group create \
--resource-group 'armin30days' \
--template-uri 'https://gist.githubusercontent.com/rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2/raw/d8db3b2aec791d2c2bb27010b8a0702886947496/outputDemo.azrm.json' \
--parameters storageAccountName=ArmIn30StorageAccount
az deployment group create --resource-group armin30 \
--name firstTemplate \
--template-uri https://onlinresource.share/azuredeploy.json \
--parameters @myparameters.json
New-AzResourceGroupDeployment -ResourceGroupName 'armin30' `
-TemplateFile 'C:\Azure\Templates\azuredeploy.json' `
-TemplateParameterFile 'myParameters.json' `
-Tag @{'series'='armin30';'day'='1'}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string"
}
},
"resources": [],
"outputs": {
"lowercaseStorageAccountName": {
"type": "string",
"value": "[toLower(parameters('storageAccountName'))]"
}
}
}
"outputs": {
"<output-name>": {
"type": "<type-of-output-value>",
"value": "<output-value-expression>"
}
}
"parameters": {
"storageAccountName" : {
"type" : "string",
"minLength" : 3,
"maxLength" : 24,
"metadata" : {
"description" : "Specify a name for the storage account. This needs to be unique."
}
},
"storageAccountTier": {
"type" : "string",
"allowedValues" : [
"Standard",
"Premium"
],
"defaultValue" : "Standard",
"metadata" : {
"description" : "Select a storage SKU tier"
}
},
"storageAccountSku": {
"type" : "string",
"allowedValues" : [
"Standard_LRS",
"Standard_GRS",
"Standard_RAGRS",
"Standard_ZRS",
"Premium_LRS",
"Premium_ZRS",
"Standard_GZRS",
"Standard_RAGZRS"
],
"defaultValue" : "Standard_LRS",
"metadata" : {
"description" : "Select one of the available SKU names"
}
},
"virtualNetworkName" : {
"type" : "string",
"metadata" : {
"description" : "Specify a name for the virtual network"
}
},
"virtualNetworkAddressPrefix" : {
"type" : "array",
"metadata" : {
"description" : "Specify the address space(s) for this virtual network"
}
},
"VirtualNetworkSubnetName" : {
"type" : "string",
"metadata" : {
"description" : "Specify a name for a subnet in this virtual network"
}
},
"virtualNetworkSubnetAddressPrefix" : {
"type" : "string",
"metadata" : {
"description" : "Specify the address space for the subnet in the virtual network"
}
}
}
"parameters": {
"<parameter-name>" : {
"type" : "<type-of-parameter-value>",
"defaultValue": "<default-value-of-parameter>",
"allowedValues": [ "<array-of-allowed-values>" ],
"minValue": <minimum-value-for-int>,
"maxValue": <maximum-value-for-int>,
"minLength": <minimum-length-for-string-or-array>,
"maxLength": <maximum-length-for-string-or-array-parameters>,
"metadata": {
"description": "<description-of-the parameter>"
}
}
}
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2020-06-01",
"name": "armin30days",
"location": "westus",
"properties": {}
}
],
"outputs": {}
}
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2020-06-01",
"name": "armin30days",
"location": "westus",
"properties": {}
}
az deployment sub create \
--name armin30rg \
--location westus \
--template-uri "https://gist.githubusercontent.com/rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2/raw/b184d22bd78fac8da0bb63dc0fb955c1bc593b60/resourceGroup.azrm.json"
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [
{
"name": "storageaccount1",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"tags": {
"displayName": "storageaccount1"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "Premium_LRS",
"tier": "Premium"
}
},
{
"name": "virtualNetwork1",
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2019-11-01",
"location": "[resourceGroup().location]",
"tags": {
"displayName": "virtualNetwork1"
},
"properties": {
"addressSpace": {
"addressPrefixes": [
"10.0.0.0/16"
]
},
"subnets": [
{
"name": "Subnet-1",
"properties": {
"addressPrefix": "10.0.0.0/24"
}
},
{
"name": "Subnet-2",
"properties": {
"addressPrefix": "10.0.1.0/24"
}
}
]
}
}
],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"functions": [],
"variables": {},
"resources": [],
"outputs": {}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"locations": {
"type": "array",
"defaultValue": ["eastus","westus","westus2"]
}
},
"resources": [
],
"outputs": {
"arrayTrue": {
"type": "bool",
"value": "[contains(parameters('locations'), 'eastus')]"
},
"arrayFalse": {
"type": "bool",
"value": "[contains(parameters('locations'), 'southindia')]"
}
}
}
{
"name": "[toLower(parameters('storageAccountName'))]",
"type": "Microsoft.Storage/storageAccounts",
"apiVersion": "2019-06-01",
"tags": {
"displayName": "[toLower(parameters('storageAccountName'))]"
},
"location": "[resourceGroup().location]",
"kind": "StorageV2",
"sku": {
"name": "[parameters('storageAccountSku')]",
"tier": "[parameters('storageAccountTier')]"
}
}
"functions": [
{
"namespace": "<namespace-name>",
"members": {
"<function-name>": {
"parameters": [
{
"name": "<parameter-name>",
"type": "<parameter-type>"
}
],
"output": {
"type": "<output-type>",
"value": "<expression>"
}
}
}
}
],
"functions": [
{
"namespace": "armin30",
"members": {
"uniqueResourceName": {
"parameters": [
{
"name": "prefix",
"type": "string"
}
],
"output": {
"type": "string",
"value": "[toLower(concat(parameters('prefix'), '-', uniqueString(resourceGroup().id)))]"
}
}
}
}
]
"variables": {
"virtualNetworkAddressPrefix" : "10.0.0.0/16",
"VirtualNetworkSubnetName" : "concat([parameters('virtualNetworkName'), '-', 'subnet']",
"virtualNetworkSubnetAddressPrefix" : "10.0.1.0/24"
}
"variables": {
"<variable-name>": "<variable-value>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment