{
    "name": "AnvilogicCCFDefinition",
    "apiVersion": "2022-09-01-preview",
    "type": "Microsoft.SecurityInsights/dataConnectorDefinitions",
    "location": "{{location}}",
    "kind": "Customizable",
    "properties": {
        "connectorUiConfig": {
            "id": "AnvilogicCCFDefinition",
            "title": "Anvilogic",
            "publisher": "Anvilogic",
            "descriptionMarkdown": "The Anvilogic data connector allows you to pull events of interest generated in the Anvilogic ADX cluster into your Microsoft Sentinel",
            "graphQueriesTableName": "Anvilogic_Alerts_CL",
            "graphQueries": [
                {
                    "metricName": "Total data received",
                    "legend": "Anvilogic events of interest",
                    "baseQuery": "{{graphQueriesTableName}}"
                }
            ],
            "sampleQueries": [
                {
                    "description": "Get a sample of Anvilogic events of interest",
                    "query": "{{graphQueriesTableName}} | take 10"
                }
            ],
            "dataTypes": [
                {
                    "name": "{{graphQueriesTableName}}",
                    "lastDataReceivedQuery": "{{graphQueriesTableName}} | summarize Time=max(TimeGenerated) | where isnotempty(Time)"
                }
            ],
            "availability": {
                "isPreview": false
            },
            "connectivityCriteria": [
                {
                    "type": "HasDataConnectors"
                }
            ],
            "permissions": {
                "resourceProvider": [
                    {
                        "provider": "Microsoft.OperationalInsights/workspaces",
                        "permissionsDisplayText": "Read and Write permissions are required.",
                        "providerDisplayName": "Workspace",
                        "scope": "Workspace",
                        "requiredPermissions": {
                            "write": true,
                            "read": true,
                            "delete": true
                        }
                    }
                ],
                "customs": [
                    {
                        "name": "Anvilogic Application Registration Client ID and Client Secret",
                        "description": "To access the Anvilogic ADX we require the client id and client secret from the Anvilogic app registration"
                    }
                ]
            },
            "instructionSteps": [
                {
                    "description": "Complete the form to ingest Anvilogic Alerts into your Microsoft Sentinel",
                    "instructions": [
                        {
                            "type": "Textbox",
                            "parameters": {
                                "label": "Token Endpoint",
                                "placeholder": "https://login[.]microsoftonline[.]com/<tenant_id>/oauth2/v2.0/token",
                                "type": "text",
                                "name": "tokenEndpoint"
                            }
                        },
                        {
                            "type": "Textbox",
                            "parameters": {
                                "label": "Anvilogic ADX Scope",
                                "placeholder": "<avl_adx_uri>/.default",
                                "type": "text",
                                "name": "authorizationEndpoint"
                            }
                        },
                        {
                            "type": "Textbox",
                            "parameters": {
                                "label": "Anvilogic ADX Request URI",
                                "placeholder": "<avl_adx_uri>/v2/rest/query",
                                "type": "text",
                                "name": "apiEndpoint"
                            }
                        },
                        {
                            "type": "OAuthForm",
                            "parameters": {
                                "clientIdLabel": "Client ID",
                                "clientSecretLabel": "Client Secret",
                                "connectButtonLabel": "Connect",
                                "disconnectButtonLabel": "Disconnect"
                            }
                        }
                    ],
                    "title": "Connect to Anvilogic to start collecting events of interest in Microsoft Sentinel"
                }
            ]
        }
    }
}