Reputation: 1
I am not able to create a Data Collection Rule for collecting Change tracking and Inventory changes. There is a provided JSON script on MS Docs (https://learn.microsoft.com/en-us/azure/automation/change-tracking/change-tracking-data-collection-rule-creation)
Deploying custom template -> importing JSON file -> verification failed (Invalid Template)
{ "code": "InvalidTemplate", "message": "Deployment template validation failed: 'The template variable 'subscriptionId' is not valid: Unable to evaluate the template language function 'substring'. The length parameter cannot be less than zero. The length parameter: '-16'. Please see https://aka.ms/arm-function-substring for usage details.. Please see https://aka.ms/arm-functions for usage details.'." }
Any idea what could be wrong?
It is related to Docs about Azure Automation and Azure Monitoring Agents (https://learn.microsoft.com/en-us/azure/automation/change-tracking/enable-vms-monitoring-agent?tabs=singlevm%2Carcvm)
Thank you for your help.
Upvotes: 0
Views: 279
Reputation: 129
You need to use the full Resource ID of the Workspace in the template for the workspaceResourceId parameter; e.g.,
/subscriptions/<subscription_id/resourceGroups/<rg_name>/providers/Microsoft.OperationalInsights/workspaces/<law_name>
Upvotes: 0