Last active
October 21, 2022 04:49
-
-
Save rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2 to your computer and use it in GitHub Desktop.
armin30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az group create --name armin30 --location 'eastus' | |
az ad user show --id [email protected] --query objectId | |
az deployment group create --resource-group armin30 --template-file akv.json --parameters objectId=<objectId-value> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"files.associations": { | |
"*.azrm.json": "arm-template" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"])' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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 | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": { } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az deployment group create \ | |
--resource-group 'armin30days' \ | |
--template-uri 'https://gist.githubusercontent.com/rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2/raw/d8db3b2aec791d2c2bb27010b8a0702886947496/outputDemo.azrm.json' \ | |
--parameters storageAccountName=ArmIn30StorageAccount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az deployment group create --resource-group armin30 \ | |
--name firstTemplate \ | |
--template-uri https://onlinresource.share/azuredeploy.json \ | |
--parameters @myparameters.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
New-AzResourceGroupDeployment -ResourceGroupName 'armin30' ` | |
-TemplateFile 'C:\Azure\Templates\azuredeploy.json' ` | |
-TemplateParameterFile 'myParameters.json' ` | |
-Tag @{'series'='armin30';'day'='1'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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'))]" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"outputs": { | |
"<output-name>": { | |
"type": "<type-of-output-value>", | |
"value": "<output-value-expression>" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"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>" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "Microsoft.Resources/resourceGroups", | |
"apiVersion": "2020-06-01", | |
"name": "armin30days", | |
"location": "westus", | |
"properties": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
az deployment sub create \ | |
--name armin30rg \ | |
--location westus \ | |
--template-uri "https://gist.githubusercontent.com/rchaganti/d7e35878c6687da07ae5fa5dfb7d54c2/raw/b184d22bd78fac8da0bb63dc0fb955c1bc593b60/resourceGroup.azrm.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": {}, | |
"functions": [], | |
"variables": {}, | |
"resources": [], | |
"outputs": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#", | |
"contentVersion": "1.0.0.0", | |
"parameters": {}, | |
"functions": [], | |
"variables": {}, | |
"resources": [], | |
"outputs": {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$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')]" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"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')]" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"functions": [ | |
{ | |
"namespace": "<namespace-name>", | |
"members": { | |
"<function-name>": { | |
"parameters": [ | |
{ | |
"name": "<parameter-name>", | |
"type": "<parameter-type>" | |
} | |
], | |
"output": { | |
"type": "<output-type>", | |
"value": "<expression>" | |
} | |
} | |
} | |
} | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"functions": [ | |
{ | |
"namespace": "armin30", | |
"members": { | |
"uniqueResourceName": { | |
"parameters": [ | |
{ | |
"name": "prefix", | |
"type": "string" | |
} | |
], | |
"output": { | |
"type": "string", | |
"value": "[toLower(concat(parameters('prefix'), '-', uniqueString(resourceGroup().id)))]" | |
} | |
} | |
} | |
} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"variables": { | |
"virtualNetworkAddressPrefix" : "10.0.0.0/16", | |
"VirtualNetworkSubnetName" : "concat([parameters('virtualNetworkName'), '-', 'subnet']", | |
"virtualNetworkSubnetAddressPrefix" : "10.0.1.0/24" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"variables": { | |
"<variable-name>": "<variable-value>" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment