Public/Deploy/Core/automation/New-CmAzCoreAutomation.LinkedServices.json

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "2.0.0.0",
    "parameters": {
        "AccountName": {
            "type": "String"
        },
        "AutomationResourceGroupName": {
            "type": "String"
        },
        "WorkspaceName": {
            "type": "String"
        }
    },
    "resources": [
        {
            "type": "Microsoft.OperationalInsights/Workspaces/LinkedServices",
            "apiVersion": "2020-03-01-preview",
            "name": "[concat(parameters('WorkspaceName'), '/automation')]",
            "location": "[resourceGroup().location]",
            "properties": {
                "resourceId": "[resourceId(parameters('AutomationResourceGroupName'), 'Microsoft.Automation/automationAccounts', parameters('AccountName'))]",
                "provisioningState": "Succeeded"
            }
        }
    ]
}