Description
stringlengths 19
200
| IaC
stringlengths 128
8.16k
|
---|---|
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 creates a data collection rule defining the data source (Syslog) and the destination workspace. | {"type": "microsoft.insights/datacollectionrules", "apiversion": "2019-11-01-preview", "name": "[parameters('dcrname')]", "location": "[parameters('location')]", "kind": "linux", "properties": {"datasources": {"syslog": [{"streams": ["microsoft-syslog"], "facilitynames": ["auth", "authpriv", "cron", "daemon", "mark", "kern", "local0", "local1", "local2", "local3", "local4", "local5", "local6", "local7", "lpr", "mail", "news", "syslog", "user", "uucp"], "loglevels": ["debug", "info", "notice", "warning", "error", "critical", "alert", "emergency"], "name": "syslogsdatasource"}]}, "destinations": {"loganalytics": [{"workspaceresourceid": "[parameters('workspaceresourceid')]", "name": "la-data-destination"}]}, "dataflows": [{"streams": ["microsoft-syslog"], "destinations": ["la-data-destination"]}]}} |
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 provides a Redis Cache with the benefit of Virtual Network support. | {"type": "microsoft.cache/redis", "apiversion": "2020-12-01", "name": "[parameters('rediscachename')]", "location": "[parameters('location')]", "properties": {"enablenonsslport": "[parameters('enablenonsslport')]", "minimumtlsversion": "[parameters('minimumtlsversion')]", "sku": {"capacity": "[parameters('rediscachecapacity')]", "family": "p", "name": "premium"}, "subnetid": "[extensionresourceid(format('/subscriptions/{0}/resourcegroups/{1}", subscription().subscriptionid, parameters('existingvirtualnetworkresourcegroupname')), "microsoft.network/virtualnetworks/subnets", split(format('{0}/{1}", parameters('existingvirtualnetworkname'), parameters('existingsubnetname')), "/')[0], split(format('{0}/{1}", parameters('existingvirtualnetworkname'), parameters('existingsubnetname')), "/')[1])]"}} |
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"}]}}]}]}} |
Create an Azure Security Center Automation which will be triggered by specific Security Center Alert (including all severities) | {"type": "microsoft.security/automations", "apiversion": "2019-01-01-preview", "name": "[parameters('automationname')]", "location": "[parameters('location')]", "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"}]}}]}]}} |
This template provides a way to deploy an Azure database for PostgreSQL with VNet integration. | {"type": "microsoft.dbforpostgresql/servers/virtualnetworkrules", "apiversion": "2017-12-01", "name": "[format('{0}/{1}", parameters('servername'), parameters('virtualnetworkrulename'))]", "properties": {"virtualnetworksubnetid": "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]", "ignoremissingvnetserviceendpoint": true}, "dependson": ["[resourceid('microsoft.dbforpostgresql/servers", parameters('servername'))]", "[resourceid('microsoft.network/virtualnetworks/subnets", parameters('virtualnetworkname'), parameters('subnetname'))]"]}{"type": "microsoft.dbforpostgresql/servers", "apiversion": "2017-12-01", "name": "[parameters('servername')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('skuname')]", "tier": "[parameters('skutier')]", "capacity": "[parameters('skucapacity')]", "size": "[format('{0}", parameters('skusizemb'))]", "family": "[parameters('skufamily')]"}, "properties": {"createmode": "default", "version": "[parameters('postgresqlversion')]", "administratorlogin": "[parameters('administratorlogin')]", "administratorloginpassword": "[parameters('administratorloginpassword')]", "storageprofile": {"storagemb": "[parameters('skusizemb')]", "backupretentiondays": "[parameters('backupretentiondays')]", "georedundantbackup": "[parameters('georedundantbackup')]"}}}{"copy": {"name": "firewallrules", "count": "[length(variables('firewallrules'))]", "mode": "serial", "batchsize": 1}, "type": "microsoft.dbforpostgresql/servers/firewallrules", "apiversion": "2017-12-01", "name": "[format('{0}/{1}", parameters('servername'), variables('firewallrules')[copyindex()].name)]", "properties": {"startipaddress": "[variables('firewallrules')[copyindex()].startipaddress]", "endipaddress": "[variables('firewallrules')[copyindex()].endipaddress]"}, "dependson": ["[resourceid('microsoft.dbforpostgresql/servers", parameters('servername'))]"]} |
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]"}} |
Creates and optionally secures a Key Vault with logging linked to a storage account. | {"type": "microsoft.keyvault/vaults", "apiversion": "2021-04-01-preview", "name": "[parameters('keyvaultname')]", "location": "[parameters('location')]", "tags": {"displayname": "key vault with logging"}, "properties": {"sku": {"name": "[parameters('vaultsku')]", "family": "a"}, "tenantid": "[subscription().tenantid]", "accesspolicies": [{"objectid": "[parameters('objectid')]", "tenantid": "[subscription().tenantid]", "permissions": {"keys": "[parameters('keyspermissions')]", "secrets": "[parameters('secretspermissions')]"}}]}} |
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])]"]} |
This template creates an Azure Cosmos DB account for MongoDB API (3.2, 3.6 and 4.0) in two regions using shared 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": {"throughput": "[parameters('throughput')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/mongodbdatabases/collections", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", format('{0}/{1}", 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", split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[0], split(format('{0}/{1}", variables('accountname_var'), parameters('databasename')), "/')[1])]"]}{"type": "microsoft.documentdb/databaseaccounts/mongodbdatabases/collections", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", format('{0}/{1}", 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", 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 Cassandra API in two regions with a keyspace and table with autoscale throughput. | {"type": "microsoft.documentdb/databaseaccounts", "apiversion": "2021-04-15", "name": "[variables('accountname_var')]", "location": "[parameters('location')]", "kind": "globaldocumentdb", "properties": {"capabilities": [{"name": "enablecassandra"}], "consistencypolicy": "[variables('consistencypolicy')[parameters('defaultconsistencylevel')]]", "locations": "[variables('locations')]", "databaseaccountoffertype": "standard", "enableautomaticfailover": "[parameters('automaticfailover')]"}}{"type": "microsoft.documentdb/databaseaccounts/cassandrakeyspaces", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", variables('accountname_var'), parameters('keyspacename'))]", "properties": {"resource": {"id": "[parameters('keyspacename')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/cassandrakeyspaces/tables", "apiversion": "2021-04-15", "name": "[format('{0}/{1}", format('{0}/{1}", variables('accountname_var'), parameters('keyspacename')), parameters('tablename'))]", "properties": {"resource": {"id": "[parameters('tablename')]", "schema": {"columns": [{"name": "loadid", "type": "uuid"}, {"name": "machine", "type": "uuid"}, {"name": "cpu", "type": "int"}, {"name": "mtime", "type": "int"}, {"name": "load", "type": "float"}], "partitionkeys": [{"name": "machine"}, {"name": "cpu"}, {"name": "mtime"}], "clusterkeys": [{"name": "loadid", "orderby": "asc"}]}}, "options": {"autoscalesettings": {"maxthroughput": "[parameters('autoscalemaxthroughput')]"}}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/cassandrakeyspaces", split(format('{0}/{1}", variables('accountname_var'), parameters('keyspacename')), "/')[0], split(format('{0}/{1}", variables('accountname_var'), parameters('keyspacename')), "/')[1])]"]} |
This template creates an Azure Cosmos account for Core (SQL) API and a container with a stored procedure, trigger and user defined function. | {"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}/{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/*"}]}}, "options": {"throughput": "[parameters('throughput')]"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases/containers/storedprocedures", "apiversion": "2021-04-15", "name": "[format('{0}/{1}/{2}/{3}", variables('accountname_var'), parameters('databasename'), parameters('containername'), "mystoredprocedure')]", "properties": {"resource": {"id": "mystoredprocedure", "body": "function () { var context = getcontext(); var response = context.getresponse(); response.setbody('hello, world'); }"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases/containers", variables('accountname_var'), parameters('databasename'), parameters('containername'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases/containers/triggers", "apiversion": "2021-04-15", "name": "[format('{0}/{1}/{2}/{3}", variables('accountname_var'), parameters('databasename'), parameters('containername'), "mypretrigger')]", "properties": {"resource": {"id": "mypretrigger", "triggertype": "pre", "triggeroperation": "create", "body": "function validatetodoitemtimestamp(){var context=getcontext();var request=context.getrequest();var itemtocreate=request.getbody();if(!('timestamp"in itemtocreate)){var ts=new date();itemtocreate["timestamp"]=ts.gettime();}request.setbody(itemtocreate);}"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases/containers", variables('accountname_var'), parameters('databasename'), parameters('containername'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]}{"type": "microsoft.documentdb/databaseaccounts/sqldatabases/containers/userdefinedfunctions", "apiversion": "2021-04-15", "name": "[format('{0}/{1}/{2}/{3}", variables('accountname_var'), parameters('databasename'), parameters('containername'), "myuserdefinedfunction')]", "properties": {"resource": {"id": "myuserdefinedfunction", "body": "function tax(income){if(income==undefined)throw"no input";if(income<1000)return income*0.1;else if(income<10000)return income*0.2;else return income*0.4;}"}}, "dependson": ["[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases", variables('accountname_var'), parameters('databasename'))]", "[resourceid('microsoft.documentdb/databaseaccounts/sqldatabases/containers", variables('accountname_var'), parameters('databasename'), parameters('containername'))]", "[resourceid('microsoft.documentdb/databaseaccounts", variables('accountname_var'))]"]} |
Deploy a simple Azure Spring Cloud microservice application | {"type": "microsoft.appplatform/spring", "apiversion": "2020-07-01", "name": "[parameters('servicename')]", "location": "[parameters('location')]", "sku": {"name": "s0", "tier": "standard"}, "properties": {"configserverproperties": {"configserver": {"gitproperty": {"uri": "https://github.com/azure-samples/piggymetrics-config"}}}}, "resources": [{"type": "apps", "apiversion": "2020-07-01", "name": "[parameters('app1')]", "properties": {"public": true}, "dependson": ["[parameters('servicename')]"], "resources": [{"type": "deployments", "apiversion": "2020-07-01", "name": "default", "dependson": ["[parameters('app1')]"], "properties": {"source": {"relativepath": "<default>", "type": "jar"}}}]}, {"type": "apps", "apiversion": "2020-07-01", "name": "[parameters('app2')]", "properties": {"public": true}, "dependson": ["[parameters('servicename')]"], "resources": [{"type": "deployments", "apiversion": "2020-07-01", "name": "default", "dependson": ["[parameters('app2')]"], "properties": {"source": {"relativepath": "<default>", "type": "jar"}}}]}, {"type": "apps", "apiversion": "2020-07-01", "name": "[parameters('app3')]", "properties": {"public": false}, "dependson": ["[parameters('servicename')]"], "resources": [{"type": "deployments", "apiversion": "2020-07-01", "name": "default", "dependson": ["[parameters('app3')]"], "properties": {"source": {"relativepath": "<default>", "type": "jar"}}}]}]} |
Creates a CDN Endpoint with rules engine and remote address based match and adds corresponding response headers. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('cdnsku')]"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "deliverypolicy": {"description": "add response headers", "rules": [{"name": "geomatchcondition", "order": 1, "conditions": [{"name": "remoteaddress", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleremoteaddressconditionparameters", "operator": "geomatch", "matchvalues": ["us"]}}], "actions": [{"name": "modifyresponseheader", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleheaderactionparameters", "headeraction": "overwrite", "headername": "x-client-country", "value": "us"}}]}, {"name": "ipv4match", "order": 2, "conditions": [{"name": "remoteaddress", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleremoteaddressconditionparameters", "operator": "ipmatch", "matchvalues": ["0.0.0.0/0"]}}], "actions": [{"name": "modifyresponseheader", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleheaderactionparameters", "headeraction": "overwrite", "headername": "x-client-ip-version", "value": "ipv4"}}]}, {"name": "ipv6match", "order": 3, "conditions": [{"name": "remoteaddress", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleremoteaddressconditionparameters", "operator": "ipmatch", "matchvalues": ["::0/0"]}}], "actions": [{"name": "modifyresponseheader", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleheaderactionparameters", "headeraction": "overwrite", "headername": "x-client-ip-version", "value": "ipv6"}}]}]}}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]"]} |
Creates a CDN WAF Policy managed rule set DefaultRuleSet_1.0 and a linked CDN Endpoint. | {"type": "microsoft.cdn/cdnwebapplicationfirewallpolicies", "apiversion": "2020-09-01", "name": "[parameters('policyname')]", "location": "global", "sku": {"name": "[parameters('cdnsku')]"}, "properties": {"policysettings": {"enabledstate": "enabled", "mode": "[parameters('policymode')]"}, "managedrules": {"managedrulesets": [{"rulesettype": "defaultruleset", "rulesetversion": "1.0"}]}}}{"name": "[parameters('profilename')]", "type": "microsoft.cdn/profiles", "location": "[parameters('location')]", "apiversion": "2019-06-15-preview", "sku": {"name": "[parameters('cdnsku')]"}, "resources": [{"apiversion": "2019-06-15-preview", "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]", "[resourceid('microsoft.cdn/cdnwebapplicationfirewallpolicies", parameters('policyname'))]"], "location": "[parameters('location')]", "name": "[parameters('endpointname')]", "type": "endpoints", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "webapplicationfirewallpolicylink": {"id": "[resourceid('microsoft.cdn/cdnwebapplicationfirewallpolicies", parameters('policyname'))]"}}}]} |
This template creates a Front Door Standard/Premium including a rule set. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('profilename')]", "location": "global", "sku": {"name": "[parameters('skuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), parameters('endpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('origingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), variables('origingroupname'), variables('originname'))]", "properties": {"hostname": "[parameters('originhostname')]", "httpport": 80, "httpsport": 443, "originhostheader": "[parameters('originhostname')]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/rulesets", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('rulesetname'))]", "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/rulesets/rules", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), variables('rulesetname'), variables('redirectsecuretraffictomicrosoftrulename'))]", "properties": {"order": 1, "conditions": [{"name": "urlpath", "parameters": {"operator": "beginswith", "negatecondition": false, "matchvalues": ["secure/"], "transforms": ["lowercase"], "typename": "deliveryruleurlpathmatchconditionparameters"}}], "actions": [{"name": "urlredirect", "parameters": {"redirecttype": "temporaryredirect", "destinationprotocol": "https", "customhostname": "microsoft.com", "custompath": "/", "typename": "deliveryruleurlredirectactionparameters"}}]}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]", "[resourceid('microsoft.cdn/profiles/rulesets", variables('profilename'), variables('rulesetname'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), parameters('endpointname'), variables('routename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]"}, "rulesets": [{"id": "[resourceid('microsoft.cdn/profiles/rulesets", variables('profilename'), variables('rulesetname'))]"}], "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httpsonly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('profilename'), variables('origingroupname'), variables('originname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]", "[resourceid('microsoft.cdn/profiles/rulesets", variables('profilename'), variables('rulesetname'))]"]} |
This template creates a Front Door Standard/Premium including a web application firewall with a custom rule. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('profilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), parameters('endpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('origingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), variables('origingroupname'), variables('originname'))]", "properties": {"hostname": "[parameters('originhostname')]", "httpport": 80, "httpsport": 443, "originhostheader": "[parameters('originhostname')]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), parameters('endpointname'), variables('routename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httpsonly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('profilename'), variables('origingroupname'), variables('originname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/securitypolicies", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('securitypolicyname'))]", "properties": {"parameters": {"type": "webapplicationfirewall", "wafpolicy": {"id": "[resourceid('microsoft.network/frontdoorwebapplicationfirewallpolicies", variables('wafpolicyname'))]"}, "associations": [{"domains": [{"id": "[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]"}], "patternstomatch": ["/*"]}]}}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]", "[resourceid('microsoft.network/frontdoorwebapplicationfirewallpolicies", variables('wafpolicyname'))]"]} |
Create a CDN Profile, a CDN Endpoint with a user defined origin and recommended settings. This template also configures rules engine device based path rewrite and request scheme based redirect. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('cdnsku')]"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "deliverypolicy": {"description": "rewrite and redirect", "rules": [{"name": "pathrewritebasedondevicematchcondition", "order": 1, "conditions": [{"name": "isdevice", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleisdeviceconditionparameters", "operator": "equal", "matchvalues": ["mobile"]}}], "actions": [{"name": "urlrewrite", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlrewriteactionparameters", "sourcepattern": "/standard", "destination": "/mobile"}}]}, {"name": "httpversionbasedredirect", "order": 2, "conditions": [{"name": "requestscheme", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryrulerequestschemeconditionparameters", "operator": "equal", "matchvalues": ["http"]}}], "actions": [{"name": "urlredirect", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlredirectactionparameters", "redirecttype": "found", "destinationprotocol": "https"}}]}]}}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]"]} |
Create a CDN Profile, a CDN Endpoint with a user defined origin and recommended settings. This template also configures rules engine UrlSigning action. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('cdnsku')]"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "usequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "urlsigningkeys": [{"keyid": "key1", "keysourceparameters": {"@odata.type": "#microsoft.azure.cdn.models.keyvaultsigningkeyparameters", "subscriptionid": "[parameters('urlsigningkeyssubid')]", "resourcegroupname": "[parameters('urlsigningkeysresourcegroup')]", "vaultname": "[parameters('urlsigningkeysvaultname')]", "secretname": "[parameters('urlsigningkeyssecret1name')]", "secretversion": "[parameters('urlsigningkeyssecret1version')]"}}, {"keyid": "key2", "keysourceparameters": {"@odata.type": "#microsoft.azure.cdn.models.keyvaultsigningkeyparameters", "subscriptionid": "[parameters('urlsigningkeyssubid')]", "resourcegroupname": "[parameters('urlsigningkeysresourcegroup')]", "vaultname": "[parameters('urlsigningkeysvaultname')]", "secretname": "[parameters('urlsigningkeyssecret2name')]", "secretversion": "[parameters('urlsigningkeyssecret2version')]"}}], "deliverypolicy": {"description": "urlsigning", "rules": [{"name": "rule1", "order": 1, "conditions": [{"name": "urlpath", "parameters": {"operator": "equal", "matchvalues": ["/urlsigning/test"], "@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlpathmatchconditionparameters"}}], "actions": [{"name": "urlsigning", "parameters": {"keyid": "key1", "algorithm": "sha256", "@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlsigningactionparameters"}}, {"name": "cachekeyquerystring", "parameters": {"querystringbehavior": "exclude", "queryparameters": "expires,keyid,signature", "@odata.type": "#microsoft.azure.cdn.models.deliveryrulecachekeyquerystringbehavioractionparameters"}}]}, {"name": "rule2", "order": 2, "conditions": [{"name": "urlpath", "parameters": {"operator": "equal", "matchvalues": ["/urlsigning/test2"], "@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlpathmatchconditionparameters"}}], "actions": [{"name": "urlsigning", "parameters": {"keyid": "key2", "algorithm": "sha256", "parameternameoverride": [{"paramindicator": "expires", "paramname": "oexpires"}, {"paramindicator": "keyid", "paramname": "okeyid"}, {"paramindicator": "signature", "paramname": "osignature"}], "@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlsigningactionparameters"}}, {"name": "cachekeyquerystring", "parameters": {"querystringbehavior": "exclude", "queryparameters": "oexpires,okeyid,osignature", "@odata.type": "#microsoft.azure.cdn.models.deliveryrulecachekeyquerystringbehavioractionparameters"}}]}]}}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]"]} |
Create a CDN Profile, a CDN Endpoint with a user defined origin and recommended settings. This template also configures rules engine with a path based rule and overrides cache expiration. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('cdnsku')]"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "deliverypolicy": {"description": "path based cache override", "rules": [{"name": "pathmatchcondition", "order": 1, "conditions": [{"name": "urlpath", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryruleurlpathmatchconditionparameters", "operator": "beginswith", "matchvalues": ["/images/"]}}], "actions": [{"name": "cacheexpiration", "parameters": {"@odata.type": "#microsoft.azure.cdn.models.deliveryrulecacheexpirationactionparameters", "cachebehavior": "override", "cachetype": "all", "cacheduration": "00:00:30"}}]}]}}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]"]} |
This template creates a Front Door Standard/Premium, an Azure Functions app, and configures the function app to validate that traffic has come through the Front Door origin. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[variables('frontdoorprofilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "properties": {"hostname": "[reference(resourceid('microsoft.resources/deployments", "functionapp')).outputs.functionapphostname.value]", "httpport": 80, "httpsport": 443, "originhostheader": "[reference(resourceid('microsoft.resources/deployments", "functionapp')).outputs.functionapphostname.value]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]", "[resourceid('microsoft.resources/deployments", "functionapp')]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'), variables('frontdoorroutename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httpsonly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]} |
Creates a CDN WAF Policy with example rate limit rules and a linked CDN Endpoint. | {"type": "microsoft.cdn/cdnwebapplicationfirewallpolicies", "apiversion": "2020-09-01", "name": "[parameters('policyname')]", "location": "global", "sku": {"name": "[parameters('cdnsku')]"}, "properties": {"policysettings": {"enabledstate": "[parameters('enabledstate')]", "mode": "[parameters('policymode')]", "defaultredirecturl": "[parameters('redirecturl')]"}, "ratelimitrules": {"rules": [{"name": "baselimit", "priority": 100, "enabledstate": "enabled", "ratelimitthreshold": 1000, "ratelimitdurationinminutes": 1, "matchconditions": [{"matchvariable": "requestmethod", "operator": "any", "negatecondition": false}], "action": "block"}, {"name": "writelimit", "priority": 50, "enabledstate": "enabled", "ratelimitthreshold": 100, "ratelimitdurationinminutes": 1, "matchconditions": [{"matchvariable": "requestmethod", "operator": "equal", "negatecondition": false, "matchvalue": ["post", "put", "patch"]}], "action": "redirect"}]}}}{"name": "[parameters('profilename')]", "type": "microsoft.cdn/profiles", "location": "[parameters('location')]", "apiversion": "2019-06-15-preview", "sku": {"name": "[parameters('cdnsku')]"}, "resources": [{"apiversion": "2019-06-15-preview", "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]", "[resourceid('microsoft.cdn/cdnwebapplicationfirewallpolicies", parameters('policyname'))]"], "location": "[parameters('location')]", "name": "[parameters('endpointname')]", "type": "endpoints", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "webapplicationfirewallpolicylink": {"id": "[resourceid('microsoft.cdn/cdnwebapplicationfirewallpolicies", parameters('policyname'))]"}}}]} |
This template creates a Front Door Standard/Premium. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[variables('profilename')]", "location": "global", "sku": {"name": "[parameters('skuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), parameters('endpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('origingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), variables('origingroupname'), variables('originname'))]", "properties": {"hostname": "[parameters('originhostname')]", "httpport": 80, "httpsport": 443, "originhostheader": "[parameters('originhostname')]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), parameters('endpointname'), variables('routename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httpsonly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('profilename'), variables('origingroupname'), variables('originname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]} |
Create a CDN Profile and a CDN Endpoint with a Storage Account as origin | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[variables('profilename')]", "location": "[parameters('location')]", "tags": {"displayname": "[variables('profilename')]"}, "sku": {"name": "standard_verizon"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", variables('profilename'), variables('endpointname'))]", "location": "[parameters('location')]", "tags": {"displayname": "[variables('endpointname')]"}, "properties": {"originhostheader": "[replace(replace(reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob, "https://", "'), "/", "')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[replace(replace(reference(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))).primaryendpoints.blob, "https://", "'), "/", "')]"}}]}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"]} |
This template creates a Front Door Standard/Premium including a web application firewall with a rate limit rule. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('profilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), parameters('endpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('origingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), variables('origingroupname'), variables('originname'))]", "properties": {"hostname": "[parameters('originhostname')]", "httpport": 80, "httpsport": 443, "originhostheader": "[parameters('originhostname')]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('profilename'), parameters('endpointname'), variables('routename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httpsonly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('profilename'), variables('origingroupname'), variables('originname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('profilename'), variables('origingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]"]}{"type": "microsoft.cdn/profiles/securitypolicies", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('profilename'), variables('securitypolicyname'))]", "properties": {"parameters": {"type": "webapplicationfirewall", "wafpolicy": {"id": "[resourceid('microsoft.network/frontdoorwebapplicationfirewallpolicies", variables('wafpolicyname'))]"}, "associations": [{"domains": [{"id": "[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]"}], "patternstomatch": ["/*"]}]}}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('profilename'), parameters('endpointname'))]", "[resourceid('microsoft.cdn/profiles", variables('profilename'))]", "[resourceid('microsoft.network/frontdoorwebapplicationfirewallpolicies", variables('wafpolicyname'))]"]} |
Create a CDN Profile and a CDN Endpoint | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "properties": {}, "sku": {"name": "[parameters('sku')]"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": "[parameters('ishttpallowed')]", "ishttpsallowed": "[parameters('ishttpsallowed')]", "querystringcachingbehavior": "[parameters('querystringcachingbehavior')]", "contenttypestocompress": "[parameters('contenttypestocompress')]", "iscompressionenabled": "[parameters('iscompressionenabled')]", "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}]}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]"]} |
This template creates a Front Door Standard/Premium with a container group and Application Gateway. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('frontdoorprofilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "properties": {"hostname": "[reference(resourceid('microsoft.resources/deployments", "application-gateway')).outputs.publicipaddresshostname.value]", "httpport": 80, "httpsport": 443, "originhostheader": "[reference(resourceid('microsoft.resources/deployments", "application-gateway')).outputs.publicipaddresshostname.value]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.resources/deployments", "application-gateway')]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'), variables('frontdoorroutename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httponly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]} |
This template creates a Front Door Standard/Premium, an App Service, and configures the App Service to validate that traffic has come through the Front Door origin. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('frontdoorprofilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "properties": {"hostname": "[reference(resourceid('microsoft.web/sites", parameters('appname'))).defaulthostname]", "httpport": 80, "httpsport": 443, "originhostheader": "[reference(resourceid('microsoft.web/sites", parameters('appname'))).defaulthostname]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.web/sites", parameters('appname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'), variables('frontdoorroutename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httpsonly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]} |
This template creates a Front Door Standard/Premium with a container group. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('frontdoorprofilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "properties": {"hostname": "[reference(resourceid('microsoft.containerinstance/containergroups", variables('containergroupname'))).ipaddress.fqdn]", "httpport": 80, "httpsport": 443, "originhostheader": "[reference(resourceid('microsoft.containerinstance/containergroups", variables('containergroupname'))).ipaddress.fqdn]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.containerinstance/containergroups", variables('containergroupname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'), variables('frontdoorroutename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "httponly", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]} |
Create a CDN Profile, a CDN Endpoint with a user defined origin and recommended settings. | {"type": "microsoft.cdn/profiles", "apiversion": "2020-04-15", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('cdnsku')]"}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-04-15", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["application/eot", "application/font", "application/font-sfnt", "application/javascript", "application/json", "application/opentype", "application/otf", "application/pkcs7-mime", "application/truetype", "application/ttf", "application/vnd.ms-fontobject", "application/xhtml+xml", "application/xml", "application/xml+rss", "application/x-font-opentype", "application/x-font-truetype", "application/x-font-ttf", "application/x-httpd-cgi", "application/x-javascript", "application/x-mpegurl", "application/x-opentype", "application/x-otf", "application/x-perl", "application/x-ttf", "font/eot", "font/ttf", "font/otf", "font/opentype", "image/svg+xml", "text/css", "text/csv", "text/html", "text/javascript", "text/js", "text/plain", "text/richtext", "text/tab-separated-values", "text/xml", "text/x-script", "text/x-component", "text/x-java-source"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}]}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]"]} |
This template creates a Front Door Standard/Premium and an Application Gateway instance, and uses an NSG and WAF policy to validate that traffic has come through the Front Door origin. | {"type": "microsoft.cdn/profiles", "apiversion": "2021-06-01", "name": "[variables('frontdoorprofilename')]", "location": "global", "sku": {"name": "[parameters('frontdoorskuname')]"}}{"type": "microsoft.cdn/profiles/afdendpoints", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "location": "global", "properties": {"enabledstate": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups", "apiversion": "2021-06-01", "name": "[format('{0}/{1}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "properties": {"loadbalancingsettings": {"samplesize": 4, "successfulsamplesrequired": 3}, "healthprobesettings": {"probepath": "/", "proberequesttype": "head", "probeprotocol": "http", "probeintervalinseconds": 100}}, "dependson": ["[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/origingroups/origins", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "properties": {"hostname": "[reference(resourceid('microsoft.resources/deployments", "application-gateway')).outputs.publicipaddresshostname.value]", "httpport": 80, "httpsport": 443, "originhostheader": "[reference(resourceid('microsoft.resources/deployments", "application-gateway')).outputs.publicipaddresshostname.value]", "priority": 1, "weight": 1000}, "dependson": ["[resourceid('microsoft.resources/deployments", "application-gateway')]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]}{"type": "microsoft.cdn/profiles/afdendpoints/routes", "apiversion": "2021-06-01", "name": "[format('{0}/{1}/{2}", variables('frontdoorprofilename'), parameters('frontdoorendpointname'), variables('frontdoorroutename'))]", "properties": {"origingroup": {"id": "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]"}, "supportedprotocols": ["http", "https"], "patternstomatch": ["/*"], "forwardingprotocol": "[variables('frontdoortoapplicationgatewayprotocol')]", "linktodefaultdomain": "enabled", "httpsredirect": "enabled"}, "dependson": ["[resourceid('microsoft.cdn/profiles/afdendpoints", variables('frontdoorprofilename'), parameters('frontdoorendpointname'))]", "[resourceid('microsoft.cdn/profiles/origingroups/origins", variables('frontdoorprofilename'), variables('frontdoororigingroupname'), variables('frontdoororiginname'))]", "[resourceid('microsoft.cdn/profiles/origingroups", variables('frontdoorprofilename'), variables('frontdoororigingroupname'))]", "[resourceid('microsoft.cdn/profiles", variables('frontdoorprofilename'))]"]} |
Creates a CDN WAF Policy with example custom rules and a linked CDN Endpoint. | {"type": "microsoft.cdn/cdnwebapplicationfirewallpolicies", "apiversion": "2020-09-01", "name": "[parameters('policyname')]", "location": "global", "sku": {"name": "[parameters('cdnsku')]"}, "properties": {"policysettings": {"enabledstate": "[parameters('enabledstate')]", "mode": "[parameters('policymode')]", "defaultredirecturl": "[parameters('redirecturl')]"}, "customrules": {"rules": [{"name": "blockoutsidenorthamerica", "priority": 10, "enabledstate": "enabled", "matchconditions": [{"matchvariable": "remoteaddr", "operator": "geomatch", "negatecondition": true, "matchvalue": ["us", "mx", "ca"]}], "action": "block"}, {"name": "redirectipmatch", "priority": 20, "enabledstate": "enabled", "matchconditions": [{"matchvariable": "remoteaddr", "operator": "ipmatch", "negatecondition": false, "matchvalue": ["1.0.0.0/8", "2.1.1.1", "ffff::/16"]}], "action": "redirect"}, {"name": "allowunauthenticatedlogin", "priority": 30, "enabledstate": "enabled", "matchconditions": [{"matchvariable": "requesturi", "operator": "contains", "negatecondition": false, "matchvalue": ["/login"]}], "action": "allow"}, {"name": "redirectunauthenticated", "priority": 40, "enabledstate": "enabled", "matchconditions": [{"matchvariable": "cookies", "selector": "sessionid", "transforms": ["trim"], "operator": "lessthanorequal", "negatecondition": false, "matchvalue": ["0"]}], "action": "redirect"}]}}}{"name": "[parameters('profilename')]", "type": "microsoft.cdn/profiles", "location": "[parameters('location')]", "apiversion": "2019-06-15-preview", "sku": {"name": "[parameters('cdnsku')]"}, "resources": [{"apiversion": "2019-06-15-preview", "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]", "[resourceid('microsoft.cdn/cdnwebapplicationfirewallpolicies", parameters('policyname'))]"], "location": "[parameters('location')]", "name": "[parameters('endpointname')]", "type": "endpoints", "properties": {"originhostheader": "[parameters('originurl')]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[parameters('originurl')]"}}], "webapplicationfirewallpolicylink": {"id": "[resourceid('microsoft.cdn/cdnwebapplicationfirewallpolicies", parameters('policyname'))]"}}}]} |
Create a CDN Profile, a CDN Endpoint, a Server Farm and a Web App | {"type": "microsoft.cdn/profiles", "apiversion": "2020-09-01", "name": "[parameters('profilename')]", "location": "[parameters('location')]", "tags": {"displayname": "[parameters('profilename')]"}, "sku": {"name": "standard_microsoft"}, "properties": {}}{"type": "microsoft.cdn/profiles/endpoints", "apiversion": "2020-09-01", "name": "[format('{0}/{1}", parameters('profilename'), parameters('endpointname'))]", "location": "[parameters('location')]", "tags": {"displayname": "[parameters('endpointname')]"}, "properties": {"originhostheader": "[reference(resourceid('microsoft.web/sites", parameters('webappname'))).hostnames[0]]", "ishttpallowed": true, "ishttpsallowed": true, "querystringcachingbehavior": "ignorequerystring", "contenttypestocompress": ["text/plain", "text/html", "text/css", "application/x-javascript", "text/javascript"], "iscompressionenabled": true, "origins": [{"name": "origin1", "properties": {"hostname": "[reference(resourceid('microsoft.web/sites", parameters('webappname'))).hostnames[0]]"}}]}, "dependson": ["[resourceid('microsoft.cdn/profiles", parameters('profilename'))]", "[resourceid('microsoft.web/sites", parameters('webappname'))]"]} |
This template demonstrates how to Create a instance of Azure API Management and configure custom hostname for proxy with ssl certificate from keyvault by passing an Azure Resource Id | {"apiversion": "2020-12-01", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "hostnameconfigurations": [{"type": "proxy", "hostname": "[concat(parameters('proxycustomhostname'))]", "encodedcertificate": "[parameters('proxycustomhostnamebase64encodedpfxcertificate')]", "certificatepassword": "[parameters('proxysslcertificatepassword')]", "negotiateclientcertificate": false}]}} |
Create an instance Azure API Management within your virtual network's subnet and Public IP from your subscription. | {"apiversion": "2021-01-01-preview", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]"], "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "virtualnetworktype": "internal", "publicipaddressid": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('subnetref')]"}, "customproperties": {"microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_256_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_128_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_gcm_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tripledes168": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls10": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls11": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.ssl30": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls10": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls11": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.ssl30": false, "microsoft.windowsazure.apimanagement.gateway.protocols.server.http2": false}}} |
This template demonstrates how to create a instance of Azure API Management with custom hostname for portal and multiple custom hostnames for proxy | {"apiversion": "2017-03-01", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "tags": {}, "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "hostnameconfigurations": [{"type": "proxy", "hostname": "[parameters('proxycustomhostname1')]", "encodedcertificate": "[parameters('proxycustomhostnamebase64encodedpfxcertificate1')]", "certificatepassword": "[parameters('proxysslcertificatepassword1')]", "negotiateclientcertificate": false}, {"type": "proxy", "hostname": "[parameters('proxycustomhostname2')]", "encodedcertificate": "[parameters('proxycustomhostnamebase64encodedpfxcertificate2')]", "certificatepassword": "[parameters('proxysslcertificatepassword2')]", "negotiateclientcertificate": false}, {"type": "portal", "hostname": "[parameters('portalcustomhostname')]", "encodedcertificate": "[parameters('portalcustomhostnamebase64encodedpfxcertificate')]", "certificatepassword": "[parameters('portalsslcertificatepassword')]", "negotiateclientcertificate": false}]}} |
This template demonstrates how to create a instance of Azure API Management within your virtual network's subnet and configure Network Security Group as per recommendation using Service Tags. | {"apiversion": "2019-12-01", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"], "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "virtualnetworktype": "external", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('subnetref')]"}, "customproperties": {"microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_256_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_128_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_gcm_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tripledes168": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls10": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls11": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.ssl30": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls10": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls11": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.ssl30": false, "microsoft.windowsazure.apimanagement.gateway.protocols.server.http2": false}}} |
This template demonstrates how to create a instance of Azure API Management within your virtual network's subnet and configure Network Security Group as per recommendation using Service Tags. | {"apiversion": "2019-12-01", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]"], "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "virtualnetworktype": "internal", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('subnetref')]"}}} |
Create an API Management service with a virtual network and a private endpoint | {"type": "microsoft.apimanagement/service", "apiversion": "2021-08-01", "name": "[parameters('apimanagementservicename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "identity": {"type": "systemassigned"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]"}} |
Create an API Management instance into Availability Zone and enable Managed Identity. | {"type": "microsoft.apimanagement/service", "apiversion": "2021-01-01-preview", "name": "[parameters('apimanagementservicename')]", "location": "[parameters('location')]", "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "identity": {"type": "systemassigned"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]"}} |
Create an API Management service with SSL from KeyVault using User Assigned identity. | {"type": "microsoft.apimanagement/service", "apiversion": "2021-04-01-preview", "name": "[parameters('apimanagementservicename')]", "location": "[parameters('location')]", "identity": {"type": "userassigned", "userassignedidentities": {"[format('{0}", resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname')))]": {}}}, "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "properties": {"hostnameconfigurations": [{"type": "proxy", "hostname": "[parameters('gatewaycustomhostname')]", "keyvaultid": "[reference(resourceid('microsoft.keyvault/vaults/secrets", split(format('{0}/sslcert", parameters('keyvaultname')), "/')[0], split(format('{0}/sslcert", parameters('keyvaultname')), "/')[1])).secreturi]", "identityclientid": "[reference(resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))).clientid]", "defaultsslbinding": true}], "publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "customproperties": {"microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_ecdsa_with_aes_256_cbc_sha": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_ecdsa_with_aes_128_cbc_sha": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_256_cbc_sha": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_128_cbc_sha": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_gcm_sha256": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha256": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha256": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha": "false", "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tripledes168": "false", "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls10": "false", "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls11": "false", "microsoft.windowsazure.apimanagement.gateway.security.protocols.ssl30": "false", "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls10": "false", "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls11": "false", "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.ssl30": "false", "microsoft.windowsazure.apimanagement.gateway.protocols.server.http2": "true"}}, "dependson": ["[resourceid('microsoft.keyvault/vaults/secrets", split(format('{0}/sslcert", parameters('keyvaultname')), "/')[0], split(format('{0}/sslcert", parameters('keyvaultname')), "/')[1])]", "[resourceid('microsoft.managedidentity/userassignedidentities", variables('identityname'))]"]} |
Create an instance Azure API Management within your virtual network's subnet and Public IP from your subscription. | {"apiversion": "2021-01-01-preview", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "dependson": ["[resourceid('microsoft.network/virtualnetworks", parameters('virtualnetworkname'))]", "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]"], "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "zones": "[if(equals(length(parameters('availabilityzones')), 0), json('null'), parameters('availabilityzones'))]", "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]", "virtualnetworktype": "external", "publicipaddressid": "[resourceid('microsoft.network/publicipaddresses", parameters('publicipname'))]", "virtualnetworkconfiguration": {"subnetresourceid": "[variables('subnetref')]"}, "customproperties": {"microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_256_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_ecdhe_rsa_with_aes_128_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_gcm_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha256": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_256_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tls_rsa_with_aes_128_cbc_sha": false, "microsoft.windowsazure.apimanagement.gateway.security.ciphers.tripledes168": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls10": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.tls11": false, "microsoft.windowsazure.apimanagement.gateway.security.protocols.ssl30": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls10": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.tls11": false, "microsoft.windowsazure.apimanagement.gateway.security.backend.protocols.ssl30": false, "microsoft.windowsazure.apimanagement.gateway.protocols.server.http2": false}}} |
This template demonstrates how to Create a instance of Azure API Management on a private network protected by Azure Application Gateway. | {"type": "microsoft.apimanagement/service", "apiversion": "2020-12-01", "name": "[variables('apim-name')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('apim-sku')]", "capacity": "[parameters('apim-capacity')]"}, "identity": {"type": "systemassigned"}, "dependson": ["[resourceid('microsoft.network/virtualnetworks", variables('vnet-name'))]"], "resources": [{"type": "gateways", "apiversion": "2020-12-01", "name": "my-gateway", "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apim-name'))]"], "properties": {"locationdata": {"name": "my internal location"}, "description": "self hosted gateway bringing api management to the edge"}}, {"type": "loggers", "apiversion": "2020-12-01", "name": "appinsightslogger", "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apim-name'))]"], "properties": {"loggertype": "applicationinsights", "resourceid": "[resourceid('microsoft.insights/components", variables('app-insights-name'))]", "credentials": {"instrumentationkey": "[reference(variables('app-insights-name')).instrumentationkey]"}}}, {"type": "diagnostics", "apiversion": "2020-12-01", "name": "applicationinsights", "dependson": ["[resourceid('microsoft.apimanagement/service", variables('apim-name'))]", "[resourceid('microsoft.apimanagement/service/loggers", variables('apim-name'), "appinsightslogger')]"], "properties": {"alwayslog": "allerrors", "httpcorrelationprotocol": "legacy", "verbosity": "information", "logclientip": true, "loggerid": "[resourceid('microsoft.apimanagement/service/loggers/", variables('apim-name'), "appinsightslogger')]", "sampling": {"samplingtype": "fixed", "percentage": 100}, "frontend": {"request": {"body": {"bytes": 0}}, "response": {"body": {"bytes": 0}}}, "backend": {"request": {"body": {"bytes": 0}}, "response": {"body": {"bytes": 0}}}}}], "properties": {"publishername": "[parameters('apim-publisher-name')]", "publisheremail": "[parameters('apim-publisher-email')]", "virtualnetworktype": "internal", "virtualnetworkconfiguration": {"subnetresourceid": "[resourceid('microsoft.network/virtualnetworks/subnets", variables('vnet-name'), "apimsubnet')]"}}} |
Monitor your API Management service with Operations Management Suite - Log Analytics | {"apiversion": "2020-12-01", "name": "[variables('apimanagementservicename')]", "type": "microsoft.apimanagement/service", "location": "[parameters('location')]", "sku": {"name": "[parameters('apimanagementsku')]", "capacity": "[parameters('apimanagementskucount')]"}, "properties": {"publisheremail": "[parameters('apimanagementpublisheremail')]", "publishername": "[parameters('apimanagementpublishername')]"}}{"name": "[concat(variables('apimanagementservicename'), "/", "microsoft.insights/service')]", "type": "microsoft.apimanagement/service/providers/diagnosticsettings", "apiversion": "2015-07-01", "dependson": ["[resourceid('microsoft.apimanagement/service/", variables('apimanagementservicename'))]", "[resourceid('microsoft.operationalinsights/workspaces/", variables('omsworkspacename'))]"], "properties": {"workspaceid": "[resourceid('microsoft.operationalinsights/workspaces", variables('omsworkspacename'))]", "logs": [{"category": "gatewaylogs", "enabled": true}]}} |
Create an API Management instance using a template | {"type": "microsoft.apimanagement/service", "apiversion": "2020-12-01", "name": "[parameters('apimanagementservicename')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('sku')]", "capacity": "[parameters('skucount')]"}, "properties": {"publisheremail": "[parameters('publisheremail')]", "publishername": "[parameters('publishername')]"}} |
Create a Standard Stream Analytics Job without input and output | {"type": "microsoft.streamanalytics/streamingjobs", "apiversion": "2019-06-01", "name": "[parameters('streamanalyticsjobname')]", "location": "[parameters('location')]", "properties": {"sku": {"name": "standard"}, "outputerrorpolicy": "stop", "eventsoutoforderpolicy": "adjust", "eventsoutofordermaxdelayinseconds": 0, "eventslatearrivalmaxdelayinseconds": 5, "datalocale": "en-us", "transformation": {"name": "transformation", "properties": {"streamingunits": "[parameters('numberofstreamingunits')]", "query": "select\r\n *\r\ninto\r\n [youroutputalias]\r\nfrom\r\n [yourinputalias]"}}}} |
This template demonstrates how to create a container group with VNet. | {"type": "microsoft.containerinstance/containergroups", "apiversion": "2019-12-01", "name": "[parameters('containergroupname')]", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('containername')]", "properties": {"image": "[parameters('image')]", "ports": [{"port": "[parameters('port')]", "protocol": "tcp"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}}}], "ostype": "linux", "networkprofile": {"id": "[resourceid('microsoft.network/networkprofiles", variables('networkprofilename'))]"}, "restartpolicy": "always"}, "dependson": ["[resourceid('microsoft.network/networkprofiles", variables('networkprofilename'))]"]} |
Create an on-demand SFTP Server with persistent storage | {"type": "microsoft.containerinstance/containergroups", "apiversion": "2019-12-01", "name": "[variables('sftpcontainergroupname')]", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[variables('sftpcontainername')]", "properties": {"image": "[variables('sftpcontainerimage')]", "environmentvariables": [{"name": "sftp_users", "value": "[variables('sftpenvvariable')]"}], "resources": {"requests": {"cpu": 2, "memoryingb": 1}}, "ports": [{"port": 22}], "volumemounts": [{"name": "sftpvolume", "mountpath": "[format('/home/{0}/upload", parameters('sftpuser'))]", "readonly": false}]}}], "ostype": "linux", "ipaddress": {"type": "public", "ports": [{"protocol": "tcp", "port": 22}]}, "restartpolicy": "onfailure", "volumes": [{"name": "sftpvolume", "azurefile": {"readonly": false, "sharename": "[parameters('filesharename')]", "storageaccountname": "[variables('storageaccountname')]", "storageaccountkey": "[listkeys(resourceid('microsoft.storage/storageaccounts", variables('storageaccountname')), "2021-04-01').keys[0].value]"}}]}, "dependson": ["[resourceid('microsoft.resources/deploymentscripts", variables('scriptname'))]", "[resourceid('microsoft.storage/storageaccounts", variables('storageaccountname'))]"]} |
This templates creates an ACI resource and exposes a container through UDP | {"type": "microsoft.containerinstance/containergroups", "name": "[concat(variables('containername'),variables('randomname'),"1')]", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[variables('containername')]", "properties": {"image": "[variables('containeruri')]", "ports": [{"protocol": "[parameters('portprotocol')]", "port": "[variables('port')]"}], "resources": {"requests": {"cpu": "[variables('numbercores')]", "memoryingb": "[variables('memory')]"}}}}], "ostype": "[variables('ostype')]", "ipaddress": {"type": "public", "ports": [{"protocol": "[parameters('portprotocol')]", "port": "[variables('port')]"}]}}} |
This template demonstrates how to create a container group with a Linux container that has a secret volume using Azure Container Instances. | {"type": "microsoft.containerinstance/containergroups", "apiversion": "2020-11-01", "name": "[parameters('name')]", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('containername')]", "properties": {"image": "[parameters('imagename')]", "ports": [{"port": "[parameters('port')]"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}, "volumemounts": [{"name": "[parameters('volumename')]", "mountpath": "/mnt/secrets", "readonly": false}]}}], "ostype": "linux", "ipaddress": {"type": "public", "dnsnamelabel": "[parameters('dnsnamelabel')]", "ports": [{"protocol": "tcp", "port": "[parameters('port')]"}]}, "volumes": [{"name": "[parameters('volumename')]", "secret": {"sslcertificatedata": "[parameters('sslcertificatedata')]", "sslcertificatepwd": "[base64(parameters('sslcertificatepwd'))]"}}]}} |
This template demonstrates how to create a container group with a Linux container that has a health probe using Azure Container Instances. | {"name": "[parameters('containergroupname')]", "type": "microsoft.containerinstance/containergroups", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('containername')]", "properties": {"command": ["/bin/sh", "-c", "touch /tmp/healthy; sleep 30; rm -rf /tmp/healthy; sleep 600"], "image": "[parameters('imagename')]", "ports": [{"port": "[parameters('port')]"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}, "livenessprobe": {"exec": {"command": ["cat", "/tmp/healthy"]}, "periodseconds": 5}}}], "ostype": "linux", "ipaddress": {"type": "public", "ports": [{"protocol": "tcp", "port": "[parameters('port')]"}]}}} |
This template demonstrates how to create a container group with a single Linux container and a public IP address using Azure Container Instances. | {"type": "microsoft.containerinstance/containergroups", "apiversion": "2019-12-01", "name": "[parameters('name')]", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('name')]", "properties": {"image": "[parameters('image')]", "ports": [{"port": "[parameters('port')]", "protocol": "tcp"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}}}], "ostype": "linux", "restartpolicy": "[parameters('restartpolicy')]", "ipaddress": {"type": "public", "ports": [{"port": "[parameters('port')]", "protocol": "tcp"}]}}} |
This template demonstrates how to create a container group with a Linux container that has a secure environment variable using Azure Container Instances. | {"name": "[parameters('containergroupname')]", "type": "microsoft.containerinstance/containergroups", "apiversion": "2019-12-01", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('containername')]", "properties": {"image": "[parameters('imagename')]", "ports": [{"port": "[parameters('port')]"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}, "environmentvariables": [{"name": "[parameters('environmentvariablename')]", "securevalue": "[parameters('environmentvariablevalue')]"}]}}], "ostype": "linux", "ipaddress": {"type": "public", "ports": [{"protocol": "tcp", "port": "[parameters('port')]"}]}}} |
This template demonstrates how to create a container group with two Linux containers that share an emptyDir volume using Azure Container Instances. | {"name": "[parameters('containergroupname')]", "type": "microsoft.containerinstance/containergroups", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('containername1')]", "properties": {"image": "nginx", "ports": [{"port": "[parameters('port')]"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}, "volumemounts": [{"name": "[parameters('volumename')]", "mountpath": "/var/log/nginx", "readonly": false}]}}, {"name": "[parameters('containername2')]", "properties": {"command": ["bin/bash", "-c", "while sleep 5; do cat /mnt/input/access.log; done"], "image": "[parameters('image')]", "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}, "volumemounts": [{"name": "[parameters('volumename')]", "mountpath": "/mnt/input", "readonly": true}]}}], "ostype": "linux", "ipaddress": {"type": "public", "ports": [{"protocol": "tcp", "port": "[parameters('port')]"}]}, "volumes": [{"name": "[parameters('volumename')]", "emptydir": {}}]}} |
This template demonstrates how to create a container group with a gitRepo volume using Azure Container Instances. | {"name": "[parameters('containergroupname')]", "type": "microsoft.containerinstance/containergroups", "apiversion": "2020-11-01", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[parameters('containername')]", "properties": {"image": "nginx", "ports": [{"port": "[parameters('port')]"}], "resources": {"requests": {"cpu": "[parameters('cpucores')]", "memoryingb": "[parameters('memoryingb')]"}}, "volumemounts": [{"name": "[parameters('volumename')]", "mountpath": "/mnt/gitrepos/", "readonly": false}]}}], "ostype": "linux", "ipaddress": {"type": "public", "ports": [{"protocol": "tcp", "port": "[parameters('port')]"}]}, "volumes": [{"name": "[parameters('volumename')]", "gitrepo": {"repository": "https://github.com/azure-samples/aci-helloworld.git"}}]}} |
Create an on-demand SFTP Server with persistent storage using an existing storage account | {"type": "microsoft.containerinstance/containergroups", "name": "[variables('sftpcontainergroupname')]", "apiversion": "2019-12-01", "location": "[parameters('location')]", "properties": {"containers": [{"name": "[variables('sftpcontainername')]", "properties": {"image": "[variables('sftpcontainerimage')]", "environmentvariables": [{"name": "sftp_users", "value": "[variables('sftpenvvariable')]"}], "resources": {"requests": {"cpu": 2, "memoryingb": 1}}, "ports": [{"port": 22}], "volumemounts": [{"mountpath": "[concat('/home/", parameters('sftpuser'), "/upload')]", "name": "sftpvolume", "readonly": false}]}}], "ostype": "linux", "ipaddress": {"type": "public", "ports": [{"protocol": "tcp", "port": 22}]}, "restartpolicy": "onfailure", "volumes": [{"name": "sftpvolume", "azurefile": {"readonly": false, "sharename": "[parameters('existingfilesharename')]", "storageaccountname": "[parameters('existingstorageaccountname')]", "storageaccountkey": "[listkeys(variables('storageaccountid'),"2018-02-01').keys[0].value]"}}]}} |
This template creates an Azure Container Registry with policies, diagnostics along with other configurable options such as identities, IP rules, etc. | {"type": "microsoft.containerregistry/registries", "apiversion": "2021-06-01-preview", "name": "[parameters('acrname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('acrsku')]"}, "identity": "[if(parameters('enablesystemidentity'), createobject('type", "systemassigned'), if(not(empty(parameters('userassignedidentities'))), createobject('type", "userassigned", "userassignedidentities", parameters('userassignedidentities')), null()))]", "properties": {"adminuserenabled": "[parameters('enableadminuser')]", "publicnetworkaccess": "[parameters('publicnetworkaccess')]", "zoneredundancy": "[parameters('zoneredundancy')]", "networkrulebypassoptions": "[parameters('networkrulebypassoptions')]", "networkruleset": "[if(not(empty(parameters('iprules'))), createobject('defaultaction", parameters('iprules').defaultaction, "iprules", parameters('iprules').iprules), createobject())]", "policies": "[parameters('policies')]"}} |
A template for creating a new Azure Container Registry. Use this template as the framework for your custom deployment. | {"type": "microsoft.containerregistry/registries", "apiversion": "2019-12-01-preview", "name": "[parameters('acrname')]", "location": "[parameters('location')]", "sku": {"name": "[parameters('acrsku')]"}, "tags": {"displayname": "container registry", "container.registry": "[parameters('acrname')]"}, "properties": {"adminuserenabled": "[parameters('acradminuserenabled')]"}}{"type": "microsoft.containerregistry/registries/replications", "apiversion": "2019-12-01-preview", "name": "[format('{0}/{1}", parameters('acrname'), parameters('acrreplicalocation'))]", "location": "[parameters('acrreplicalocation')]", "properties": {}, "dependson": ["[resourceid('microsoft.containerregistry/registries", parameters('acrname'))]"]} |
A template for creating a new Azure Container Registry. Use this template as the framework for your custom deployment. | {"type": "microsoft.containerregistry/registries", "apiversion": "2019-12-01-preview", "name": "[parameters('acrname')]", "location": "[parameters('location')]", "tags": {"displayname": "container registry", "container.registry": "[parameters('acrname')]"}, "sku": {"name": "[parameters('acrsku')]"}, "properties": {"adminuserenabled": "[parameters('acradminuserenabled')]"}} |
This template creates an Azure Relay namespace and a WCF Relay | {"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.relay/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('wcfrelayname')]", "type": "wcfrelays", "dependson": ["[resourceid('microsoft.relay/namespaces", parameters('namespacename'))]"], "properties": {"relaytype": "[parameters('wcfrelaytype')]", "requiresclientauthorization": "false", "requirestransportsecurity": "false", "usermetadata": "meta data supplied by user for wcfrelays"}}]} |
This template creates an Azure Relay namespace with a Standard SKU. | {"apiversion": "2018-01-01-preview", "name": "[parameters('namespace')]", "type": "microsoft.relay/namespaces", "location": "[parameters('location')]", "kind": "relay", "properties": {}} |
This template creates an Azure Relay namespace, a WcfRealy and authorization rules for both the namespace and WcfRealy. | {"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.relay/namespaces", "location": "[variables('location')]", "sku": {"name": "standard"}, "properties": {}, "resources": [{"apiversion": "[variables('apiversion')]", "name": "[parameters('wcfrelayname')]", "type": "wcfrelays", "dependson": ["[resourceid('microsoft.relay/namespaces/", parameters('namespacename'))]"], "properties": {"relaytype": "[parameters('wcfrelaytype')]", "requiresclientauthorization": "false", "requirestransportsecurity": "false", "usermetadata": "meta data supplied by user for wcfrelays"}, "resources": [{"apiversion": "[variables('apiversion')]", "name": "[parameters('wcfrelayauthorizationrulename')]", "type": "authorizationrules", "dependson": ["[parameters('wcfrelayname')]"], "properties": {"rights": ["listen"]}}]}, {"apiversion": "[variables('apiversion')]", "name": "[variables('namespaceauthrulename')]", "type": "microsoft.relay/namespaces/authorizationrules", "dependson": ["[resourceid('microsoft.relay/namespaces/", parameters('namespacename'))]"], "properties": {"rights": ["send"]}}]} |
This template creates an Azure Relay namespace and HybridConnection. | {"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.relay/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('hybridconnectionname')]", "type": "hybridconnections", "dependson": ["[resourceid('microsoft.relay/namespaces", parameters('namespacename'))]"], "properties": {"requiresclientauthorization": "true", "usermetadata": "meta data supplied by user for hybridconnections"}}]} |
This template creates an Azure Relay namespace, a WCF Relay and a HybridConnection. | {"apiversion": "2017-04-01", "name": "[parameters('namespacename')]", "type": "microsoft.relay/namespaces", "location": "[parameters('location')]", "sku": {"name": "standard"}, "properties": {}, "resources": [{"apiversion": "2017-04-01", "name": "[parameters('wcfrelayname')]", "type": "wcfrelays", "dependson": ["[resourceid('microsoft.relay/namespaces", parameters('namespacename'))]"], "properties": {"relaytype": "[parameters('wcfrelaytype')]", "requiresclientauthorization": "false", "requirestransportsecurity": "false", "usermetadata": "meta data supplied by user for wcfrelays"}}, {"apiversion": "2017-04-01", "name": "[parameters('hybridconnectionname')]", "type": "hybridconnections", "dependson": ["[resourceid('microsoft.relay/namespaces", parameters('namespacename'))]"], "properties": {"requiresclientauthorization": "true", "usermetadata": "meta data supplied by user hybridconnections"}}]} |
This template creates an Azure Relay namespace, a HybridConnection and authorization rules for both the namespace and HybridConnection. | {"apiversion": "2018-01-01-preview", "name": "[parameters('namespacename')]", "type": "microsoft.relay/namespaces", "location": "[variables('location')]", "kind": "relay", "resources": [{"apiversion": "[variables('apiversion')]", "name": "[parameters('hybridconnectionname')]", "type": "hybridconnections", "dependson": ["[resourceid('microsoft.relay/namespaces/", parameters('namespacename'))]"], "properties": {"requiresclientauthorization": "true", "usermetadata": "meta data supplied by user hybridconnections"}, "resources": [{"apiversion": "[variables('apiversion')]", "name": "[parameters('hybridconnectionauthorizationrulename')]", "type": "authorizationrules", "dependson": ["[parameters('hybridconnectionname')]"], "properties": {"rights": ["listen"]}}]}, {"apiversion": "[variables('apiversion')]", "name": "[variables('namespaceauthrulename')]", "type": "microsoft.relay/namespaces/authorizationrules", "dependson": ["[resourceid('microsoft.relay/namespaces/", parameters('namespacename'))]"], "properties": {"rights": ["send"]}}]} |
This template configures protection for an existing File Share present in an existing Storage Account. | {"condition": "[parameters('isnewvault')]", "type": "microsoft.recoveryservices/vaults", "apiversion": "2020-02-02", "name": "[parameters('vaultname')]", "location": "[parameters('location')]", "sku": {"name": "rs0", "tier": "standard"}, "properties": {}}{"condition": "[parameters('isnewpolicy')]", "type": "microsoft.recoveryservices/vaults/backuppolicies", "apiversion": "2020-02-02", "name": "[concat(parameters('vaultname'), "/", parameters('policyname'))]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"], "properties": {"backupmanagementtype": "[variables('backupmanagementtype')]", "schedulepolicy": {"schedulerunfrequency": "daily", "scheduleruntimes": "[variables('scheduleruntimes')]", "schedulepolicytype": "simpleschedulepolicy"}, "retentionpolicy": {"dailyschedule": {"retentiontimes": "[variables('scheduleruntimes')]", "retentionduration": {"count": "[parameters('dailyretentiondurationcount')]", "durationtype": "days"}}, "weeklyschedule": {"daysoftheweek": "[parameters('daysoftheweek')]", "retentiontimes": "[variables('scheduleruntimes')]", "retentionduration": {"count": "[parameters('weeklyretentiondurationcount')]", "durationtype": "weeks"}}, "monthlyschedule": {"retentionscheduleformattype": "daily", "retentionscheduledaily": {"daysofthemonth": [{"date": 1, "islast": false}]}, "retentiontimes": "[variables('scheduleruntimes')]", "retentionduration": {"count": "[parameters('monthlyretentiondurationcount')]", "durationtype": "months"}}, "yearlyschedule": {"retentionscheduleformattype": "daily", "monthsofyear": "[parameters('monthsofyear')]", "retentionscheduledaily": {"daysofthemonth": [{"date": 1, "islast": false}]}, "retentiontimes": "[variables('scheduleruntimes')]", "retentionduration": {"count": "[parameters('yearlyretentiondurationcount')]", "durationtype": "years"}}, "retentionpolicytype": "longtermretentionpolicy"}, "timezone": "[parameters('timezone')]", "workloadtype": "azurefileshare"}}{"condition": "[parameters('registerstorageaccount')]", "type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers", "apiversion": "2020-02-02", "name": "[concat(parameters('vaultname'), "/", variables('backupfabric'), "/storagecontainer;storage;", parameters('existingresourcegroupname'), ";", parameters('existingstorageaccountname'))]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"], "properties": {"backupmanagementtype": "[variables('backupmanagementtype')]", "containertype": "storagecontainer", "sourceresourceid": "[resourceid(parameters('existingresourcegroupname'), "microsoft.storage/storageaccounts", parameters('existingstorageaccountname'))]"}}{"type": "microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers/protecteditems", "apiversion": "2020-02-02", "name": "[concat(parameters('vaultname'), "/", variables('backupfabric'), "/storagecontainer;storage;", parameters('existingresourcegroupname'), ";", parameters('existingstorageaccountname'), "/azurefileshare;", parameters('existingfilesharename'))]", "dependson": ["[resourceid('microsoft.recoveryservices/vaults/backupfabrics/protectioncontainers", parameters('vaultname'), variables('backupfabric'), concat('storagecontainer;storage;", parameters('existingresourcegroupname'), ";", parameters('existingstorageaccountname')))]", "[resourceid('microsoft.recoveryservices/vaults/backuppolicies", parameters('vaultname'), parameters('policyname'))]", "[resourceid('microsoft.recoveryservices/vaults", parameters('vaultname'))]"], "properties": {"protecteditemtype": "azurefileshareprotecteditem", "sourceresourceid": "[resourceid(parameters('existingresourcegroupname'), "microsoft.storage/storageaccounts", parameters('existingstorageaccountname'))]", "policyid": "[resourceid('microsoft.recoveryservices/vaults/backuppolicies", parameters('vaultname'), parameters('policyname'))]", "isinlineinquiry": true}} |