Description
stringlengths
19
200
IaC
stringlengths
159
7.6k
This template creates a file dataset from relative path in datastore in Azure Machine Learning workspace.
{"type": "microsoft.machinelearningservices/workspaces/datasets", "name": "[concat(parameters('workspacename'), "/", parameters('datasetname'))]", "apiversion": "2020-05-01-preview", "location": "[parameters('location')]", "properties": {"skipvalidation": "[parameters('skipvalidation')]", "datasettype": "file", "parameters": {"path": {"datapath": {"relativepath": "[parameters('relativepath')]", "datastorename": "[parameters('datastorename')]"}}}, "registration": {"description": "[parameters('datasetdescription')]", "tags": "[parameters('tags')]"}}}
This template creates an Azure Machine Learning compute cluster.
{"type": "microsoft.machinelearningservices/workspaces/computes", "name": "[concat(parameters('workspacename'), "/", parameters('clustername'))]", "apiversion": "2021-01-01", "location": "[parameters('location')]", "properties": {"computetype": "amlcompute", "properties": {"vmsize": "[parameters('vmsize')]", "scalesettings": {"minnodecount": "[parameters('minnodecount')]", "maxnodecount": "[parameters('maxnodecount')]"}, "useraccountcredentials": {"adminusername": "[parameters('adminusername')]", "adminuserpassword": "[parameters('adminuserpassword')]"}, "subnet": "[if(and(not(empty(parameters('vnetresourcegroupname'))),not(empty(parameters('vnetname'))),not(empty(parameters('subnetname')))), variables('subnet'), json('null'))]"}}}
This template creates a tabular dataset from relative path in datastore in Azure Machine Learning workspace.
{"type": "microsoft.machinelearningservices/workspaces/datasets", "name": "[concat(parameters('workspacename'), "/", parameters('datasetname'))]", "apiversion": "2020-05-01-preview", "location": "[parameters('location')]", "properties": {"skipvalidation": "[parameters('skipvalidation')]", "datasettype": "tabular", "parameters": {"header": "[parameters('header')]", "includepath": "[parameters('includepath')]", "partitionformat": "[parameters('partitionformat')]", "path": {"datapath": {"relativepath": "[parameters('relativepath')]", "datastorename": "[parameters('datastorename')]"}}, "separator": "[parameters('separator')]", "sourcetype": "[parameters('sourcetype')]"}, "registration": {"description": "[parameters('datasetdescription')]", "tags": "[parameters('tags')]"}, "timeseries": {"finegraintimestamp": "[parameters('finegraintimestamp')]", "coarsegraintimestamp": "[parameters('coarsegraintimestamp')]"}}}
This template creates a blob storage datastore in Azure Machine Learning workspace.
{"type": "microsoft.machinelearningservices/workspaces/datastores", "name": "[concat(parameters('workspacename'), "/", parameters('datastorename'))]", "apiversion": "2020-05-01-preview", "location": "[parameters('location')]", "properties": {"datastoretype": "blob", "skipvalidation": "[parameters('skipvalidation')]", "accountname": "[parameters('storageaccountname')]", "containername": "[parameters('containername')]", "accountkey": "[if(equals(parameters('authenticationtype'), "account key'), parameters('sastokenoraccountkey'), json('null'))]", "sastoken": "[if(equals(parameters('authenticationtype'), "sas token'), parameters('sastokenoraccountkey'), json('null'))]", "storageaccountsubscriptionid": "[parameters('storageaccountsubscriptionid')]", "storageaccountresourcegroup": "[parameters('storageaccountresourcegroup')]"}}
Creating a Azure SignalR Service using a template.
{"type": "microsoft.signalrservice/signalr", "apiversion": "2020-07-01-preview", "name": "[parameters('name')]", "location": "[parameters('location')]", "sku": {"capacity": "[parameters('capacity')]", "name": "[parameters('pricingtier')]"}, "kind": "signalr", "identity": {"type": "systemassigned"}, "properties": {"tls": {"clientcertenabled": false}, "features": [{"flag": "servicemode", "value": "[parameters('servicemode')]"}, {"flag": "enableconnectivitylogs", "value": "[parameters('enableconnectivitylogs')]"}, {"flag": "enablemessaginglogs", "value": "[parameters('enablemessaginglogs')]"}, {"flag": "enablelivetrace", "value": "[parameters('enablelivetrace')]"}], "cors": {"allowedorigins": "[parameters('allowedorigins')]"}, "networkacls": {"defaultaction": "deny", "publicnetwork": {"allow": ["clientconnection"]}, "privateendpoints": [{"name": "mysignalrservice.1fa229cd-bf3f-47f0-8c49-afb36723997e", "allow": ["serverconnection"]}]}, "upstream": {"templates": [{"categorypattern": "*", "eventpattern": "connect,disconnect", "hubpattern": "*", "urltemplate": "https://example.com/chat/api/connect"}]}}}
This template creates an IOT Hub and Virtual Machine Ubuntu edge simulator, using Azure IoT Edge.
{"type": "microsoft.devices/iothubs", "apiversion": "2020-03-01", "name": "[parameters('iothubname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skuunits')]"}, "properties": {}}{"type": "microsoft.devices/provisioningservices", "apiversion": "2020-01-01", "name": "[parameters('provisioningservicename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skuunits')]"}, "dependson": ["[parameters('iothubname')]"], "properties": {"iothubs": [{"connectionstring": "[concat('hostname=https://", parameters('iothubname'), parameters('iothubdomain'), ";sharedaccesskeyname=", variables('iothubkeyname'), ";sharedaccesskey=", listkeys(resourceid('microsoft.devices/iothubs/iothubkeys", parameters('iothubname'), variables('iothubkeyname')), "2020-03-01').primarykey)]", "location": "[parameters('location')]", "name": "[concat('https://", parameters('iothubname'), parameters('iothubdomain'))]"}]}}
This template creates an IoT Hub and a storage account and shows automatic routing.
{"type": "microsoft.devices/iothubs", "apiversion": "2021-03-31", "name": "[variables('iothubname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"], "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skuunits')]"}, "properties": {"eventhubendpoints": {"events": {"retentiontimeindays": 1, "partitioncount": "[parameters('d2cpartitions')]"}}, "routing": {"endpoints": {"storagecontainers": [{"connectionstring": "[concat('defaultendpointsprotocol=https;accountname=",variables('storageaccountname'),";endpointsuffix=",environment().suffixes.storage,";accountkey=",listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2021-02-01').keys[0].value)]", "containername": "[variables('storagecontainername')]", "filenameformat": "{iothub}/{partition}/{yyyy}/{mm}/{dd}/{hh}/{mm}", "batchfrequencyinseconds": 100, "maxchunksizeinbytes": 104857600, "encoding": "json", "name": "[variables('storageendpoint')]"}]}, "routes": [{"name": "contosostorageroute", "source": "devicemessages", "condition": "level="storage"", "endpointnames": ["[variables('storageendpoint')]"], "isenabled": true}], "fallbackroute": {"name": "$fallback", "source": "devicemessages", "condition": "true", "endpointnames": ["events"], "isenabled": true}}, "messagingendpoints": {"filenotifications": {"lockdurationasiso8601": "pt1m", "ttlasiso8601": "pt1h", "maxdeliverycount": 10}}, "enablefileuploadnotifications": false, "cloudtodevice": {"maxdeliverycount": 10, "defaultttlasiso8601": "pt1h", "feedback": {"lockdurationasiso8601": "pt1m", "ttlasiso8601": "pt1h", "maxdeliverycount": 10}}}}
Deploy an App Service that supports Python. It gives you the support to deploy your own Flask app.
{"apiversion": "2020-06-01", "name": "[parameters('webappname')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]"], "properties": {"name": "[parameters('webappname')]", "siteconfig": {"linuxfxversion": "[variables('linuxfxversion')]", "alwayson": "[variables('alwayson')]"}, "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "clientaffinityenabled": false}}{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "kind": "linux", "properties": {"name": "[variables('hostingplanname')]", "workersize": "[variables('workersize')]", "workersizeid": "[variables('workersizeid')]", "numberofworkers": "[variables('numberofworkers')]", "reserved": true}, "sku": {"tier": "[variables('sku')]", "name": "[variables('skucode')]"}}
This template provides a easy way to deploy a puckel/docker-airflow image (latest tag) on a Linux Web App with Azure database for PostgreSQL.
{"comments": "this is the airflow linux web app running puckel/docker-airflow docker image", "type": "microsoft.web/sites", "name": "[parameters('sitename')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('hostingplanname')]", "[variables('databasename')]"], "properties": {"siteconfig": {"linuxfxversion": "docker|puckel/docker-airflow:latest"}, "name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"name": "appsettings", "type": "config", "apiversion": "2020-06-01", "dependson": ["[resourceid('microsoft.web/sites", parameters('sitename'))]"], "tags": {"displayname": "airflowappsettings"}, "comments": "this are the generated settings for the airflow sql alchemy connectionstring", "properties": {"airflow__core__sql_alchemy_conn": "[concat('postgresql://", variables('airflowusername'),":",parameters('administratorloginpassword'),"@",reference(resourceid('microsoft.dbforpostgresql/servers",variables('servername'))).fullyqualifieddomainname,":5432/",variables('databasename'))]", "airflow__core__load_examples": "true", "websites_enable_app_service_storage": "true"}}]}{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]", "workersizeid": "1", "reserved": true, "numberofworkers": "1"}, "sku": {"tier": "[parameters('serviceplantier')]", "name": "[parameters('serviceplansku')]"}, "kind": "linux"}
This template Creates an Azure App Service Environment inside A Virtual Network Subnet. This template also adds a Azure Web App inside the App Service Environment.
{"apiversion": "2019-08-01", "type": "microsoft.web/hostingenvironments", "name": "[variables('ase-name')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('ase-vnet-name'))]"], "tags": {"[concat('hidden-related:", resourceid('microsoft.web/serverfarms", variables('ase-service-name')))]": "resource", "[concat('hidden-related:", resourceid('microsoft.web/sites", variables('ase-web-app-name')))]": "resource", "displayname": "ase"}, "properties": {"name": "[variables('ase-name')]", "location": "[parameters('location')]", "ipssladdresscount": "[parameters('ase-ipssladdresscount')]", "virtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('ase-vnet-name'), variables('ase-vnetsubnet1name'))]"}, "multisize": "[parameters('ase-frontendsize')]", "multirolecount": "[parameters('ase-frontendcount')]", "workerpools": [{"workersizeid": 0, "workersize": "[parameters('ase-workerpooloneinstancesize')]", "workercount": "[parameters('ase-workerpooloneinstancecount')]"}, {"workersizeid": 1, "workersize": "[parameters('ase-workerpooltwoinstancesize')]", "workercount": "[parameters('ase-workerpooltwoinstancecount')]"}, {"workersizeid": 2, "workersize": "[parameters('ase-workerpoolthreeinstancesize')]", "workercount": "[parameters('ase-workerpoolthreeinstancecount')]"}]}}{"name": "[variables('ase-service-name')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "apiversion": "2019-08-01", "dependson": ["[resourceid('microsoft.web/hostingenvironments", variables('ase-name'))]"], "tags": {"displayname": "ase-app-service-app"}, "properties": {"name": "[variables('ase-service-name')]", "hostingenvironment": "[variables('ase-name')]", "hostingenvironmentid": "[resourceid('microsoft.web/hostingenvironments", variables('ase-name'))]"}, "sku": {"name": "[concat('p", parameters('ase-app-service-workerpool'))]", "tier": "premium", "size": "[concat('p", parameters('ase-app-service-workerpool'))]", "family": "p", "capacity": "[parameters('ase-app-service-numberofworkersfromworkerpool')]"}}{"name": "[variables('ase-web-app-name')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "apiversion": "2019-08-01", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('ase-service-name'))]"], "tags": {"[concat('hidden-related:", resourceid('microsoft.web/serverfarms", variables('ase-service-name')))]": "resource", "displayname": "ase-web-app"}, "properties": {"name": "[variables('ase-web-app-name')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('ase-service-name'))]", "hostingenvironment": "[variables('ase-name')]", "hostingenvironmentid": "[resourceid('microsoft.web/hostingenvironments", variables('ase-name'))]"}}
Install a Public Certificate in App Service
{"apiversion": "2020-10-01", "name": "[concat(parameters('exisitngwebappname'), "/", variables('publiccertificatename'))]", "type": "microsoft.web/sites/publiccertificates", "location": "[parameters('location')]", "properties": {"publiccertificatelocation": "[parameters('publiccertificatelocation')]", "blob": "[parameters('blob')]"}}
Provision a function app on a dedicated hosting plan
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]"}, "properties": {"name": "[variables('hostingplanname')]", "workersize": "[parameters('workersize')]", "numberofworkers": 1}}{"apiversion": "2020-06-01", "type": "microsoft.web/sites", "name": "[variables('functionappname')]", "location": "[parameters('location')]", "kind": "functionapp", "properties": {"name": "[variables('functionappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "clientaffinityenabled": false, "siteconfig": {"alwayson": true}}, "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"], "resources": [{"apiversion": "2018-11-01", "name": "appsettings", "type": "config", "dependson": ["[resourceid('microsoft.web/sites", variables('functionappname'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"], "properties": {"azurewebjobsstorage": "[concat('defaultendpointsprotocol=https;accountname=", variables('storageaccountname'), ";endpointsuffix=", environment().suffixes.storage, ";accountkey=",listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2019-06-01').keys[0].value)]", "appinsights_instrumentationkey": "[reference(resourceid('microsoft.insights/components", variables('applicationinsightsname')), "2020-02-02-preview').instrumentationkey]", "functions_extension_version": "~3"}}]}
Create a Container App Environment with a basic Container App. It also deploys a Log Analytics Workspace to store logs.
{"type": "microsoft.web/kubeenvironments", "apiversion": "2021-02-01", "name": "[parameters('containerappenvname')]", "location": "[parameters('location')]", "kind": "containerenvironment", "properties": {"type": "managed", "internalloadbalancerenabled": false, "applogsconfiguration": {"destination": "log-analytics", "loganalyticsconfiguration": {"customerid": "[reference(resourceid('microsoft.operationalinsights/workspaces", parameters('containerapploganalyticsname'))).customerid]", "sharedkey": "[listkeys(resourceid('microsoft.operationalinsights/workspaces", parameters('containerapploganalyticsname')), "2020-10-01').primarysharedkey]"}}}, "dependson": ["[resourceid('microsoft.operationalinsights/workspaces", parameters('containerapploganalyticsname'))]"]}{"type": "microsoft.web/containerapps", "apiversion": "2021-03-01", "name": "[parameters('containerappname')]", "location": "[parameters('location')]", "properties": {"kubeenvironmentid": "[resourceid('microsoft.web/kubeenvironments", parameters('containerappenvname'))]", "configuration": {"ingress": {"external": true, "targetport": "[parameters('targetport')]", "allowinsecure": false, "traffic": [{"latestrevision": true, "weight": 100}]}}, "template": {"revisionsuffix": "firstrevision", "containers": [{"name": "[parameters('containerappname')]", "image": "[parameters('containerimage')]", "resources": {"cpu": "[parameters('cpucore')]", "memory": "[format('{0}gi", parameters('memorysize'))]"}}], "scale": {"minreplica": "[parameters('minreplica')]", "maxreplica": "[parameters('maxreplica')]"}}}, "dependson": ["[resourceid('microsoft.web/kubeenvironments", parameters('containerappenvname'))]"]}
Deploy two web apps and connect it securely with Private Endpoint and VNet injection
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[parameters('serverfarmname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "tier": "[variables('sku_tier')]", "size": "[parameters('skusize')]", "family": "[parameters('skufamily')]", "capacity": 1}, "kind": "app"}{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('site1_name')]", "location": "[parameters('location')]", "kind": "app", "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('serverfarmname'))]"}, "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('serverfarmname'))]"]}{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('site2_name')]", "location": "[parameters('location')]", "kind": "app", "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('serverfarmname'))]"}, "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('serverfarmname'))]"]}{"type": "microsoft.web/sites/config", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('site2_name'), "appsettings')]", "properties": {"website_dns_server": "168.63.129.16", "website_vnet_route_all": "1"}, "dependson": ["[resourceid('microsoft.web/sites", parameters('site2_name'))]"]}{"type": "microsoft.web/sites/config", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('site1_name'), "web')]", "properties": {"ftpsstate": "allallowed"}, "dependson": ["[resourceid('microsoft.web/sites", parameters('site1_name'))]"]}{"type": "microsoft.web/sites/config", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('site2_name'), "web')]", "properties": {"ftpsstate": "allallowed"}, "dependson": ["[resourceid('microsoft.web/sites", parameters('site2_name'))]"]}{"type": "microsoft.web/sites/hostnamebindings", "apiversion": "2019-08-01", "name": "[format('{0}/{1}", parameters('site1_name'), format('{0}{1}", parameters('site1_name'), variables('webapp_dns_name')))]", "properties": {"sitename": "[parameters('site1_name')]", "hostnametype": "verified"}, "dependson": ["[resourceid('microsoft.web/sites", parameters('site1_name'))]"]}{"type": "microsoft.web/sites/hostnamebindings", "apiversion": "2019-08-01", "name": "[format('{0}/{1}", parameters('site2_name'), format('{0}{1}", parameters('site2_name'), variables('webapp_dns_name')))]", "properties": {"sitename": "[parameters('site2_name')]", "hostnametype": "verified"}, "dependson": ["[resourceid('microsoft.web/sites", parameters('site2_name'))]"]}{"type": "microsoft.web/sites/networkconfig", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('site2_name'), "virtualnetwork')]", "properties": {"subnetresourceid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnet2name'))]"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.web/sites", parameters('site2_name'))]"]}
This template provides a easy way to deploy Web App on Linux with Azure database for PostgreSQL
{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]", "workersize": "1", "numberofworkers": 0}, "sku": {"tier": "standard", "name": "s1"}}{"apiversion": "2018-11-01", "name": "[parameters('sitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"], "properties": {"name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"apiversion": "2018-11-01", "name": "connectionstrings", "type": "config", "dependson": ["[resourceid('microsoft.web/sites", parameters('sitename'))]"], "properties": {"defaultconnection": {"value": "[concat('database=", variables('databasename'), ";server=", reference(resourceid('microsoft.dbforpostgresql/servers",variables('servername'))).fullyqualifieddomainname, ";user id=", parameters('administratorlogin'),"@", variables('servername'),";password=", parameters('administratorloginpassword'))]", "type": "postgresql"}}}]}
App Service Environment v2 - ILB with Hosting Plan and Azure WebApp
{"type": "microsoft.web/hostingenvironments", "apiversion": "2020-12-01", "name": "[parameters('asename')]", "kind": "asev2", "location": "[parameters('location')]", "tags": {"displayname": "ase environment", "usage": "hosting paas applications", "category": "environment", "owner": "[parameters('owner')]"}, "properties": {"ipssladdresscount": 0, "internalloadbalancingmode": "[parameters('internalloadbalancingmode')]", "dnssuffix": "[parameters('dnssuffix')]", "virtualnetwork": {"id": "[extensionresourceid(format('/subscriptions/{0}/resourcegroups/{1}", subscription().subscriptionid, parameters('vnetresourcegroupname')), "microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]"}}}{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[parameters('appserviceplanname')]", "location": "[parameters('location')]", "tags": {"displayname": "ase hosting plan", "usage": "hosting plan within ase", "category": "hosting", "owner": "[parameters('owner')]"}, "properties": {"hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments", parameters('asename'))]"}}, "sku": {"name": "[format('i{0}", parameters('workerpool'))]", "tier": "isolated", "size": "[format('i{0}", parameters('workerpool'))]", "family": "i", "capacity": "[parameters('numberofworkers')]"}, "dependson": ["[resourceid('microsoft.web/hostingenvironments", parameters('asename'))]"]}{"type": "microsoft.web/sites", "apiversion": "2020-12-01", "name": "[parameters('sitename')]", "location": "[parameters('location')]", "tags": {"displayname": "ase web app", "usage": "web app hosted within ase", "category": "web app", "owner": "[parameters('owner')]"}, "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('appserviceplanname'))]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments", parameters('asename'))]"}}, "dependson": ["[resourceid('microsoft.web/hostingenvironments", parameters('asename'))]", "[resourceid('microsoft.web/serverfarms", parameters('appserviceplanname'))]"]}
Create an App Service Environment with an ILB Address
{"apiversion": "2020-12-01", "type": "microsoft.web/hostingenvironments", "name": "[parameters('asename')]", "location": "[parameters('location')]", "properties": {"name": "[parameters('asename')]", "location": "[parameters('location')]", "ipssladdresscount": "[parameters('ipssladdresscount')]", "internalloadbalancingmode": "[parameters('internalloadbalancingmode')]", "virtualnetwork": {"id": "[resourceid(parameters('existingvirtualnetworkresourcegroup'), "microsoft.network/virtualnetworks/subnets", parameters('existingvnetresourceid'), parameters('subnetname'))]"}, "multisize": "[parameters('frontendsize')]", "multirolecount": "[parameters('frontendcount')]", "workerpools": [{"workersizeid": 0, "workersize": "[parameters('workerpooloneinstancesize')]", "workercount": "[parameters('workerpooloneinstancecount')]"}, {"workersizeid": 1, "workersize": "[parameters('workerpooltwoinstancesize')]", "workercount": "[parameters('workerpooltwoinstancecount')]"}, {"workersizeid": 2, "workersize": "[parameters('workerpoolthreeinstancesize')]", "workercount": "[parameters('workerpoolthreeinstancecount')]"}]}}
Create an App Service Environment v2 with an ILB Address
{"apiversion": "2020-06-01", "type": "microsoft.web/hostingenvironments", "name": "[parameters('asename')]", "kind": "asev2", "location": "[parameters('location')]", "properties": {"name": "[parameters('asename')]", "location": "[parameters('location')]", "ipssladdresscount": 0, "internalloadbalancingmode": "[parameters('internalloadbalancingmode')]", "virtualnetwork": {"id": "[resourceid(parameters('existingvirtualnetworkresourcegroup'), "microsoft.network/virtualnetworks/subnets", parameters('existingvirtualnetworkname'), parameters('subnetname'))]"}}}
Create a web app on Azure with Java 13 and Tomcat 9 enabled.
{"apiversion": "2020-06-01", "name": "[parameters('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}, "properties": {"name": "[parameters('hostingplanname')]"}}{"apiversion": "2020-06-01", "name": "[parameters('websitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "tags": {"[concat('hidden-related:", resourcegroup().id, "/providers/microsoft.web/serverfarms/", parameters('hostingplanname'))]": "resource", "displayname": "website"}, "dependson": ["[resourceid('microsoft.web/serverfarms/", parameters('hostingplanname'))]"], "properties": {"name": "[parameters('websitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('hostingplanname'))]"}, "resources": [{"apiversion": "2020-06-01", "name": "web", "type": "config", "dependson": ["[resourceid('microsoft.web/sites/", parameters('websitename'))]"], "properties": {"javaversion": "1.8", "javacontainer": "tomcat", "javacontainerversion": "9.0"}}]}
This template provides a easy way to deploy Web App on Linux with Azure database for PostgreSQL(Preview).
{"type": "microsoft.web/sites", "name": "[parameters('sitename')]", "dependson": ["[variables('hostingplanname')]"], "properties": {"siteconfig": {"linuxfxversion": "node|6.10", "connectionstrings": [{"name": "defaultconnection", "connectionstring": "[concat('database=", variables('databasename'), ";server=", reference(resourceid('microsoft.dbforpostgresql/servers",variables('servername'))).fullyqualifieddomainname, ";user id=",parameters('administratorlogin'),"@",variables('servername') ,";password=",parameters('administratorloginpassword'))]", "type": "postgresql"}]}, "name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "apiversion": "2019-08-01", "location": "[parameters('location')]"}{"apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]", "workersizeid": "1", "reserved": true, "numberofworkers": "1"}, "sku": {"tier": "standard", "name": "s1"}, "kind": "linux"}
Create an AppServicePlan and App in an App Service Environment v2
{"apiversion": "2020-06-01", "name": "[parameters('appserviceplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[parameters('appserviceplanname')]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments", parameters('appserviceenvironmentname'))]"}}, "sku": {"name": "[concat('i",parameters('pricingtier'))]", "tier": "isolated", "size": "[concat('i",parameters('pricingtier'))]", "family": "i", "capacity": "[parameters('capacity')]"}}{"apiversion": "2020-06-01", "name": "[parameters('sitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "properties": {"name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('appserviceplanname'))]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments", parameters('appserviceenvironmentname'))]"}}, "dependson": ["[resourceid('microsoft.web/serverfarms/", parameters('appserviceplanname'))]"]}
This template provides an easy way to deploy a web app with custom deployment slots on Azure Web Apps.
{"apiversion": "2020-06-01", "type": "microsoft.web/serverfarms", "kind": "app", "name": "[variables('appserviceplanname')]", "location": "[parameters('location')]", "comments": "this app service plan is used for the web app and slots.", "tags": {"displayname": "appserviceplan"}, "properties": {}, "sku": {"name": "[if(lessorequals(length(parameters('environments')), variables('standardplanmaxadditionalslots')), "s1", "p1')]"}}{"apiversion": "2020-06-01", "type": "microsoft.web/sites", "kind": "app", "name": "[variables('webappportalname')]", "location": "[parameters('location')]", "comments": "this is the web app, also the default "nameless" slot.", "tags": {"displayname": "webapp"}, "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]", "siteconfig": {"appsettings": [{"name": "[parameters('appsettingname')]", "value": "value"}, {"name": "[variables('stickyappsettingname')]", "value": "value"}]}}, "dependson": ["[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]"]}{"apiversion": "2020-06-01", "type": "microsoft.web/sites/slots", "name": "[concat(variables('webappportalname'), "/", parameters('environments')[copyindex()])]", "kind": "app", "location": "[parameters('location')]", "comments": "this specifies the web app slots.", "tags": {"displayname": "webappslots"}, "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]"}, "dependson": ["[resourceid('microsoft.web/sites", variables('webappportalname'))]"], "copy": {"name": "webportalslot", "count": "[length(parameters('environments'))]"}}{"apiversion": "2020-06-01", "name": "[concat(variables('webappportalname'), "/slotconfignames')]", "type": "microsoft.web/sites/config", "comments": "this specifies the sticky (slot setting) application settings.", "dependson": ["[resourceid('microsoft.web/sites", variables('webappportalname'))]"], "properties": {"appsettingnames": ["[variables('stickyappsettingname')]"]}}
Deploy a Web App certificate from Key Vault secret and use it for creating SSL binding
{"type": "microsoft.web/certificates", "name": "[parameters('certificatename')]", "apiversion": "2019-08-01", "location": "[parameters('location')]", "properties": {"keyvaultid": "[parameters('existingkeyvaultid')]", "keyvaultsecretname": "[parameters('existingkeyvaultsecretname')]", "serverfarmid": "[parameters('existingserverfarmid')]"}}{"type": "microsoft.web/sites", "name": "[parameters('existingwebappname')]", "apiversion": "2019-08-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/certificates", parameters('certificatename'))]"], "properties": {"name": "[parameters('existingwebappname')]", "hostnamesslstates": [{"name": "[parameters('hostname')]", "sslstate": "snienabled", "thumbprint": "[reference(resourceid('microsoft.web/certificates", parameters('certificatename'))).thumbprint]", "toupdate": true}]}}
This template provides a way to deploy Web Apps on Linux with Azure database for MySQL.
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"tier": "standard", "name": "s1"}, "kind": "linux", "properties": {"reserved": true}}{"type": "microsoft.web/sites", "apiversion": "2021-02-01", "name": "[parameters('sitename')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "properties": {"siteconfig": {"linuxfxversion": "php|7.0", "ftpsstate": "ftpsonly", "mintlsversion": "1.2", "scmmintlsversion": "1.2", "connectionstrings": [{"name": "defaultconnection", "connectionstring": "[format('database={0};data source={1};user id={2}@{3};password={4}", variables('databasename'), reference(resourceid('microsoft.dbformysql/servers", variables('mysqlservername'))).fullyqualifieddomainname, parameters('administratorlogin'), variables('mysqlservername'), parameters('administratorloginpassword'))]", "type": "mysql"}]}, "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "httpsonly": true}, "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "[resourceid('microsoft.dbformysql/servers", variables('mysqlservername'))]"]}
This template creates an Azure Web App with Blob Storage connection string. Template originally authored by Jeff Bowles of Microsoft
{"name": "[parameters('webappsvcplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "apiversion": "2020-12-01", "tags": {"displayname": "appsvcplan"}, "sku": {"name": "[parameters('webappsvcplansku')]"}, "properties": {"name": "[parameters('webappsvcplanname')]", "workersize": "[parameters('webappsvcplanworkersize')]", "numberofworkers": 1}}{"name": "[parameters('webappname')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.web/serverfarms/", parameters('webappsvcplanname'))]"], "tags": {"[concat('hidden-related:", resourcegroup().id, "/providers/microsoft.web/serverfarms/", parameters('webappsvcplanname'))]": "resource", "displayname": "webapp"}, "properties": {"name": "[parameters('webappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms/", parameters('webappsvcplanname'))]"}, "resources": [{"apiversion": "2020-12-01", "name": "web", "type": "config", "dependson": ["[resourceid('microsoft.web/sites/", parameters('webappname'))]"], "tags": {"displayname": "webappconfig"}, "properties": {"phpversion": "5.6", "netframeworkversion": "v4.6", "use32bitworkerprocess": false, "websocketsenabled": true, "alwayson": false, "remotedebuggingenabled": true, "remotedebuggingversion": "vs2017"}}, {"name": "msdeploy", "type": "extensions", "location": "[parameters('location')]", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.web/sites/", parameters('webappname'))]", "[resourceid('microsoft.web/sites/config",parameters('webappname'), "web')]"], "tags": {"displayname": "webappmsdeploy"}, "properties": {"packageuri": "[variables('packageuri')]"}}, {"name": "connectionstrings", "type": "config", "apiversion": "2020-12-01", "dependson": ["[resourceid('microsoft.web/sites/", parameters('webappname'))]", "[resourceid('microsoft.web/sites/extensions", parameters('webappname'), "msdeploy')]"], "tags": {"displayname": "webappconnectionstrings"}, "properties": {"blobconnection": {"value": "[concat('defaultendpointsprotocol=https;accountname=",parameters('storageaccountname'),";accountkey=",concat(listkeys(variables('storageaccountid'),"2015-05-01-preview').key1))]", "type": "custom"}}}]}
Create a Web App plus Redis Cache using a template
{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}, "properties": {"name": "[variables('hostingplanname')]"}}{"apiversion": "2015-08-01", "name": "[variables('websitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]", "[resourceid('microsoft.cache/redis/", variables('cachename'))]"], "tags": {"[concat('hidden-related:", resourcegroup().id, "/providers/microsoft.web/serverfarms/", variables('hostingplanname'))]": "empty", "displayname": "website"}, "properties": {"name": "[variables('websitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"apiversion": "2015-08-01", "type": "config", "name": "appsettings", "dependson": ["[resourceid('microsoft.web/sites/", variables('websitename'))]", "[resourceid('microsoft.cache/redis/", variables('cachename'))]"], "properties": {"cacheconnection": "[concat(variables('cachename'),".redis.cache.windows.net,abortconnect=false,ssl=true,password=", listkeys(resourceid('microsoft.cache/redis", variables('cachename')), "2020-12-01').primarykey)]"}}]}
This template allows you to deploy an App Service Plan and a basic Linux web app
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('appserviceplanportalname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]"}, "kind": "linux", "properties": {"reserved": true}}{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('appserviceplanportalname'))]"], "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanportalname'))]", "siteconfig": {"linuxfxversion": "[parameters('linuxfxversion')]"}, "resources": [{"condition": "[contains(parameters('repourl'),"http')]", "type": "sourcecontrols", "apiversion": "2020-06-01", "name": "web", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('webappname'))]"], "properties": {"repourl": "[parameters('repourl')]", "branch": "master", "ismanualintegration": true}}]}}
Create an AppServicePlan and App in an ASE
{"apiversion": "2020-12-01", "name": "[parameters('appserviceplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('existingaselocation')]", "properties": {"name": "[parameters('appserviceplanname')]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments",parameters('appserviceenvironmentname'))]"}}, "sku": {"name": "[concat('p",parameters('workerpool'))]", "tier": "premium", "size": "[concat('p",parameters('workerpool'))]", "family": "p", "capacity": "[parameters('numberofworkersfromworkerpool')]"}}{"apiversion": "2020-12-01", "name": "[parameters('sitename')]", "type": "microsoft.web/sites", "location": "[parameters('existingaselocation')]", "properties": {"name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms",parameters('appserviceplanname'))]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments", parameters('appserviceenvironmentname'))]"}}, "dependson": ["[resourceid('microsoft.web/serverfarms/",parameters('appserviceplanname'))]"]}
Azure Function app and an HTTP-triggered function
{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[variables('appserviceplanname')]", "location": "[parameters('location')]", "kind": "functionapp", "sku": {"name": "y1"}, "properties": {}}{"type": "microsoft.web/sites", "apiversion": "2020-12-01", "name": "[variables('functionappname')]", "location": "[parameters('location')]", "kind": "functionapp", "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]", "siteconfig": {"appsettings": [{"name": "azurewebjobsstorage", "value": "[format('defaultendpointsprotocol=https;accountname={0};endpointsuffix={1};accountkey={2}", variables('storageaccountname'), environment().suffixes.storage, listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2021-04-01').keys[0].value)]"}, {"name": "website_contentazurefileconnectionstring", "value": "[format('defaultendpointsprotocol=https;accountname={0};endpointsuffix={1};accountkey={2}", variables('storageaccountname'), environment().suffixes.storage, listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2021-04-01').keys[0].value)]"}, {"name": "appinsights_instrumentationkey", "value": "[reference(resourceid('microsoft.insights/components", variables('appinsightsname'))).instrumentationkey]"}, {"name": "applicationinsights_connection_string", "value": "[format('instrumentationkey={0}", reference(resourceid('microsoft.insights/components", variables('appinsightsname'))).instrumentationkey)]"}, {"name": "functions_worker_runtime", "value": "[variables('functionruntime')]"}, {"name": "functions_extension_version", "value": "~3"}]}, "httpsonly": true}, "dependson": ["[resourceid('microsoft.insights/components", variables('appinsightsname'))]", "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"]}{"type": "microsoft.web/sites/functions", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", variables('functionappname'), variables('functionnamecomputed'))]", "properties": {"config": {"disabled": false, "bindings": [{"name": "req", "type": "httptrigger", "direction": "in", "authlevel": "function", "methods": ["get"]}, {"name": "$return", "type": "http", "direction": "out"}]}, "files": {"run.csx": "#r "newtonsoft.json"\r\n\r\nusing system.net;\r\nusing microsoft.aspnetcore.mvc;\r\nusing microsoft.extensions.primitives;\r\nusing newtonsoft.json;\r\n\r\npublic static async task<iactionresult> run(httprequest req, ilogger log)\r\n{\r\n log.loginformation("c# http trigger function processed a request.");\r\n\r\n string name = req.query["name"];\r\n\r\n string requestbody = await new streamreader(req.body).readtoendasync();\r\n dynamic data = jsonconvert.deserializeobject(requestbody);\r\n name = name ?? data?.name;\r\n\r\n string responsemessage = string.isnullorempty(name)\r\n ? "this http triggered function executed successfully. pass a name in the query string or in the request body for a personalized response."\r\n : $"hello, {name}. this http triggered function executed successfully.";\r\n\r\n return new okobjectresult(responsemessage);\r\n}"}}, "dependson": ["[resourceid('microsoft.web/sites", variables('functionappname'))]"]}
Create a Web App plus Redis Cache plus SQL Database using a template
{"apiversion": "2015-08-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}, "properties": {"name": "[variables('hostingplanname')]"}}{"apiversion": "2015-08-01", "name": "[variables('websitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]", "[resourceid('microsoft.cache/redis/", variables('cachename'))]"], "tags": {"[concat('hidden-related:", resourcegroup().id, "/providers/microsoft.web/serverfarms/", variables('hostingplanname'))]": "empty", "displayname": "website"}, "properties": {"name": "[variables('websitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"apiversion": "2015-08-01", "type": "config", "name": "connectionstrings", "dependson": ["[resourceid('microsoft.web/sites/", variables('websitename'))]", "[resourceid('microsoft.sql/servers/", variables('sqlservername'))]"], "properties": {"teamcontext": {"value": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers/", variables('sqlservername'))).fullyqualifieddomainname, ",1433;initial catalog=", parameters('databasename'), ";user id=", parameters('administratorlogin'), "@", variables('sqlservername'), ";password=", parameters('administratorloginpassword'), ";')]", "type": "sqlserver"}}}, {"apiversion": "2015-08-01", "type": "config", "name": "appsettings", "dependson": ["[resourceid('microsoft.web/sites/", variables('websitename'))]", "[resourceid('microsoft.cache/redis/", variables('cachename'))]"], "properties": {"cacheconnection": "[concat(variables('cachename'),".redis.cache.windows.net,abortconnect=false,ssl=true,password=", listkeys(resourceid('microsoft.cache/redis", variables('cachename')), "2020-12-01').primarykey)]"}}]}
Deploy an App Service with a Private Endpoint
{"type": "microsoft.web/serverfarms", "apiversion": "2019-08-01", "name": "[parameters('serverfarm_name')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku_name')]", "tier": "[parameters('sku_tier')]", "size": "[parameters('sku_size')]", "family": "[parameters('sku_family')]", "capacity": 1}, "kind": "app"}{"type": "microsoft.web/sites", "apiversion": "2019-08-01", "name": "[parameters('site_name')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('serverfarm_name'))]"], "kind": "app", "properties": {"enabled": true, "hostnamesslstates": [{"name": "[concat(parameters('site_name'), parameters('webapp_dns_name'))]", "sslstate": "disabled", "hosttype": "standard"}, {"name": "[concat(parameters('site_name'), ".scm", parameters('webapp_dns_name'))]", "sslstate": "disabled", "hosttype": "repository"}], "serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('serverfarm_name'))]"}}{"type": "microsoft.web/sites/config", "apiversion": "2019-08-01", "name": "[concat(parameters('site_name'), "/web')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('site_name'))]"], "properties": {"ftpsstate": "allallowed"}}{"type": "microsoft.web/sites/hostnamebindings", "apiversion": "2019-08-01", "name": "[concat(parameters('site_name'), "/", parameters('site_name'), parameters('webapp_dns_name'))]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('site_name'))]"], "properties": {"sitename": "[parameters('site_name')]", "hostnametype": "verified"}}
Provision a function app on a dedicated hosting plan with source code deployed from GitHub
{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]"}, "properties": {"workersize": "[parameters('workersize')]", "numberofworkers": 1}}{"apiversion": "2020-12-01", "type": "microsoft.web/sites", "name": "[variables('functionappname')]", "location": "[parameters('location')]", "kind": "functionapp", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"], "properties": {"name": "[variables('functionappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "clientaffinityenabled": false, "siteconfig": {"alwayson": true, "cors": {"allowedorigins": ["*"]}, "appsettings": [{"name": "functions_extension_version", "value": "~1"}, {"name": "azurewebjobsstorage", "value": "[concat('defaultendpointsprotocol=https;accountname=",variables('storageaccountname'),";accountkey=",listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2019-06-01').keys[0].value,";')]"}, {"name": "azurewebjobsdashboard", "value": "[concat('defaultendpointsprotocol=https;accountname=",variables('storageaccountname'),";accountkey=",listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2019-06-01').keys[0].value,";')]"}]}}, "resources": [{"apiversion": "2018-11-01", "name": "web", "type": "sourcecontrols", "dependson": ["[resourceid('microsoft.web/sites", variables('functionappname'))]"], "properties": {"repourl": "[parameters('repourl')]", "branch": "[parameters('branch')]", "ismanualintegration": true}}]}
Create and assign a wildcard App Service Certificate
{"type": "microsoft.web/certificates", "name": "[parameters('certificateordername')]", "apiversion": "2015-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.certificateregistration/certificateorders/certificates", parameters('certificateordername'), parameters('certificateordername'))]"], "properties": {"keyvaultid": "[parameters('existingkeyvaultid')]", "keyvaultsecretname": "[parameters('certificateordername')]"}}{"type": "microsoft.web/sites", "name": "[parameters('existingappname')]", "apiversion": "2015-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.web/certificates", parameters('certificateordername'))]"], "properties": {"name": "[parameters('existingappname')]", "hostnamesslstates": [{"name": "[parameters('roothostname')]", "sslstate": 1, "thumbprint": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).signedcertificate.thumbprint]", "toupdate": true}, {"name": "[variables('wwwhostname')]", "sslstate": 1, "thumbprint": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).signedcertificate.thumbprint]", "toupdate": true}]}}
Create an App Service Environment v2
{"type": "microsoft.web/hostingenvironments", "apiversion": "2020-06-01", "name": "[parameters('asename')]", "kind": "asev2", "location": "[parameters('location')]", "properties": {"location": "[parameters('location')]", "name": "[parameters('asename')]", "workerpools": [], "virtualnetwork": {"id": "[extensionresourceid(format('/subscriptions/{0}/resourcegroups/{1}", subscription().subscriptionid, parameters('existingvirtualnetworkresourcegroup')), "microsoft.network/virtualnetworks/subnets", parameters('existingvirtualnetworkname'), parameters('existingsubnetname'))]"}}}
Deploy a WebApp Service liked with a GitHub Repository.
{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('workersize')]"}, "properties": {"name": "[variables('hostingplanname')]"}}{"type": "microsoft.web/sites", "apiversion": "2020-12-01", "name": "[parameters('sitename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"], "properties": {"id": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"type": "sourcecontrols", "apiversion": "2020-12-01", "name": "web", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('sitename'))]"], "properties": {"repourl": "[parameters('repourl')]", "branch": "[parameters('branch')]", "ismanualintegration": true}}]}
This template allows you to deploy an app service plan and a basic Windows web app, with regional VNet integration enabled to a newly created virtual network
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('appserviceplanname')]", "location": "[parameters('location')]", "sku": {"name": "[variables('appserviceplansku')]"}, "kind": "app"}{"type": "microsoft.web/sites", "apiversion": "2021-01-01", "name": "[parameters('appname')]", "location": "[parameters('location')]", "kind": "app", "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]", "virtualnetworksubnetid": "[reference(resourceid('microsoft.network/virtualnetworks", variables('vnetname'))).subnets[0].id]", "httpsonly": true, "siteconfig": {"vnetrouteallenabled": true, "http20enabled": true}}, "dependson": ["[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]", "[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]"]}
Simple example to deploy Azure infrastructure for app + data + managed identity + monitoring
{"type": "microsoft.web/sites/config", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", format('website{0}", uniquestring(resourcegroup().id)), "connectionstrings')]", "properties": {"defaultconnection": {"value": "[format('data source=tcp:{0},1433;initial catalog={1};user id={2}@{3};password={4};", reference(resourceid('microsoft.sql/servers", format('sqlserver{0}", uniquestring(resourcegroup().id)))).fullyqualifieddomainname, variables('databasename'), reference(resourceid('microsoft.sql/servers", format('sqlserver{0}", uniquestring(resourcegroup().id)))).administratorlogin, reference(resourceid('microsoft.sql/servers", format('sqlserver{0}", uniquestring(resourcegroup().id)))).fullyqualifieddomainname, parameters('sqladministratorpassword'))]", "type": "sqlazure"}}, "dependson": ["[resourceid('microsoft.sql/servers/databases", format('sqlserver{0}", uniquestring(resourcegroup().id)), variables('databasename'))]", "[resourceid('microsoft.sql/servers", format('sqlserver{0}", uniquestring(resourcegroup().id)))]", "[resourceid('microsoft.web/sites", format('website{0}", uniquestring(resourcegroup().id)))]"]}{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[format('hostingplan{0}", uniquestring(resourcegroup().id))]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}}{"type": "microsoft.web/sites", "apiversion": "2020-12-01", "name": "[format('website{0}", uniquestring(resourcegroup().id))]", "location": "[parameters('location')]", "tags": {"[format('hidden-related:{0}", resourceid('microsoft.web/serverfarms", format('hostingplan{0}", uniquestring(resourcegroup().id))))]": "empty", "displayname": "website"}, "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", format('hostingplan{0}", uniquestring(resourcegroup().id)))]"}, "identity": {"type": "userassigned", "userassignedidentities": {"[resourceid('microsoft.managedidentity/userassignedidentities", parameters('managedidentityname'))]": {}}}, "dependson": ["[resourceid('microsoft.web/serverfarms", format('hostingplan{0}", uniquestring(resourcegroup().id)))]", "[resourceid('microsoft.managedidentity/userassignedidentities", parameters('managedidentityname'))]"]}
Create Managed Certificate (Free) APEX (root domain) for WebApp
{"apiversion": "2020-12-01", "location": "[parameters('location')]", "name": "[concat(parameters('subjectname'), "-", parameters('appserviceplanname'))]", "type": "microsoft.web/certificates", "properties": {"serverfarmid": "[resourceid(parameters('resourcegroupname'),"microsoft.web/serverfarms/", parameters('appserviceplanname'))]", "canonicalname": "[parameters('subjectname')]", "domainvalidationmethod": "http-token"}}
This template creates an App Service Environment with an Azure SQL backend along with private endpoints along with associated resources typically used in an private/isolated environment.
{"apiversion": "2020-06-01", "type": "microsoft.web/hostingenvironments", "name": "[parameters('stackname')]", "kind": "asev2", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnetname'))]", "[resourceid('microsoft.network/virtualnetworks/subnets",variables('vnetname'), parameters('frontendsubnet'))]"], "properties": {"internalloadbalancingmode": 3, "virtualnetwork": {"id": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnetname'), parameters('frontendsubnet'))]"}}}{"apiversion": "2020-06-01", "name": "[parameters('stackname')]", "type": "microsoft.web/serverfarms", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.web/hostingenvironments",parameters('stackname'))]"], "properties": {"name": "[parameters('stackname')]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments",parameters('stackname'))]"}}, "sku": {"name": "[concat('i",variables('workerpool'))]", "tier": "isolated", "size": "[concat('i",variables('workerpool'))]", "family": "i", "capacity": "[variables('numberofworkersfromworkerpool')]"}}{"apiversion": "2020-06-01", "name": "[parameters('stackname')]", "type": "microsoft.web/sites", "location": "[variables('location')]", "identity": {"type": "systemassigned"}, "dependson": ["[resourceid('microsoft.web/serverfarms/",parameters('stackname'))]", "[resourceid('microsoft.insights/components/", parameters('stackname'))]"], "properties": {"name": "[parameters('stackname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms",parameters('stackname'))]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments", parameters('stackname'))]"}, "siteconfig": {"appsettings": [{"name": "appinsights_instrumentationkey", "value": "[reference(resourceid('microsoft.insights/components/", parameters('stackname')), "2018-05-01-preview').instrumentationkey]"}, {"name": "applicationinsightsagent_extension_version", "value": "~2"}, {"name": "xdt_microsoftapplicationinsights_mode", "value": "default"}, {"name": "diagnosticservices_extension_version", "value": "disabled"}, {"name": "appinsights_profilerfeature_version", "value": "disabled"}, {"name": "appinsights_snapshotfeature_version", "value": "disabled"}, {"name": "instrumentationengine_extension_version", "value": "disabled"}, {"name": "snapshotdebugger_extension_version", "value": "disabled"}, {"name": "xdt_microsoftapplicationinsights_baseextensions", "value": "disabled"}]}}}{"type": "microsoft.web/sites/config", "apiversion": "2020-06-01", "name": "[concat(parameters('stackname'), "/web')]", "location": "[variables('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('stackname'))]"], "properties": {"netframeworkversion": "v5.0"}}
Deploy a Web App with diagnostics logging to Storage Account Blob Container enabled.
{"apiversion": "2020-12-01", "type": "microsoft.web/serverfarms", "name": "[parameters('appserviceplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('appserviceplanskuname')]"}}{"apiversion": "2020-12-01", "type": "microsoft.web/sites", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('appserviceplanname'))]", "[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "properties": {"name": "[parameters('webappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms/", parameters('appserviceplanname'))]"}, "resources": [{"apiversion": "2020-12-01", "type": "config", "name": "logs", "dependson": ["[resourceid('microsoft.web/sites", parameters('webappname'))]"], "properties": {"applicationlogs": {"azureblobstorage": {"level": "[parameters('diagnosticslogslevel')]", "sasurl": "[concat(reference(resourceid('microsoft.storage/storageaccounts/", parameters('storageaccountname'))).primaryendpoints.blob, variables('blobcontainername'), "?", listaccountsas(parameters('storageaccountname'), "2018-02-01", variables('listaccountsasrequestcontent')).accountsastoken)]", "retentionindays": "[parameters('diagnosticslogsretentionindays')]"}}}}]}
Deploy an App Service that supports ASP.NET v4.0. It gives you the support to deploy your own ASP.NET app.
{"apiversion": "2020-06-01", "name": "[parameters('webappname')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.insights/components/", variables('appinsight'))]", "[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]"], "properties": {"name": "[parameters('webappname')]", "siteconfig": {"appsettings": [{"name": "appinsights_instrumentationkey", "value": "[reference(resourceid('microsoft.insights/components/", variables('appinsight')), "2020-02-02').instrumentationkey]"}, {"name": "applicationinsightsagent_extension_version", "value": "~2"}, {"name": "xdt_microsoftapplicationinsights_mode", "value": "default"}, {"name": "diagnosticservices_extension_version", "value": "disabled"}, {"name": "appinsights_profilerfeature_version", "value": "disabled"}, {"name": "appinsights_snapshotfeature_version", "value": "disabled"}, {"name": "instrumentationengine_extension_version", "value": "disabled"}, {"name": "snapshotdebugger_extension_version", "value": "disabled"}, {"name": "xdt_microsoftapplicationinsights_baseextensions", "value": "disabled"}], "metadata": [{"name": "current_stack", "value": "[variables('currentstack')]"}], "netframeworkversion": "[variables('netframeworkversion')]", "alwayson": "[variables('alwayson')]"}, "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "clientaffinityenabled": true}}{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]", "workersize": "[variables('workersize')]", "workersizeid": "[variables('workersizeid')]", "numberofworkers": "[variables('numberofworkers')]"}, "sku": {"tier": "[variables('sku')]", "name": "[variables('skucode')]"}}
Configures the default SSL certificate for an ILB ASE or an ILB ASE v2
{"apiversion": "2015-08-01", "type": "microsoft.web/certificates", "name": "[parameters('certificatename')]", "location": "[parameters('existingaselocation')]", "properties": {"pfxblob": "[parameters('pfxblobstring')]", "password": "[parameters('password')]", "hostingenvironmentprofile": {"id": "[resourceid('microsoft.web/hostingenvironments",parameters('appserviceenvironmentname'))]"}}}{"apiversion": "2015-08-01", "type": "microsoft.web/hostingenvironments", "name": "[parameters('appserviceenvironmentname')]", "location": "[parameters('existingaselocation')]", "properties": {"clustersettings": [{"name": "defaultsslcertificatethumbprint", "value": "[parameters('certificatethumbprint')]"}]}, "dependson": ["[concat('microsoft.web/certificates/",parameters('certificatename'))]"]}
Deploy an App Service that supports Node. It gives you the support to deploy your own Node app.
{"apiversion": "2020-06-01", "name": "[parameters('webappname')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]"], "properties": {"name": "[parameters('webappname')]", "siteconfig": {"linuxfxversion": "[variables('linuxfxversion')]", "alwayson": "[variables('alwayson')]"}, "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "clientaffinityenabled": false}}{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "kind": "linux", "sku": {"tier": "[variables('sku')]", "name": "[variables('skucode')]"}, "properties": {"name": "[variables('hostingplanname')]", "workersize": "[variables('workersize')]", "workersizeid": "[variables('workersizeid')]", "numberofworkers": "[variables('numberofworkers')]", "reserved": true}}
Create a web app with aa custom domain and optional SSL binding
{"type": "microsoft.web/serverfarms", "apiversion": "2019-08-01", "name": "[variables('appserviceplanname')]", "location": "[parameters('location')]", "properties": {"name": "[variables('appserviceplanname')]"}, "sku": {"name": "p1", "tier": "premium", "size": "1", "family": "p", "capacity": "1"}}{"type": "microsoft.web/sites", "apiversion": "2019-08-01", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]"], "properties": {"name": "[parameters('webappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]"}}{"condition": "[variables('enablessl')]", "type": "microsoft.web/certificates", "apiversion": "2019-08-01", "name": "[variables('certificatename')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/sites", parameters('webappname'))]"], "properties": {"keyvaultid": "[parameters('existingkeyvaultid')]", "keyvaultsecretname": "[parameters('existingkeyvaultsecretname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('appserviceplanname'))]"}}{"type": "microsoft.web/sites/hostnamebindings", "name": "[concat(parameters('webappname'), "/", parameters('customhostname'))]", "apiversion": "2019-08-01", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/certificates", variables('certificatename'))]"], "properties": {"sslstate": "[if(variables('enablessl'), "snienabled", json('null'))]", "thumbprint": "[if(variables('enablessl'), reference(resourceid('microsoft.web/certificates", variables('certificatename'))).thumbprint, json('null'))]"}}
This template creates an Azure Cosmos DB account, an App Service Plan, and a Web App.
{"type": "microsoft.web/serverfarms", "apiversion": "2021-02-01", "name": "[parameters('appsvcplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('svcplansize')]", "tier": "[parameters('svcplansku')]", "capacity": 1}}{"type": "microsoft.web/sites", "apiversion": "2021-02-01", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "identity": {"type": "systemassigned"}, "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('appsvcplanname'))]", "httpsonly": true, "siteconfig": {"ftpsstate": "ftpsonly", "phpversion": "off", "mintlsversion": "1.2", "appsettings": [{"name": "documentdb_endpoint", "value": "[reference(resourceid('microsoft.documentdb/databaseaccounts", parameters('databaseaccountname'))).documentendpoint]"}, {"name": "documentdb_primary_key", "value": "[listkeys(resourceid('microsoft.documentdb/databaseaccounts", parameters('databaseaccountname')), "2021-10-15').primarymasterkey]"}]}}, "dependson": ["[resourceid('microsoft.web/serverfarms", parameters('appsvcplanname'))]", "[resourceid('microsoft.documentdb/databaseaccounts", parameters('databaseaccountname'))]"]}
Provision a Web App with a SQL Database
{"type": "microsoft.web/serverfarms", "apiversion": "2020-12-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}}{"type": "microsoft.web/sites", "apiversion": "2020-12-01", "name": "[variables('websitename')]", "location": "[parameters('location')]", "tags": {"[format('hidden-related:{0}", resourceid('microsoft.web/serverfarms", variables('hostingplanname')))]": "empty", "displayname": "website"}, "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"]}{"type": "microsoft.web/sites/config", "apiversion": "2020-12-01", "name": "[format('{0}/{1}", variables('websitename'), "connectionstrings')]", "properties": {"defaultconnection": {"value": "[format('data source=tcp:{0},1433;initial catalog={1};user id={2}@{3};password={4};", reference(resourceid('microsoft.sql/servers", variables('sqlservername'))).fullyqualifieddomainname, variables('databasename'), parameters('sqladministratorlogin'), reference(resourceid('microsoft.sql/servers", variables('sqlservername'))).fullyqualifieddomainname, parameters('sqladministratorloginpassword'))]", "type": "sqlazure"}}, "dependson": ["[resourceid('microsoft.sql/servers", variables('sqlservername'))]", "[resourceid('microsoft.web/sites", variables('websitename'))]"]}
This template provides a easy way to deploy web app on Azure App Service Web Apps with Azure database for MySQL.
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "properties": {"reserved": true}, "sku": {"tier": "standard", "name": "s1"}}{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('sitename')]", "location": "[parameters('location')]", "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"]}{"type": "microsoft.web/sites/config", "apiversion": "2020-06-01", "name": "[format('{0}/{1}", parameters('sitename'), "connectionstrings')]", "properties": {"defaultconnection": {"value": "[format('database={0};data source={1};user id={2}@{3};password={4}", variables('databasename'), reference(resourceid('microsoft.dbformysql/servers", variables('servername'))).fullyqualifieddomainname, parameters('administratorlogin'), variables('servername'), parameters('administratorloginpassword'))]", "type": "mysql"}}, "dependson": ["[resourceid('microsoft.dbformysql/servers", variables('servername'))]", "[resourceid('microsoft.web/sites", parameters('sitename'))]"]}
This template deploys Sonarqube in an Azure App Service web app Linux container using the official Sonarqube image and backed by an Azure SQL Server.
{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('serviceplanname')]", "location": "[parameters('location')]", "properties": {"name": "[variables('serviceplanname')]", "workersizeid": "1", "reserved": true, "numberofworkers": "1"}, "sku": {"name": "[parameters('serviceplanpricingtier')]", "tier": "[variables('serviceplanpricingtiers')[parameters('serviceplanpricingtier')].tier]", "capacity": "[parameters('serviceplancapacity')]"}, "kind": "linux"}{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('sitename')]", "location": "[parameters('location')]", "dependson": ["[variables('serviceplanname')]", "[variables('sqlservername')]"], "properties": {"siteconfig": {"linuxfxversion": "[concat('docker|sonarqube",":",parameters('sonarqubeimageversion'))]"}, "name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('serviceplanname'))]"}, "resources": [{"type": "config", "apiversion": "2020-06-01", "name": "appsettings", "dependson": ["[resourceid('microsoft.web/sites", parameters('sitename'))]"], "tags": {"displayname": "sonarappsettings"}, "properties": {"sonarqube_jdbc_url": "[concat('jdbc:sqlserver://", reference(resourceid('microsoft.sql/servers",variables('sqlservername'))).fullyqualifieddomainname, ";databasename=", variables('databasename'), ";encrypt=true;trustservercertificate=false;hostnameincertificate=", replace(reference(resourceid('microsoft.sql/servers", variables('sqlservername'))).fullyqualifieddomainname, concat(variables('sqlservername'), ".'), "*.'), ";logintimeout=30;')]", "sonarqube_jdbc_username": "[parameters('sqlserveradministratorusername')]", "sonarqube_jdbc_password": "[parameters('sqlserveradministratorpassword')]", "sonar.path.data": "/home/sonarqube/data"}}]}
This template allows you to deploy an Azure Function App that communicates with Azure Storage over private endpoints.
{"type": "microsoft.web/serverfarms", "apiversion": "2021-01-01", "name": "[parameters('functionappplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('functionappplansku')]", "tier": "elasticpremium", "size": "[parameters('functionappplansku')]", "family": "ep"}, "kind": "elastic", "properties": {"maximumelasticworkercount": 20, "reserved": "[variables('isreserved')]"}}{"type": "microsoft.web/sites", "apiversion": "2021-01-01", "name": "[parameters('functionappname')]", "location": "[parameters('location')]", "kind": "[if(variables('isreserved'), "functionapp,linux", "functionapp')]", "properties": {"serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('functionappplanname'))]", "reserved": "[variables('isreserved')]", "siteconfig": {"functionsruntimescalemonitoringenabled": true, "linuxfxversion": "[if(variables('isreserved'), "dotnet|3.1", json('null'))]", "appsettings": [{"name": "appinsights_instrumentationkey", "value": "[reference(resourceid('microsoft.insights/components", variables('applicationinsightsname'))).instrumentationkey]"}, {"name": "azurewebjobsstorage", "value": "[format('defaultendpointsprotocol=https;accountname={0};accountkey={1}", parameters('functionstorageaccountname'), listkeys(resourceid('microsoft.storage/storageaccounts", parameters('functionstorageaccountname')), "2021-02-01').keys[0].value)]"}, {"name": "website_contentazurefileconnectionstring", "value": "[format('defaultendpointsprotocol=https;accountname={0};accountkey={1}", parameters('functionstorageaccountname'), listkeys(resourceid('microsoft.storage/storageaccounts", parameters('functionstorageaccountname')), "2021-02-01').keys[0].value)]"}, {"name": "functions_extension_version", "value": "~3"}, {"name": "functions_worker_runtime", "value": "dotnet"}, {"name": "website_vnet_route_all", "value": "1"}, {"name": "website_contentovervnet", "value": "1"}, {"name": "website_contentshare", "value": "[variables('functioncontentsharename')]"}]}}, "dependson": ["[resourceid('microsoft.insights/components", variables('applicationinsightsname'))]", "[resourceid('microsoft.storage/storageaccounts/fileservices/shares", split(format('{0}/default/{1}", parameters('functionstorageaccountname'), variables('functioncontentsharename')), "/')[0], split(format('{0}/default/{1}", parameters('functionstorageaccountname'), variables('functioncontentsharename')), "/')[1], split(format('{0}/default/{1}", parameters('functionstorageaccountname'), variables('functioncontentsharename')), "/')[2])]", "[resourceid('microsoft.web/serverfarms", parameters('functionappplanname'))]", "[resourceid('microsoft.storage/storageaccounts", parameters('functionstorageaccountname'))]", "[resourceid('microsoft.network/privatednszones/virtualnetworklinks", variables('privatestorageblobdnszonename'), format('{0}-link", variables('privatestorageblobdnszonename')))]", "[resourceid('microsoft.network/privateendpoints/privatednszonegroups", variables('privateendpointstorageblobname'), "blobprivatednszonegroup')]", "[resourceid('microsoft.network/privateendpoints/privatednszonegroups", variables('privateendpointstoragefilename'), "fileprivatednszonegroup')]", "[resourceid('microsoft.network/privatednszones/virtualnetworklinks", variables('privatestoragequeuednszonename'), format('{0}-link", variables('privatestoragequeuednszonename')))]", "[resourceid('microsoft.network/privateendpoints/privatednszonegroups", variables('privateendpointstoragequeuename'), "tableprivatednszonegroup')]", "[resourceid('microsoft.network/privatednszones/virtualnetworklinks", variables('privatestoragetablednszonename'), format('{0}-link", variables('privatestoragetablednszonename')))]", "[resourceid('microsoft.network/privateendpoints/privatednszonegroups", variables('privateendpointstoragetablename'), "tableprivatednszonegroup')]"]}{"type": "microsoft.web/sites/networkconfig", "apiversion": "2021-01-01", "name": "[format('{0}/{1}", parameters('functionappname'), "virtualnetwork')]", "properties": {"subnetresourceid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('vnetname'), parameters('functionsubnetname'))]", "swiftsupported": true}, "dependson": ["[resourceid('microsoft.web/sites", parameters('functionappname'))]", "[resourceid('microsoft.network/virtualnetworks", parameters('vnetname'))]"]}
This template deploys an empty Function App and a hosting plan.
{"type": "microsoft.web/sites", "apiversion": "2019-08-01", "name": "[parameters('sitename')]", "kind": "functionapp,linux", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "[resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname'))]"], "properties": {"name": "[parameters('sitename')]", "siteconfig": {"appsettings": [{"name": "functions_worker_runtime", "value": "python"}, {"name": "functions_extension_version", "value": "~2"}, {"name": "azurewebjobsstorage", "value": "[concat('defaultendpointsprotocol=https;accountname=", parameters('storageaccountname'), ";accountkey=", listkeys(variables('storageaccountid'),"2019-06-01').keys[0].value)]"}]}, "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "clientaffinityenabled": false}}{"type": "microsoft.web/serverfarms", "apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "kind": "linux", "properties": {"reserved": true}, "sku": {"tier": "standard", "name": "s1"}}
Creates a function app with managed service identity.
{"name": "[parameters('functionappname')]", "type": "microsoft.web/sites", "apiversion": "2019-08-01", "location": "[parameters('location')]", "kind": "functionapp", "dependson": ["[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]", "[resourceid('microsoft.insights/components", parameters('functionappname'))]"], "identity": {"type": "systemassigned"}, "properties": {"siteconfig": {"appsettings": [{"name": "functions_worker_runtime", "value": "[parameters('runtimestack')]"}, {"name": "azurewebjobsstorage", "value": "[concat('defaultendpointsprotocol=https;accountname=",variables('storageaccountname'), ";endpointsuffix=", environment().suffixes.storage, ";accountkey=",listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2019-06-01').keys[0].value)]"}, {"name": "functions_extension_version", "value": "~2"}, {"name": "appinsights_instrumentationkey", "value": "[reference(resourceid('microsoft.insights/components", parameters('functionappname')), "2018-05-01-preview').instrumentationkey]"}, {"name": "website_contentazurefileconnectionstring", "value": "[concat('defaultendpointsprotocol=https;accountname=", variables('storageaccountname'), ";endpointsuffix=", environment().suffixes.storage, ";accountkey=", listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')),"2019-06-01').keys[0].value)]"}, {"name": "website_contentshare", "value": "[tolower(parameters('functionappname'))]"}, {"name": "website_time_zone", "value": "[parameters('timezone')]"}]}, "name": "[parameters('functionappname')]", "clientaffinityenabled": false, "serverfarmid": "[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]"}}{"type": "microsoft.web/serverfarms", "apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]"}, "sku": {"name": "y1", "tier": "dynamic", "size": "y1", "family": "y", "capacity": 0}}
Create and assign a standard App Service Certificate
{"type": "microsoft.web/sites/domainownershipidentifiers", "name": "[concat(parameters('existingappname'), concat('/", parameters('certificateordername')))]", "apiversion": "2016-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))]"], "properties": {"id": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).domainverificationtoken]"}}{"type": "microsoft.web/certificates", "name": "[parameters('certificateordername')]", "apiversion": "2015-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.certificateregistration/certificateorders/certificates", parameters('certificateordername'), parameters('certificateordername'))]"], "properties": {"keyvaultid": "[parameters('existingkeyvaultid')]", "keyvaultsecretname": "[parameters('certificateordername')]"}}{"type": "microsoft.web/sites", "name": "[parameters('existingappname')]", "apiversion": "2015-08-01", "location": "[parameters('existingapplocation')]", "dependson": ["[resourceid('microsoft.web/certificates", parameters('certificateordername'))]"], "properties": {"name": "[parameters('existingappname')]", "hostnamesslstates": [{"name": "[parameters('roothostname')]", "sslstate": 1, "thumbprint": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).signedcertificate.thumbprint]", "toupdate": true}, {"name": "[variables('wwwhostname')]", "sslstate": 1, "thumbprint": "[reference(resourceid('microsoft.certificateregistration/certificateorders", parameters('certificateordername'))).signedcertificate.thumbprint]", "toupdate": true}]}}
Create a web app on Azure with Python enabled.
{"apiversion": "2020-06-01", "name": "[parameters('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "tags": {"displayname": "hostingplan"}, "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('skucapacity')]"}, "properties": {"name": "[parameters('hostingplanname')]", "reserved": true}}{"apiversion": "2020-06-01", "name": "[parameters('websitename')]", "type": "microsoft.web/sites", "location": "[parameters('location')]", "tags": {"[concat('hidden-related:", resourcegroup().id, "/providers/microsoft.web/serverfarms/", parameters('hostingplanname'))]": "resource", "displayname": "website"}, "dependson": ["[resourceid('microsoft.web/serverfarms/", parameters('hostingplanname'))]"], "properties": {"name": "[parameters('websitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", parameters('hostingplanname'))]", "siteconfig": {"linuxfxversion": "python|3.7"}}}
This template provides a easy way to deploy a Sonarqube docker image (alpine tag) on a Linux Web App with Azure database for PostgreSQL(Preview).
{"comments": "this is the linux web app with the sonarquebe docker image", "type": "microsoft.web/sites", "name": "[parameters('sitename')]", "apiversion": "2020-06-01", "location": "[parameters('location')]", "dependson": ["[variables('hostingplanname')]", "[variables('databasename')]"], "properties": {"siteconfig": {"linuxfxversion": "docker|sonarqube"}, "name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"name": "appsettings", "type": "config", "apiversion": "2020-06-01", "dependson": ["[resourceid('microsoft.web/sites", parameters('sitename'))]"], "tags": {"displayname": "sonarappsettings"}, "comments": "this are the generated settings for the sonar jdbc connectionstring", "properties": {"sonarqube_jdbc_url": "[concat('jdbc:postgresql://", reference(resourceid('microsoft.dbforpostgresql/servers",variables('servername'))).fullyqualifieddomainname ,":5432/",variables('databasename'),"?user=", variables('jdbcsonarusername'), "&password=",parameters('administratorloginpassword'), "&ssl=true')]", "sonarqube_jdbc_username": "[variables('jdbcsonarusername')]", "sonarqube_jdbc_password": "[parameters('administratorloginpassword')]"}}]}{"apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]", "workersizeid": "1", "reserved": true, "numberofworkers": "1"}, "sku": {"tier": "[parameters('serviceplantier')]", "name": "[parameters('serviceplansku')]"}, "kind": "linux"}
This template provides a easy way to deploy a Sonarqube docker image (alpine tag) on a Linux Web App with Azure database for MySQL.
{"comments": "this is the linux web app with the sonarquebe docker image and the db", "type": "microsoft.web/sites", "name": "[parameters('sitename')]", "apiversion": "2019-08-01", "location": "[parameters('location')]", "dependson": ["[variables('hostingplanname')]", "[variables('databasename')]"], "properties": {"siteconfig": {"linuxfxversion": "docker|sonarqube"}, "name": "[parameters('sitename')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "resources": [{"comments": "this are the generated settings for the sonar jdbc connectionstring", "name": "appsettings", "type": "config", "apiversion": "2019-08-01", "dependson": ["[resourceid('microsoft.web/sites", parameters('sitename'))]"], "tags": {"displayname": "sonarappsettings"}, "properties": {"sonarqube_jdbc_url": "[concat('jdbc:mysql://", reference(resourceid('microsoft.dbformysql/servers",variables('servername'))).fullyqualifieddomainname , ":3306/",variables('databasename'),"?verifyservercertificate=true&usessl=true&requiressl=false&useunicode=true&characterencoding=utf8')]", "sonarqube_jdbc_username": "[variables('jdbcsonarusername')]", "sonarqube_jdbc_password": "[parameters('administratorloginpassword')]"}}]}{"apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "type": "microsoft.web/serverfarms", "location": "[parameters('location')]", "properties": {"name": "[variables('hostingplanname')]", "workersizeid": "1", "reserved": true, "numberofworkers": "1"}, "sku": {"tier": "[parameters('serviceplantier')]", "name": "[parameters('serviceplansku')]"}, "kind": "linux"}
Provision a Mobile App with a SQL Database
{"type": "microsoft.web/serverfarms", "apiversion": "2019-08-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('hostingplansettings').skuname]", "tier": "[parameters('hostingplansettings').tier]", "capacity": "[parameters('hostingplansettings').capacity]"}, "properties": {"numberofworkers": 1}}{"apiversion": "2019-08-01", "type": "microsoft.web/sites", "name": "[variables('uniqueappname')]", "location": "[parameters('location')]", "kind": "mobileapp", "properties": {"name": "[variables('uniqueappname')]", "serverfarmid": "[resourceid('microsoft.web/serverfarms", variables('hostingplanname'))]"}, "dependson": ["[variables('hostingplanname')]"], "resources": [{"apiversion": "2019-08-01", "name": "appsettings", "type": "config", "dependson": ["[variables('uniqueappname')]"], "properties": {"ms_mobileservicename": "[variables('uniqueappname')]", "ms_notificationhubname": "[variables('notificationhubname')]"}}, {"apiversion": "2019-08-01", "name": "connectionstrings", "type": "config", "dependson": ["[variables('uniqueappname')]", "[variables('notificationhubname')]", "[variables('databasename')]"], "properties": {"ms_tableconnectionstring": {"value": "[concat('data source=tcp:", reference(resourceid('microsoft.sql/servers", variables('databaseservername'))).fullyqualifieddomainname, ",1433;initial catalog=", variables('databasename'), ";user id=", parameters('sqlserveradminlogin'), "@", variables('databaseservername'), ";password=", parameters('sqlserveradminpassword'), ";')]", "type": "sqlserver"}, "ms_notificationhubconnectionstring": {"value": "[listkeys(resourceid('microsoft.notificationhubs/namespaces/notificationhubs/authorizationrules", variables('notificationhubnamespace'), variables('notificationhubname'), "defaultfullsharedaccesssignature'), "2017-04-01').primaryconnectionstring]", "type": "custom"}}}, {"apiversion": "2019-08-01", "type": "providers/links", "name": "microsoft.resources/sitetohub", "dependson": ["[variables('uniqueappname')]", "[variables('notificationhubname')]"], "properties": {"targetid": "[resourceid('microsoft.notificationhubs/namespaces/notificationhubs", variables('notificationhubnamespace'), variables('notificationhubname'))]"}}]}
Deploy an App Service that supports Python. It gives you the support to deploy your own Django app.
{"type": "microsoft.web/sites", "apiversion": "2020-06-01", "name": "[parameters('webappname')]", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]", "[resourceid('microsoft.insights/components", variables('appinsights'))]"], "properties": {"siteconfig": {"appsettings": [{"name": "websites_enable_app_service_storage", "value": "false"}, {"name": "appinsights_instrumentationkey", "value": "[reference(resourceid('microsoft.insights/components/", variables('appinsights'))).instrumentationkey]"}, {"name": "xdt_microsoftapplicationinsights_mode", "value": "default"}, {"name": "applicationinsightsagent_extension_version", "value": "~2"}], "linuxfxversion": "docker|appsvcorg/django-python:0.1"}, "name": "[parameters('webappname')]", "clientaffinityenabled": false, "serverfarmid": "[resourceid('microsoft.web/serverfarms/", variables('hostingplanname'))]"}}{"type": "microsoft.web/serverfarms", "apiversion": "2020-06-01", "name": "[variables('hostingplanname')]", "location": "[parameters('location')]", "sku": {"tier": "[variables('sku')]", "name": "[variables('skucode')]"}, "kind": "linux", "properties": {"name": "[variables('hostingplanname')]", "workersizeid": "[variables('workersize')]", "reserved": true, "numberofworkers": "1"}}
Deploys a Log Analytics workspace with VM Insights, Container Insights solutions and diagnostics.
{"type": "microsoft.insights/diagnosticsettings", "apiversion": "2017-05-01-preview", "scope": "[format('microsoft.operationalinsights/workspaces/{0}", parameters('loganalyticsworkspacename'))]", "name": "diagnosticsettings", "properties": {"workspaceid": "[resourceid('microsoft.operationalinsights/workspaces", parameters('loganalyticsworkspacename'))]", "logs": [{"category": "audit", "enabled": true, "retentionpolicy": {"days": 7, "enabled": true}}], "metrics": [{"category": "allmetrics", "enabled": true, "retentionpolicy": {"days": 7, "enabled": true}}]}, "dependson": ["[resourceid('microsoft.operationalinsights/workspaces", parameters('loganalyticsworkspacename'))]"]}
This template creates an Application Insights availability test along with a metric alert rule that monitors it.
{"name": "[variables('pingtestname')]", "type": "microsoft.insights/webtests", "apiversion": "2015-05-01", "location": "[parameters('location')]", "tags": {"[concat('hidden-link:", parameters('appinsightsresource'))]": "resource"}, "properties": {"name": "[variables('pingtestname')]", "description": "basic ping test", "enabled": true, "frequency": 300, "timeout": 120, "kind": "ping", "retryenabled": true, "locations": [{"id": "[parameters('webtestlocations')]"}], "configuration": {"webtest": "[concat(\"<webtest name="\", variables(\"pingtestname\'), \"" enabled="true" cssprojectstructure="" cssiteration="" timeout="120" workitemids="" xmlns="http://microsoft.com/schemas/visualstudio/teamtest/2010" description="" credentialusername="" credentialpassword="" preauthenticate="true" proxy="default" stoponerror="false" recordedresultfile="" resultslocale=""> <items> <request method="get" version="1.1" url="\", parameters(\"pingurl\'), \"" thinktime="0" timeout="300" parsedependentrequests="true" followredirects="true" recordresult="true" cache="false" responsetimegoal="0" encoding="utf-8" expectedhttpstatuscode="200" expectedresponseurl="" reportingname="" ignorehttpstatuscode="false" /> </items> <validationrules> <validationrule classname="microsoft.visualstudio.testtools.webtesting.rules.validationrulefindtext, microsoft.visualstudio.qualitytools.webtestframework, version=10.0.0.0, culture=neutral, publickeytoken=b03f5f7f11d50a3a" displayname="find text" description="verifies the existence of the specified text in the response." level="high" executionorder="beforedependents"> <ruleparameters> <ruleparameter name="findtext" value="\", parameters(\"pingtext\'), \"" /> <ruleparameter name="ignorecase" value="false" /> <ruleparameter name="useregularexpression" value="false" /> <ruleparameter name="passiftextfound" value="true" /> </ruleparameters> </validationrule> </validationrules> </webtest>\')]"}, "syntheticmonitorid": "[variables('pingtestname')]"}}{"name": "[variables('pingalertrulename')]", "type": "microsoft.insights/metricalerts", "apiversion": "2018-03-01", "location": "global", "dependson": ["[resourceid('microsoft.insights/webtests", variables('pingtestname'))]"], "tags": {"[concat('hidden-link:", parameters('appinsightsresource'))]": "resource", "[concat('hidden-link:", resourceid('microsoft.insights/webtests", variables('pingtestname')))]": "resource"}, "properties": {"description": "alert for web test", "severity": 1, "enabled": true, "scopes": ["[resourceid('microsoft.insights/webtests",variables('pingtestname'))]", "[parameters('appinsightsresource')]"], "evaluationfrequency": "pt1m", "windowsize": "pt5m", "criteria": {"odata.type": "microsoft.azure.monitor.webtestlocationavailabilitycriteria", "webtestid": "[resourceid('microsoft.insights/webtests", variables('pingtestname'))]", "componentid": "[parameters('appinsightsresource')]", "failedlocationcount": 2}}}
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a dynamic threshold condition type.
{"name": "[parameters('alertname')]", "type": "microsoft.insights/metricalerts", "location": "global", "apiversion": "2018-03-01", "properties": {"description": "[parameters('alertdescription')]", "severity": "[parameters('alertseverity')]", "enabled": "[parameters('isenabled')]", "scopes": ["[parameters('resourceid')]"], "evaluationfrequency": "[parameters('evaluationfrequency')]", "windowsize": "[parameters('windowsize')]", "criteria": {"odata.type": "microsoft.azure.monitor.multipleresourcemultiplemetriccriteria", "allof": [{"criteriontype": "dynamicthresholdcriterion", "name": "1st criterion", "metricname": "[parameters('metricname')]", "operator": "[parameters('operator')]", "alertsensitivity": "[parameters('alertsensitivity')]", "failingperiods": {"numberofevaluationperiods": "[parameters('numberofevaluationperiods')]", "minfailingperiodstoalert": "[parameters('minfailingperiodstoalert')]"}, "ignoredatabefore": "[parameters('ignoredatabefore')]", "timeaggregation": "[parameters('timeaggregation')]"}]}}}
This template creates a metric alert rule that monitors the CPU Percentage metric of a virtual machine using a static threshold condition type.
{"name": "[parameters('alertname')]", "type": "microsoft.insights/metricalerts", "location": "global", "apiversion": "2018-03-01", "properties": {"description": "[parameters('alertdescription')]", "severity": "[parameters('alertseverity')]", "enabled": "[parameters('isenabled')]", "scopes": ["[parameters('resourceid')]"], "evaluationfrequency": "[parameters('evaluationfrequency')]", "windowsize": "[parameters('windowsize')]", "criteria": {"odata.type": "microsoft.azure.monitor.singleresourcemultiplemetriccriteria", "allof": [{"name": "1st criterion", "metricname": "[parameters('metricname')]", "operator": "[parameters('operator')]", "threshold": "[parameters('threshold')]", "timeaggregation": "[parameters('timeaggregation')]"}]}}}
Deploys a Log Analytics workspace with specified solutions and data sources
{"condition": "[parameters('enablediagnostics')]", "type": "microsoft.insights/diagnosticsettings", "apiversion": "2021-05-01-preview", "scope": "[format('microsoft.operationalinsights/workspaces/{0}", parameters('name'))]", "name": "[variables('diagnosticsname')]", "properties": {"workspaceid": "[resourceid('microsoft.operationalinsights/workspaces", parameters('name'))]", "storageaccountid": "[resourceid(parameters('diagnosticstorageaccountresourcegroup'), "microsoft.storage/storageaccounts", parameters('diagnosticstorageaccountname'))]", "logs": [{"category": "audit", "enabled": true}], "metrics": [{"category": "allmetrics", "enabled": true}]}, "dependson": ["[resourceid('microsoft.operationalinsights/workspaces", parameters('name'))]"]}
Creates an Azure service health alert that emails service administrators and others during certain Azure service incidents.
{"type": "microsoft.insights/activitylogalerts", "apiversion": "2017-04-01", "name": "[parameters('alertname')]", "location": "global", "properties": {"enabled": true, "scopes": ["[subscription().id]"], "condition": {"allof": [{"field": "category", "equals": "resourcehealth"}, {"field": "status", "equals": "[parameters('status')]"}]}, "actions": {"actiongroups": [{"actiongroupid": "[resourceid('microsoft.insights/actiongroups","emailactiongroup')]"}]}}}{"name": "emailactiongroup", "type": "microsoft.insights/actiongroups", "apiversion": "2019-06-01", "location": "global", "properties": {"groupshortname": "string", "enabled": true, "emailreceivers": [{"name": "[parameters('emailname')]", "emailaddress": "[parameters('emailaddress')]", "usecommonalertschema": true}]}}
This template grants applicable role based access to an existing VM in a existing Resource Group
{"scope": "[concat('microsoft.compute/virtualmachines/", parameters('virtualmachinename'))]", "type": "microsoft.authorization/roleassignments", "apiversion": "2020-04-01-preview", "name": "[variables('roleassignmentname')]", "properties": {"roledefinitionid": "[variables('role')[parameters('builtinroletype')]]", "principalid": "[parameters('principalid')]"}}
Assign a role-based access control role to an existing Resource Manager group.
{"type": "microsoft.authorization/roleassignments", "apiversion": "2021-04-01-preview", "name": "[variables('roleassignmentname')]", "properties": {"roledefinitionid": "[resourceid('microsoft.authorization/roledefinitions", parameters('roledefinitionid'))]", "principalid": "[parameters('principalid')]"}}
Assign a built-in policy to an existing resource group
{"type": "microsoft.authorization/policyassignments", "name": "[parameters('policyassignmentname')]", "apiversion": "2019-09-01", "properties": {"scope": "[subscriptionresourceid('microsoft.resources/resourcegroups", resourcegroup().name)]", "policydefinitionid": "[parameters('policydefinitionid')]"}}
This template grants applicable role based access to an multiple existing VMs in a existing Resource Group
{"scope": "[concat('microsoft.compute/virtualmachines/", parameters('virtualmachinename1'))]", "type": "microsoft.authorization/roleassignments", "apiversion": "2020-04-01-preview", "name": "[variables('roleassignmentname1')]", "properties": {"roledefinitionid": "[variables('role')[parameters('builtinroletype')]]", "principalid": "[parameters('principalid')]"}}{"scope": "[concat('microsoft.compute/virtualmachines/", parameters('virtualmachinename2'))]", "type": "microsoft.authorization/roleassignments", "apiversion": "2020-04-01-preview", "name": "[variables('roleassignmentname2')]", "properties": {"roledefinitionid": "[variables('role')[parameters('builtinroletype')]]", "principalid": "[parameters('principalid')]"}}
A template for creating a new Cognitive Services Translation API. Use this template as the framework for your custom deployment.
{"type": "microsoft.cognitiveservices/accounts", "apiversion": "2017-04-18", "name": "[parameters('accountname')]", "location": "[parameters('translatelocation')]", "kind": "texttranslation", "sku": {"name": "[parameters('sku')]"}, "properties": {}}
A template for creating a new Cognitive Services Computer Vision API. Use this template as the framework for your custom deployment. This template was originally created by Marco Mansi (@olandese).
{"type": "microsoft.cognitiveservices/accounts", "apiversion": "2017-04-18", "name": "[parameters('accountname')]", "location": "[parameters('location')]", "kind": "computervision", "sku": {"name": "[parameters('sku')]"}, "properties": {}}
Deploy a cognitive service with an universal key.
{"type": "microsoft.cognitiveservices/accounts", "apiversion": "2017-04-18", "name": "[parameters('cognitiveservicename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]"}, "kind": "cognitiveservices", "properties": {"statisticsenabled": false}}
Create a Redis Cache using a template. Diagnostics data for the cache is kept in a storage account.
{"type": "microsoft.cache/redis", "apiversion": "2020-06-01", "name": "[parameters('rediscachename')]", "location": "[parameters('location')]", "properties": {"enablenonsslport": "[parameters('enablenonsslport')]", "minimumtlsversion": "1.2", "sku": {"capacity": "[parameters('rediscachecapacity')]", "family": "[parameters('rediscachefamily')]", "name": "[parameters('rediscachesku')]"}}}
This template provides two Azure Cache for Redis instances with the benefits of Virtual Network and geo-replication support.
{"type": "microsoft.cache/redis", "apiversion": "2020-06-01", "name": "[parameters('newprimarycachename')]", "location": "[parameters('location')]", "properties": {"sku": {"name": "premium", "family": "p", "capacity": 1}, "subnetid": "[variables('primarysubnetid')]"}, "comments": "create a premium cache in the primary location in the primary virtual network."}{"type": "microsoft.cache/redis", "apiversion": "2020-06-01", "name": "[parameters('newsecondarycachename')]", "location": "[parameters('secondarylocation')]", "comments": "create a premium cache in the secondary location in the secondary virtual network.", "properties": {"sku": {"name": "premium", "family": "p", "capacity": 1}, "subnetid": "[variables('secondarysubnetid')]"}}{"type": "microsoft.cache/redis/linkedservers", "apiversion": "2020-06-01", "name": "[concat(parameters('newprimarycachename'), "/", parameters('newsecondarycachename'))]", "dependson": ["[resourceid('microsoft.cache/redis", parameters('newprimarycachename'))]", "[resourceid('microsoft.cache/redis", parameters('newsecondarycachename'))]"], "comments": "create a geo-replication link. this resource is created as a nested resource of the primary cache. its name is fixed and cannot be changed. its properties identifies the secondary cache and labels it as the secondary.", "properties": {"linkedrediscacheid": "[resourceid('microsoft.cache/redis", parameters('newsecondarycachename'))]", "linkedrediscachelocation": "[parameters('secondarylocation')]", "serverrole": "secondary"}}
Clustering provides the ability to split your dataset among multiple nodes, to continue operations when a subset of the nodes has problems, more throughput, and more memory size.
{"type": "microsoft.cache/redis", "apiversion": "2020-06-01", "name": "[parameters('rediscachename')]", "location": "[parameters('location')]", "properties": {"enablenonsslport": "[parameters('enablenonsslport')]", "minimumtlsversion": "1.2", "sku": {"capacity": "[parameters('rediscachecapacity')]", "family": "[parameters('rediscachefamily')]", "name": "[parameters('rediscachesku')]"}}}
Create and configre persistence in premium Redis Cache using a template. Redis persistence enables you to take snapshots and back up the data which you can load in case of a hardware failure.
{"type": "microsoft.cache/redis", "apiversion": "2020-06-01", "name": "[parameters('rediscachename')]", "location": "[parameters('location')]", "properties": {"enablenonsslport": "[parameters('enablenonsslport')]", "minimumtlsversion": "1.2", "sku": {"capacity": "[parameters('rediscachecapacity')]", "family": "[parameters('rediscachefamily')]", "name": "[parameters('rediscachesku')]"}, "redisconfiguration": {"rdb-backup-enabled": "true", "rdb-backup-frequency": "60", "rdb-backup-max-snapshot-count": "1", "rdb-storage-connection-string": "[format('defaultendpointsprotocol=https;blobendpoint=https://{0}.blob.{1};accountname={2};accountkey={3}", parameters('storageaccountname'), environment().suffixes.storage, parameters('storageaccountname'), listkeys(resourceid('microsoft.storage/storageaccounts", parameters('storageaccountname')), "2021-04-01').keys[0].value)]"}}}
This template creates a Pay As You Go (PAYG) Time Series Insights environment, a child event source that reads events from an IoT Hub, and optionally a source IoT Hub.
{"type": "microsoft.timeseriesinsights/environments", "apiversion": "2018-08-15-preview", "name": "[parameters('environmentname')]", "location": "[parameters('location')]", "kind": "[parameters('environmentkind')]", "tags": "[variables('environmenttagsvalue')]", "properties": {"storageconfiguration": {"accountname": "[variables('storageaccountname')]", "managementkey": "[listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2019-06-01').keys[0].value]"}, "timeseriesidproperties": "[parameters('environmenttimeseriesidproperties')]", "warmstoreconfiguration": {"dataretention": "[parameters('warmstoredataretention')]"}}, "sku": {"name": "[parameters('environmentskuname')]", "capacity": "[parameters('environmentskucapacity')]"}, "resources": [{"type": "eventsources", "apiversion": "2018-08-15-preview", "name": "[parameters('eventsourcename')]", "location": "[parameters('location')]", "kind": "microsoft.iothub", "dependson": ["[resourceid('microsoft.timeseriesinsights/environments", parameters('environmentname'))]", "[resourceid('microsoft.devices/iothubs", parameters('iothubname'))]", "[resourceid('microsoft.devices/iothubs/eventhubendpoints/consumergroups", parameters('iothubname'), "events", parameters('consumergroupname'))]"], "tags": "[variables('eventsourcetagsvalue')]", "properties": {"eventsourceresourceid": "[variables('eventsourceresourceid')]", "iothubname": "[parameters('iothubname')]", "consumergroupname": "[parameters('consumergroupname')]", "keyname": "[parameters('eventsourcekeyname')]", "sharedaccesskey": "[listkeys(resourceid('microsoft.devices/iothubs/iothubkeys", parameters('iothubname'), parameters('eventsourcekeyname')), "2020-03-01').primarykey]", "timestamppropertyname": "[parameters('eventsourcetimestamppropertyname')]"}}]}{"condition": "[not(empty(parameters('accesspolicyreaderobjectids')))]", "type": "microsoft.timeseriesinsights/environments/accesspolicies", "apiversion": "2018-08-15-preview", "name": "[concat(parameters('environmentname'), "/", "readeraccesspolicy", copyindex())]", "dependson": ["[resourceid('microsoft.timeseriesinsights/environments", parameters('environmentname'))]"], "copy": {"name": "accesspolicyreadercopy", "count": "[if(empty(parameters('accesspolicyreaderobjectids')), 1, length(parameters('accesspolicyreaderobjectids')))]"}, "properties": {"principalobjectid": "[parameters('accesspolicyreaderobjectids')[copyindex()]]", "roles": ["reader"]}}{"condition": "[not(empty(parameters('accesspolicycontributorobjectids')))]", "type": "microsoft.timeseriesinsights/environments/accesspolicies", "apiversion": "2018-08-15-preview", "name": "[concat(parameters('environmentname'), "/", "contributoraccesspolicy", copyindex())]", "dependson": ["[resourceid('microsoft.timeseriesinsights/environments", parameters('environmentname'))]"], "copy": {"name": "accesspolicycontributorcopy", "count": "[if(empty(parameters('accesspolicycontributorobjectids')), 1, length(parameters('accesspolicycontributorobjectids')))]"}, "properties": {"principalobjectid": "[parameters('accesspolicycontributorobjectids')[copyindex()]]", "roles": ["contributor"]}}
This template deploys a Disk pool into an exsisting vnet.
{"type": "microsoft.storagepool/diskpools", "apiversion": "2021-08-01", "name": "[parameters('diskpoolname')]", "sku": {"name": "[parameters('diskpoolsku')]"}, "location": "[parameters('diskpoollocation')]", "properties": {"availabilityzones": ["[parameters('diskpoolavailabilityzone')]"], "subnetid": "[variables('subnetid')]", "disks": [{"id": "[variables('diskid')]"}]}}{"type": "microsoft.storagepool/diskpools/iscsitargets", "apiversion": "2021-08-01", "name": "[format('{0}/{1}", parameters('diskpoolname'), parameters('targetname'))]", "properties": {"targetiqn": "iqn.2021-04.org.microsoft.com:target", "aclmode": "dynamic", "luns": [{"manageddiskazureresourceid": "[variables('diskid')]", "name": "lun0"}]}, "dependson": ["[resourceid('microsoft.storagepool/diskpools", parameters('diskpoolname'))]"]}
Create an Azure Security Center Automation which will be triggered by any Security Center Alert(including all severities)
{"apiversion": "2019-01-01-preview", "location": "[parameters('location')]", "name": "[parameters('automationname')]", "type": "microsoft.security/automations", "properties": {"description": "[format(variables('automationdescription'),"{0}", parameters('subscriptionid'))]", "isenabled": true, "actions": [{"actiontype": "logicapp", "logicappresourceid": "[resourceid('microsoft.logic/workflows", parameters('logicappname'))]", "uri": "[listcallbackurl(resourceid(parameters('subscriptionid'), parameters('logicappresourcegroupname'), "microsoft.logic/workflows/triggers", parameters('logicappname'), "manual'), "2019-05-01').value]"}], "scopes": [{"description": "[format(variables('scopedescription'),"{0}", parameters('subscriptionid'))]", "scopepath": "[subscription().id]"}], "sources": [{"eventsource": "alerts", "eventversiontype": "api", "copy": [{"name": "rulesets", "count": "[length(parameters('alertsettings').alertseveritymapping)]", "input": {"rules": [{"propertyjpath": "[parameters('alertsettings').alertseveritymapping[copyindex('rulesets')].jpath]", "propertytype": "string", "expectedvalue": "[parameters('alertsettings').alertseveritymapping[copyindex('rulesets')].expectedvalue]", "operator": "[parameters('alertsettings').alertseveritymapping[copyindex('rulesets')].operator]"}, {"propertyjpath": "severity", "propertytype": "string", "expectedvalue": "[parameters('alertsettings').alertseveritymapping[copyindex('rulesets')].severity]", "operator": "equals"}]}}]}]}}
Create an Azure Security Center Automation which will be triggered by a specific Security Center Recommendation and unhealthy state
{"apiversion": "2019-01-01-preview", "location": "[parameters('location')]", "name": "[parameters('automationname')]", "type": "microsoft.security/automations", "properties": {"description": "[format(variables('automationdescription'),"{0}", parameters('subscriptionid'))]", "isenabled": true, "actions": [{"actiontype": "logicapp", "logicappresourceid": "[resourceid('microsoft.logic/workflows", parameters('logicappname'))]", "uri": "[listcallbackurl(resourceid(parameters('subscriptionid'), parameters('logicappresourcegroupname'), "microsoft.logic/workflows/triggers", parameters('logicappname'), "manual'), "2019-05-01').value]"}], "scopes": [{"description": "[format(variables('scopedescription'),"{0}", parameters('subscriptionid'))]", "scopepath": "[subscription().id]"}], "sources": [{"eventsource": "assessments", "eventversiontype": "api", "copy": [{"name": "rulesets", "count": "[length(parameters('assessmentsettings').assessmentseveritymapping)]", "input": {"rules": [{"propertyjpath": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].jpath]", "propertytype": "string", "expectedvalue": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].assessmentname]", "operator": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].operator]"}, {"propertyjpath": "properties.status.code", "propertytype": "string", "expectedvalue": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].state]", "operator": "contains"}]}}]}]}}
Create an Azure Security Center Automation which will be triggered by any Security Center Recommendation and state
{"apiversion": "2019-01-01-preview", "location": "[parameters('location')]", "name": "[parameters('automationname')]", "type": "microsoft.security/automations", "properties": {"description": "[format(variables('automationdescription'),"{0}", parameters('subscriptionid'))]", "isenabled": true, "actions": [{"actiontype": "logicapp", "logicappresourceid": "[resourceid('microsoft.logic/workflows", parameters('logicappname'))]", "uri": "[listcallbackurl(resourceid(parameters('subscriptionid'), parameters('logicappresourcegroupname'), "microsoft.logic/workflows/triggers", parameters('logicappname'), "manual'), "2019-05-01').value]"}], "scopes": [{"description": "[format(variables('scopedescription'),"{0}", parameters('subscriptionid'))]", "scopepath": "[subscription().id]"}], "sources": [{"eventsource": "assessments", "eventversiontype": "api", "copy": [{"name": "rulesets", "count": "[length(parameters('assessmentsettings').assessmentseveritymapping)]", "input": {"rules": [{"propertyjpath": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].jpath]", "propertytype": "string", "expectedvalue": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].assessmentname]", "operator": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].operator]"}, {"propertyjpath": "properties.status.code", "propertytype": "string", "expectedvalue": "[parameters('assessmentsettings').assessmentseveritymapping[copyindex('rulesets')].state]", "operator": "contains"}]}}]}]}}
This template creates a Azure Key Vault Managed HSM.
{"type": "microsoft.keyvault/managedhsms", "apiversion": "2021-04-01-preview", "name": "[parameters('managedhsmname')]", "location": "[parameters('location')]", "sku": {"name": "standard_b1", "family": "b"}, "properties": {"enablesoftdelete": "[greater(parameters('softretentionindays'), 0)]", "softdeleteretentionindays": "[if(equals(parameters('softretentionindays'), 0), null(), parameters('softretentionindays'))]", "enablepurgeprotection": false, "tenantid": "[parameters('tenantid')]", "initialadminobjectids": "[parameters('initialadminobjectids')]", "publicnetworkaccess": "enabled", "networkacls": {"bypass": "none", "defaultaction": "allow"}}}
Creates a Key Vault with a list of secrets
{"type": "microsoft.keyvault/vaults", "apiversion": "2021-04-01-preview", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "properties": {"enabledfordeployment": "[parameters('enabledfordeployment')]", "enabledfortemplatedeployment": "[parameters('enabledfortemplatedeployment')]", "enabledfordiskencryption": "[parameters('enabledfordiskencryption')]", "tenantid": "[parameters('tenantid')]", "accesspolicies": [{"objectid": "[parameters('objectid')]", "tenantid": "[parameters('tenantid')]", "permissions": {"keys": "[parameters('keyspermissions')]", "secrets": "[parameters('secretspermissions')]"}}], "sku": {"name": "[parameters('skuname')]", "family": "a"}, "networkacls": {"defaultaction": "allow", "bypass": "azureservices"}}}{"copy": {"name": "secrets", "count": "[length(parameters('secretsobject').secrets)]"}, "type": "microsoft.keyvault/vaults/secrets", "apiversion": "2021-04-01-preview", "name": "[format('{0}/{1}", parameters('keyvaultname'), parameters('secretsobject').secrets[copyindex()].secretname)]", "properties": {"value": "[parameters('secretsobject').secrets[copyindex()].secretvalue]"}, "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"]}
This template creates a Key Vault and assigns permissions to the supplied objectId (principal) through Azure RBAC.
{"type": "microsoft.keyvault/vaults", "apiversion": "2021-04-01-preview", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "properties": {"enabledfordeployment": "[parameters('enabledfordeployment')]", "enabledfordiskencryption": "[parameters('enabledfordiskencryption')]", "enabledfortemplatedeployment": "[parameters('enabledfortemplatedeployment')]", "enablerbacauthorization": true, "tenantid": "[parameters('tenantid')]", "sku": {"name": "[parameters('skuname')]", "family": "a"}, "networkacls": {"defaultaction": "allow", "bypass": "azureservices"}}}{"type": "microsoft.keyvault/vaults/secrets", "apiversion": "2021-04-01-preview", "name": "[format('{0}/{1}", parameters('keyvaultname'), parameters('secretname'))]", "properties": {"value": "[parameters('secretvalue')]"}, "dependson": ["[resourceid('microsoft.keyvault/vaults", parameters('keyvaultname'))]"]}
This template shows how to add a new access policy to an existing KeyVault without removing all existing policies.
{"type": "microsoft.keyvault/vaults/accesspolicies", "name": "[concat(parameters('keyvaultname'), "/add')]", "apiversion": "2019-09-01", "properties": {"accesspolicies": [{"tenantid": "[parameters('tenantid')]", "objectid": "[parameters('objectid')]", "permissions": {"secrets": "[parameters('secretspermissions')]"}}]}}
This template creates a vnet and a subnet hosting a Linux virtual machine that accesses Key Vault with a private endpoint.
{"apiversion": "2019-09-01", "type": "microsoft.keyvault/vaults", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "dependson": ["[variables('vmid')]"], "properties": {"tenantid": "[parameters('tenantid')]", "sku": {"name": "[parameters('skuname')]", "family": "a"}, "enabledfordeployment": "[parameters('enabledfordeployment')]", "enabledfortemplatedeployment": "[parameters('enabledfortemplatedeployment')]", "enabledfordiskencryption": "[parameters('enabledfordiskencryption')]", "enablesoftdelete": "[parameters('enablesoftdelete')]", "softdeleteretentionindays": "[parameters('softdeleteretentionindays')]", "enablerbacauthorization": "[parameters('enablerbacauthorization')]", "accesspolicies": [{"tenantid": "[parameters('tenantid')]", "objectid": "[reference(variables('vmid'), "2019-12-01", "full').identity.principalid]", "permissions": {"keys": "[parameters('keyspermissions')]", "secrets": "[parameters('secretspermissions')]", "certificates": "[parameters('certificatespermissions')]"}}]}}{"apiversion": "2019-09-01", "type": "microsoft.keyvault/vaults/secrets", "name": "[concat(parameters('keyvaultname'), "/", parameters('secretsarray')[copyindex()].secretname)]", "dependson": ["[variables('keyvaultid')]"], "copy": {"name": "secretscopy", "count": "[length(parameters('secretsarray'))]"}, "properties": {"value": "[parameters('secretsarray')[copyindex()].secretvalue]"}}
Create an Azure Analysis Services server.
{"type": "microsoft.analysisservices/servers", "apiversion": "2017-08-01", "name": "[parameters('servername')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "capacity": "[parameters('capacity')]"}, "properties": {"ipv4firewallsettings": "[parameters('firewallsettings')]", "backupblobcontaineruri": "[parameters('backupblobcontaineruri')]"}}
Create an Azure CosmosDB Account with Advanced Threat Protection (preview).
{"name": "[parameters('name')]", "type": "microsoft.documentdb/databaseaccounts", "apiversion": "2020-09-01", "location": "[parameters('location')]", "properties": {"locations": [{"locationname": "[parameters('location')]"}], "databaseaccountoffertype": "[parameters('tier')]"}, "resources": [{"condition": "[parameters('advancedthreatprotectionenabled')]", "type": "providers/advancedthreatprotectionsettings", "name": "microsoft.security/current", "apiversion": "2019-01-01", "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/", parameters('name'))]"], "properties": {"isenabled": true}}]}
Create an Azure Cosmos DB Account with a virtual network and a private endpoint
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[parameters('accountname')]", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"consistencypolicy": {"defaultconsistencylevel": "session"}, "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": false, "enablemultiplewritelocations": false, "publicnetworkaccess": "[parameters('publicnetworkaccess')]"}}
This template creates an Azure Cosmos account, injects the Cosmos DB endpoint and keys into Azure Web App settings, then deploys an ASP MVC web app from GitHub.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('cosmosaccountname')]", "kind": "globaldocumentdb", "location": "[parameters('location')]", "properties": {"consistencypolicy": {"defaultconsistencylevel": "session"}, "locations": [{"locationname": "[parameters('location')]", "failoverpriority": 0, "iszoneredundant": false}], "databaseaccountoffertype": "standard"}}
Create an Azure CosmosDB Account
{"name": "[parameters('name')]", "type": "microsoft.documentdb/databaseaccounts", "apiversion": "2020-04-01", "location": "[parameters('location')]", "properties": {"locations": [{"locationname": "[parameters('location')]"}], "databaseaccountoffertype": "[parameters('tier')]"}}
This template creates an Azure Cosmos DB account for MongoDB API (3.2, 3.6 or 4.0) in two regions using shared autoscale database throughput with two collections.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var')]", "location": "[parameters('location')]", "kind": "mongodb", "properties": {"consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "apiproperties": {"serverversion": "[parameters('serverversion')]"}}}{"type": "microsoft.documentdb/databaseaccounts/mongodbdatabases", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}, "options": {"autoscalesettings": {"maxthroughput": "[parameters('autoscalemaxthroughput')]"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/mongodbdatabases/collections", "apiversion": "2021-04-15", "name": "[format('{0}/{1}/{2}", variables('accountname_var'), parameters('databasename'), parameters('collection1name'))]", "properties": {"resource": {"id": "[parameters('collection1name')]", "shardkey": {"user_id": "hash"}, "indexes": [{"key": {"keys": ["_id"]}}, {"key": {"keys": ["$**"]}}, {"key": {"keys": ["user_id", "user_address"]}, "options": {"unique": true}}, {"key": {"keys": ["_ts"], "options": {"expireafterseconds": 2629746}}}], "options": {"if-match": "<etag>"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/mongodbdatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/mongodbdatabases/collections", "apiversion": "2021-04-15", "name": "[format('{0}/{1}/{2}", variables('accountname_var'), parameters('databasename'), parameters('collection2name'))]", "properties": {"resource": {"id": "[parameters('collection2name')]", "shardkey": {"company_id": "hash"}, "indexes": [{"key": {"keys": ["_id"]}}, {"key": {"keys": ["$**"]}}, {"key": {"keys": ["company_id", "company_address"]}, "options": {"unique": true}}, {"key": {"keys": ["_ts"], "options": {"expireafterseconds": 2629746}}}], "options": {"if-match": "<etag>"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/mongodbdatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}
This template creates a free-tier Azure Cosmos account for Core (SQL) API with a database with shared throughput of 400 RU/s.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var')]", "location": "[parameters('location')]", "properties": {"enablefreetier": true, "databaseaccountoffertype": "standard", "consistencypolicy": {"defaultconsistencylevel": "session"}, "locations": [{"locationname": "[parameters('location')]"}]}}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}, "options": {"throughput": 400}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}
Create Azure Cosmos container with multiple containers
{"name": "[parameters('accountname')]", "type": "microsoft.documentdb/databaseaccounts", "apiversion": "2019-12-12", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"consistencypolicy": {"defaultconsistencylevel": "eventual", "maxstalenessprefix": 1, "maxintervalinseconds": 5}, "locations": [{"locationname": "[parameters('location')]", "failoverpriority": 0}], "databaseaccountoffertype": "standard", "enableautomaticfailover": false}}{"type": "microsoft.documentdb/databaseaccounts/apis/databases", "name": "[concat( parameters('accountname'), "/sql/", parameters('databasename'))]", "apiversion": "2016-03-31", "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/", parameters('accountname'))]"], "properties": {"resource": {"id": "[parameters('databasename')]"}, "options": {"throughput": 400}}}{"type": "microsoft.documentdb/databaseaccounts/apis/databases/containers", "name": "[concat(parameters('accountname'), "/sql/", parameters('databasename'), "/", parameters('containers')[copyindex()].name)]", "copy": {"name": "containercopy", "count": "[length(parameters('containers'))]"}, "apiversion": "2016-03-31", "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/apis/databases", parameters('accountname'), "sql", parameters('databasename'))]"], "properties": {"resource": {"id": "[parameters('containers')[copyindex()].name]", "partitionkey": {"paths": ["[parameters('containers')[copyindex()].partitionkey]"], "kind": "hash"}, "indexingpolicy": {"indexingmode": "consistent"}}}}
This template creates an Azure Cosmos account for Core (SQL) API with a database and container configured with analytical store.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[parameters('accountname')]", "location": "[parameters('location')]", "properties": {"consistencypolicy": {"defaultconsistencylevel": "session"}, "databaseaccountoffertype": "standard", "locations": "[variables('locations')]", "enableanalyticalstorage": true}}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", parameters('accountname'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", parameters('accountname'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases/containers", "apiversion": "2021-04-15", "name": "[format('{0}/{1}/{2}", parameters('accountname'), parameters('databasename'), parameters('containername'))]", "properties": {"resource": {"id": "[parameters('containername')]", "partitionkey": {"paths": ["[parameters('partitionkeypath')]"], "kind": "hash"}, "analyticalstoragettl": "[parameters('analyticalstorettl')]"}, "options": "[variables('throughput_policy')[parameters('throughputpolicy')]]"}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", parameters('accountname'))]", "[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", parameters('accountname'), parameters('databasename'))]"]}
This template creates an Azure Cosmos DB account for any API Type with a primary and secondary region with choice of consistency level and options to enable multi-master and Failover Type.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[parameters('accountname')]", "location": "[parameters('location')]", "kind": "[variables('apitype')[parameters('api')].kind]", "properties": {"consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]", "capabilities": "[variables('apitype')[parameters('api')].capabilities]", "enablemultiplewritelocations": "[parameters('multiplewritelocations')]"}}
This template creates an Azure Cosmos DB account for Gremlin API in two regions with one database and one graph using dedicated throughput.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var')]", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"capabilities": [{"name": "enablegremlin"}], "consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]"}}{"type": "microsoft.documentdb/databaseaccounts/gremlindatabases", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/gremlindatabases/graphs", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", format('{0}/{1}", variables('accountname_var'), parameters('databasename')), parameters('graphname'))]", "properties": {"resource": {"id": "[parameters('graphname')]", "indexingpolicy": {"indexingmode": "consistent", "includedpaths": [{"path": "/*"}], "excludedpaths": [{"path": "/mypathtonotindex/*"}]}, "partitionkey": {"paths": ["/mypartitionkey"], "kind": "hash"}, "options": {"throughput": "[parameters('throughput')]"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/gremlindatabases", split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[0], split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[1])]"]}
This template creates an Azure Cosmos DB account for Table API in two regions and a single table with provisioned throughput.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var_var')]", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"capabilities": [{"name": "enabletable"}], "consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]"}}{"type": "microsoft.documentdb/databaseaccounts/tables", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var_var'), parameters('tablename'))]", "properties": {"resource": {"id": "[parameters('tablename')]"}, "options": {"throughput": "[parameters('throughput')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var_var'))]"]}
This template creates an Azure Cosmos DB account for Gremlin API in two regions with one database and one graph using autoscale throughput.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var')]", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"capabilities": [{"name": "enablegremlin"}], "consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]"}}{"type": "microsoft.documentdb/databaseaccounts/gremlindatabases", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/gremlindatabases/graphs", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", format('{0}/{1}", variables('accountname_var'), parameters('databasename')), parameters('graphname'))]", "properties": {"resource": {"id": "[parameters('graphname')]", "indexingpolicy": {"indexingmode": "consistent", "includedpaths": [{"path": "/*"}], "excludedpaths": [{"path": "/mypathtonotindex/*"}]}, "partitionkey": {"paths": ["/mypartitionkey"], "kind": "hash"}}, "options": {"autoscalesettings": {"maxthroughput": "[parameters('autoscalemaxthroughput')]"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/gremlindatabases", split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[0], split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[1])]"]}
Create an Azure Cosmos DB SQL Account with a native Role Definition and Role Assignment
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[parameters('accountname')]", "kind": "globaldocumentdb", "location": "[parameters('location')]", "properties": {"consistencypolicy": {"defaultconsistencylevel": "session"}, "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": false, "enablemultiplewritelocations": false}}{"type": "microsoft.documentdb/databaseaccounts/sqlroledefinitions", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", parameters('accountname'), variables('roledefinitionid'))]", "properties": {"rolename": "[parameters('roledefinitionname')]", "type": "customrole", "assignablescopes": ["[resourceid('microsoft.documentdb/databaseaccounts", parameters('accountname'))]"], "permissions": [{"dataactions": "[parameters('dataactions')]"}]}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", parameters('accountname'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqlroleassignments", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", parameters('accountname'), variables('roleassignmentid'))]", "properties": {"roledefinitionid": "[resourceid('microsoft.documentdb/databaseaccounts/sqlroledefinitions", split(format('{0}/{1}", parameters('accountname'), variables('roledefinitionid')), "/')[0], split(format('{0}/{1}", parameters('accountname'), variables('roledefinitionid')), "/')[1])]", "principalid": "[parameters('principalid')]", "scope": "[resourceid('microsoft.documentdb/databaseaccounts", parameters('accountname'))]"}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", parameters('accountname'))]", "[resourceid('microsoft.documentdb/databaseaccounts/sqlroledefinitions", split(format('{0}/{1}", parameters('accountname'), variables('roledefinitionid')), "/')[0], split(format('{0}/{1}", parameters('accountname'), variables('roledefinitionid')), "/')[1])]"]}
This template creates an Azure Cosmos account for Core (SQL) API with a database and container with autoscale throughput with multiple other options.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-01-15", "name": "[variables('accountname_var')]", "kind": "globaldocumentdb", "location": "[parameters('location')]", "properties": {"consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]"}}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases", "apiversion": "2021-01-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases/containers", "apiversion": "2021-01-15", "name": "[format('{0}/{1}/{2}", variables('accountname_var'), parameters('databasename'), parameters('containername'))]", "properties": {"resource": {"id": "[parameters('containername')]", "partitionkey": {"paths": ["/mypartitionkey"], "kind": "hash"}, "indexingpolicy": {"indexingmode": "consistent", "includedpaths": [{"path": "/*"}], "excludedpaths": [{"path": "/mypathtonotindex/*"}], "compositeindexes": [[{"path": "/name", "order": "ascending"}, {"path": "/age", "order": "descending"}]], "spatialindexes": [{"path": "/path/to/geojson/property/?", "types": ["point", "polygon", "multipolygon", "linestring"]}]}, "defaultttl": 86400, "uniquekeypolicy": {"uniquekeys": [{"paths": ["/phonenumber"]}]}}, "options": {"autoscalesettings": {"maxthroughput": "[parameters('autoscalemaxthroughput')]"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}
This template creates an Azure Cosmos account for Core (SQL) API with a database and container with throughput with multiple other options.
{"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var')]", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]"}}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('databasename'))]", "properties": {"resource": {"id": "[parameters('databasename')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases/containers", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", format('{0}/{1}", variables('accountname_var'), parameters('databasename')), parameters('containername'))]", "properties": {"resource": {"id": "[parameters('containername')]", "partitionkey": {"paths": ["/mypartitionkey"], "kind": "hash"}, "indexingpolicy": {"indexingmode": "consistent", "includedpaths": [{"path": "/*"}], "excludedpaths": [{"path": "/mypathtonotindex/*"}], "compositeindexes": [[{"path": "/name", "order": "ascending"}, {"path": "/age", "order": "descending"}]], "spatialindexes": [{"path": "/location/*", "types": ["point", "polygon", "multipolygon", "linestring"]}]}, "defaultttl": 86400, "uniquekeypolicy": {"uniquekeys": [{"paths": ["/phonenumber"]}]}}, "options": {"throughput": "[parameters('throughput')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[0], split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[1])]"]}