Azure ARM Template: Security linked service must have | resourceMetadata property (Code:InvalidParameter)

balwant patel 1 Reputation point
2022-06-07T13:34:10.683+00:00

Hi,

I need help to resolve below error. I have exported the template from existing resource group and trying to deploy resources to new resource group but I'm getting below error.

| 14:04:52 - The deployment 'DefaultResourceGroup-SUK' failed with error(s). Showing 1 out of 1 error(s). Status Message: One or
| more errors occurred. Operation Id: '83376114901243448e13f2ca942970cb' (Code: InvalidInput) - Security linked service must have
| resourceMetadata property (Code:InvalidParameter) - Invalid resourceMetadata date. must be before today (Code:InvalidParameter)
| CorrelationId: d954fbd2-a9a9-4ef0-a6b2-51aeec04eefa

My ARM is as below:

{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"workspaces_defaultworkspace_suk_name": {
"defaultValue": "defaultworkspace-6dadb784a4e5-suk",
"type": "String"
},
"solutions_Security_DefaultWorkspace_SUK__name": {
"defaultValue": "Security(DefaultWorkspace-6dadb784a4e5-SUK)",
"type": "String"
},
"solutions_SecurityCenterFree_DefaultWorkspace_SUK__name": {
"defaultValue": "SecurityCenterFree(DefaultWorkspace-6dadb784a4e5-SUK)",
"type": "String"
}//,

},
"variables": {},
"resources": [
    {
        "type": "microsoft.operationalinsights/workspaces",
        "apiVersion": "2021-12-01-preview",
        "name": "[parameters('workspaces_defaultworkspace_suk_name')]",
        "location": "uksouth",
        "properties": {
            "sku": {
                "name": "PerGB2018"
            },
            "retentionInDays": 30,
            "features": {
                "enableLogAccessUsingOnlyResourcePermissions": true
            },
            "workspaceCapping": {
                "dailyQuotaGb": -1
            },
            "publicNetworkAccessForIngestion": "Enabled",
            "publicNetworkAccessForQuery": "Enabled"
        }
    },
    {
        "type": "Microsoft.OperationsManagement/solutions",
        "apiVersion": "2015-11-01-preview",
        "name": "[parameters('solutions_Security_DefaultWorkspace_SUK__name')]",
        "location": "UK South",
        "dependsOn": [
            "[resourceId('microsoft.operationalinsights/workspaces', parameters('workspaces_defaultworkspace_suk_name'))]"
        ],
        "plan": {
            "name": "Security(defaultworkspace-6dadb784a4e5-suk)",
            "promotionCode": "",
            "product": "OMSGallery/Security",
            "publisher": "Microsoft"
        },
        "properties": {
            "workspaceResourceId": "[resourceId('microsoft.operationalinsights/workspaces', parameters('workspaces_defaultworkspace_suk_name'))]",
            "containedResources": [
                "[concat(resourceId('microsoft.operationalinsights/workspaces', parameters('workspaces_defaultworkspace_suk_name')), concat('/views/', parameters('solutions_Security_DefaultWorkspace_SUK__name')))]"
            ]
        }
    },
    {
          "type": "Microsoft.OperationalInsights/workspaces/linkedservices",
          "apiVersion": "2020-08-01",
          "name": "[concat(parameters('workspaces_defaultworkspace_suk_name'), '/Security')]",
          "location": "uksouth",
          "dependsOn": [
              "[resourceId('6dadb784a4e5' ,'LIP-Balwant-Test' ,'Microsoft.OperationalInsights/workspaces', parameters('workspaces_defaultworkspace_suk_name'))]"
          ],
          "properties": {
              "resourceId": "[resourceId('microsoft.operationalinsights/workspaces', parameters('workspaces_defaultworkspace_suk_name'))]",
              "provisioningState": "Succeeded"
          }
     }
    ]
}
Azure Resource Mover
Azure Resource Mover
An Azure service used for moving multiple resources between Azure regions.
200 questions
{count} votes

1 answer

Sort by: Most helpful
  1. tbgangav-MSFT 10,381 Reputation points
    2022-07-06T13:11:42.25+00:00

    Hi @balwant patel ,

    Please find the below update:

    Yes, security linked services require the mandatory property “properties.resourceMetadata” on create/update. The value for it should probably be the solution provisioning date. We will confirm it once we update the documentation around it in related ARM template reference. There are different permutations to the linked service resource property bag, each one with its set of requirements.

    An example for reference:

    "properties": {  
                "resourceId": "/subscriptions/xxxxxxxxxxxxxxxxxxxxxxx/resourcegroups/defaultresourcegroup-wus2/providers/microsoft.operationalinsights/workspaces/xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",  
                "resourceMetadata": "8/13/2020 5:36:12 AM",  
            }  
    
    0 comments No comments