Skip to content

Instantly share code, notes, and snippets.

View krnese's full-sized avatar
💭
Living the dream

Kristian Nese krnese

💭
Living the dream
View GitHub Profile
{
"condition": "[equals(parameters('platform'), 'Windows')]",
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2016-03-30",
"name": "[concat(parameters('vmNameSuffix'), 'VM', copyIndex(), '/OMS')]",
"location": "[resourceGroup().location]",
"copy": {
"name": "[concat(parameters('vmNameSuffix'), 'VM', 'OMS')]",
"count": "[parameters('instanceCount')]"
},
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"instanceCount": {
"type": "int",
"defaultValue": "2",
"maxValue": 10,
"metadata": {
"description": "Specify the number of VMs to create"
@krnese
krnese / vmCondition
Last active December 8, 2021 04:54
This ARM template shows how to use conditions and logical/comparison functions to dynamically create windows/linux for prod/non-prod
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmNamePrefix": {
"type": "string",
"defaultValue": "VM",
"metadata": {
"description": "Assing a prefix for the VM you will create."
}
@krnese
krnese / automation - reference() and listKeys() support
Created September 8, 2017 17:51
Azure Automation - reference() and listKeys() example
{
"$schema": "http://schemas.microsoft.org/azure/deploymentTemplate?api-version=2015-01-01-preview#",
"contentVersion": "1.0",
"parameters": {
"accountName": {
"type": "string",
"metadata": {
"description": "The name of the Azure Automation account to deploy to."
}
}
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"apiVersion": "2017-03-30",
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), copyIndex(), '/OMS')]",
"location": "[resourceGroup().location]",
"copy": {
"name": "[concat(parameters('vmNamePrefix'), parameters('platform'), 'OMS')]",
"count": "[parameters('instanceCount')]"
},
"dependsOn": [
@krnese
krnese / gist:05a9b8945ca2d2091ee166f27d5d2f49
Created November 1, 2017 14:00
managed disk condition
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"vmNamePrefix": {
"type": "string",
"defaultValue": "VM",
"metadata": {
"description": "Assing a prefix for the VM you will create."
}
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"foo": {
"type": "object",
"defaultValue": {
"vnetName": 0,
"vnetAddressPrefix": "10.1.0.0/20",
"dnsServers": [
{
"$schema": "http://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"actionGroupId": {
"defaultValue": "/subscriptions/4b7561c1-24a7-468f-8b80-bf79cc29d48b/resourceGroups/m2-oms-europe/providers/Microsoft.Insights/actionGroups/defaultGroup",
"type": "string",
"metadata": {
"description": "Action group resource Id"
}
{
"properties": {
"policyType": "Custom",
"mode": "All",
"parameters": {
"logAnalyticsEurope": {
"type": "string",
"metadata": {
"displayName": "Log Analyitcs workspace in Europe",
"description": "Select the Log Analytics workspace from dropdown list",
@krnese
krnese / ARM template
Created September 16, 2019 19:08
E2E MSP offering with alerts as ARM template
{
"$schema": "https://schema.management.azure.com/schemas/2018-05-01/subscriptionDeploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"mspName": {
"type": "string",
"metadata": {
"description": "Specify the Managed Service Provider name"
}
},