Sachin Kalia
Sachin Kalia

Reputation: 1107

A nested resource type must have identical number of segments as its resource name

When i try to deploy/enable diagnostic settings on Azure Firewall through ARM template. Though i get error. I'm following this link

code snippet which i'm using:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {},
    "variables": {
        "workspaceId": "[Concat('/subscriptions/', subscription().subscriptionId, '/resourceGroups/', resourceGroup().name, '/providers/Microsoft.OperationalInsights/workspaces/', 'Fw-LA')]"
    },
    "resources": [
        {
            "type": "Microsoft.Network/azureFirewalls/diagnosticSettings",
            "apiVersion": "2017-05-01-preview",
            "name": "[concat('FWHM/','Microsoft.Insights/', 'dignostic')]",
            "properties": {
                "name": "diagnostic",
                "workspaceId": "[variables('workspaceId')]",
                "logs": [
                    {
                        "category": "AzureFirewallApplicationRule",
                        "enabled": true,
                        "retentionPolicy": {
                            "days": 10,
                            "enabled": false
                        }
                    }
                ],
                "metrics": [
                    {
                        "category": "AllMetrics",
                        "enabled": true,
                        "retentionPolicy": {
                            "enabled": false,
                            "days": 0
                        }
                    }
                ]
            }
        }
    ]
}

Upvotes: 0

Views: 2510

Answers (1)

4c74356b41
4c74356b41

Reputation: 72181

this:

"type": "Microsoft.Network/azureFirewalls/diagnosticSettings",

should be this instead:

"type": "Microsoft.Network/azureFirewalls/providers/diagnosticSettings",

read the article you linked carefully

Upvotes: 1

Related Questions