Create an Azure Automation account and create a new Azure Monitor Log Analytics workspace if it doesn't exist, and then link them together.
{"type": "microsoft.automation/automationaccounts", "apiversion": "2021-04-01", "location": "[parameters('location')]", "name": "[parameters('automationaccountname')]", "tags": {"arotoolkitversion": "[variables('arotoolkitversion')]"}, "comments": "automation account", "properties": {"sku": {"name": "basic"}}}{"type": "microsoft.automation/automationaccounts/variables", "apiversion": "2021-04-01", "name": "[concat(parameters('automationaccountname'), "/", variables('automationvariables')[copyindex()].name)]", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]"], "copy": {"name": "variableloop", "count": "[length(variables('automationvariables'))]"}, "properties": {"description": "[variables('automationvariables')[copyindex()].description]", "value": "[variables('automationvariables')[copyindex()].value]"}}{"type": "microsoft.automation/automationaccounts/variables", "apiversion": "2021-04-01", "name": "[concat(parameters('automationaccountname'), "/", variables('internalazuresubscriptionid').name)]", "dependson": ["[resourceid('microsoft.automation/automationaccounts", parameters('automationaccountname'))]"], "properties": {"description": "[variables('internalazuresubscriptionid').description]", "isencrypted": true, "type": "string", "value": "[variables('internalazuresubscriptionid').value]"}} 