Azure Synapse: create a diagnostic settings using ARM teplates

Roman Pijacek 131 Reputation points
2021-05-10T15:12:14.077+00:00

Hello,

please, is it possible/supported to create a diagnostic settings for Azure Synapse WS using ARM templates?
Found an example for Azure SQL DB:

resource-manager-diagnostic-settings

but could not find any related to Synapse WS. Thank you.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,373 questions
0 comments No comments
{count} votes

Accepted answer
  1. Roman Pijacek 131 Reputation points
    2021-07-20T09:43:09.667+00:00

    Hello @Simon Zeinstra please, can you try out this example:

    {  
        "condition":"[equals(parameters('enableDiagnosticSettings'),'true')]",  
        "scope":"[format('Microsoft.Synapse/workspaces/{0}', variables('synapseWorkspaceName'))]",  
        "type":"Microsoft.Insights/diagnosticsettings",  
        "apiVersion":"2017-05-01-preview",  
        "name":"[concat('diag-', variables('synapseWorkspaceName'))]",  
        "dependsOn":[  
            "[resourceId('Microsoft.Synapse/workspaces', variables('synapseWorkspaceName'))]"  
        ],  
        "properties":{  
            "workspaceId":"[parameters('logAnalyticsWorkspaceId')]",  
            "copy":[  
                {  
                    "name":"logs",  
                    "count":"[length(parameters('synapseWsDiagLogs'))]",  
                    "input":{  
                        "category":"[parameters('synapseWsDiagLogs')[copyIndex('logs')]]",  
                        "enabled":true  
                    }  
                }  
            ]  
        }  
    }  
    

    And here is the param definition for Logs:

    "synapseWsDiagLogs":{  
        "type":"array",  
        "defaultValue":[  
            "SynapseRbacOperations",  
            "GatewayApiRequests",  
            "BuiltinSqlReqsEnded",  
            "IntegrationPipelineRuns",  
            "IntegrationActivityRuns",  
            "IntegrationTriggerRuns"  
        ],  
        "metadata":{  
            "description":"List of log diagnostic events to capture from Synapse WS and send to log analytics"  
        }  
    },  
    
    1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Roman Pijacek 131 Reputation points
    2021-05-17T10:37:39.913+00:00

    [Code sample edited]
    Thank you @Samara Soucy - MSFT , I tweaked the existing Azure SQL DB example and here is the working code snippet (sharing for others who might need to create Diagnostic Settings for Synapse WS in ARM template):

     {  
         "condition":"[equals(parameters('enableDiagnosticSettings'),'true')]",  
         "scope":"[format('Microsoft.Synapse/workspaces/{0}', variables('synapseWorkspaceName'))]",  
         "type":"Microsoft.Insights/diagnosticsettings",  
         "apiVersion":"2017-05-01-preview",  
         "name":"[concat('diag-', variables('synapseWorkspaceName'))]",  
         "dependsOn":[  
             "[resourceId('Microsoft.Synapse/workspaces', variables('synapseWorkspaceName'))]"  
         ],  
         "properties":{  
             "workspaceId":"[parameters('logAnalyticsWorkspaceId')]",  
             "copy":[  
                 {  
                     "name":"logs",  
                     "count":"[length(parameters('synapseWsDiagLogs'))]",  
                     "input":{  
                         "category":"[parameters('synapseWsDiagLogs')[copyIndex('logs')]]",  
                         "enabled":true  
                     }  
                 }  
             ]  
         }  
     }  
    

    and here is the param definition for Logs:

     "synapseWsDiagLogs":{  
         "type":"array",  
         "defaultValue":[  
             "SynapseRbacOperations",  
             "GatewayApiRequests",  
             "BuiltinSqlReqsEnded",  
             "IntegrationPipelineRuns",  
             "IntegrationActivityRuns",  
             "IntegrationTriggerRuns"  
         ],  
         "metadata":{  
             "description":"List of log diagnostic events to capture from Synapse WS and send to log analytics"  
         }  
     },  
    
    1 person found this answer helpful.

  2. Samara Soucy - MSFT 5,141 Reputation points
    2021-05-10T23:36:57.047+00:00

    The template for Synapse would essentially be the same. Instead of microsoft.sql/servers/databases/providers/diagnosticSettings it would be Microsoft.Synapse/workspaces/providers/diagnosticSettings and you will need to replace the metric names for the ones you want to setup for Synapse.

    There is more info on how this works generally is in the Azure Monitor docs: https://learn.microsoft.com/en-us/azure/azure-monitor/essentials/resource-manager-diagnostic-settings

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.