how Azure ARM templates process placeholders please?

LXF 160 Reputation points
2024-06-11T02:47:43.6333333+00:00

Could you explain how Azure ARM templates process placeholders and variables during deployment, especially comparing the '[variables]' syntax with templating mechanisms like {{variables}}?

I see some of the codes (from Sentinel Solution folder @ github) put placeholders like:

"""
{
	"type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
	"apiVersion": "2022-09-01-preview",
	"name": "xxxSecurityEvents",
	"location": "{{location}}",
	"kind": "Customizable",
	"properties": {
		"connectorUiConfig": {
			"id": "xxxSecurityEvents",
			"title": "xxx Security Events",
			"publisher": "xxx",
			"descriptionMarkdown": "xxx Security Events",
			"graphQueriesTableName": "xxxSecurityEvents_CL",
			"graphQueries": [
				{
					"metricName": "Total events received",
					"legend": "xxx Events",
					"baseQuery": "{{graphQueriesTableName}}"
				}
			],
			"sampleQueries": [
				{
					"description": "Get Sample of xxx Events",
					"query": "{{graphQueriesTableName}}\n | take 10"
				}
			],
			"dataTypes": [
				{
					"name": "{{graphQueriesTableName}}",
					"lastDataReceivedQuery": "{{graphQueriesTableName}}\n | where TimeGenerated > ago(12h) | where name_s == \"no data test\" | summarize Time = max(TimeGenerated)\n | where isnotempty(Time)"
				}
			],
"""

But I also see others from 'mainTemplate.json" look like:

"""
  "variables": {
    "workspaceName": "[concat('log-SSG', parameters('tenantName'))]",
    "resourceGroupName": "[concat('SSG-',parameters('tenantName'))]",
    "tableName": "xxx_CL",
    "dceName": "[concat(parameters('tenantName'),'-DCE')]",
    "dataConnectorName": "xxx_connector"
  },
  "resources": [
    {
      "type": "Microsoft.OperationalInsights/workspaces",
      "apiVersion": "2021-12-01-preview",
      "name": "[variables('workspaceName')]",
      "location": "[resourceGroup().location]",
      "properties": {
        "retentionInDays": "[parameters('retentionInDays')]"
      }
    },
"""
Microsoft Sentinel
Microsoft Sentinel
A scalable, cloud-native solution for security information event management and security orchestration automated response. Previously known as Azure Sentinel.
1,037 questions
{count} votes