Skip to content

Instantly share code, notes, and snippets.

@abenteuerzeit
Last active February 12, 2024 11:45
Show Gist options
  • Save abenteuerzeit/44c6f96514ba574d6abf7330bd7ab271 to your computer and use it in GitHub Desktop.
Save abenteuerzeit/44c6f96514ba574d6abf7330bd7ab271 to your computer and use it in GitHub Desktop.
Azure ARM Templates

Web PubSub Service

template.json

{
    "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "WebPubSub_wsINOWY5Zj_name": {
            "defaultValue": "wsINOWY5Zj",
            "type": "String"
        }
    },
    "variables": {},
    "resources": [
        {
            "type": "Microsoft.SignalRService/WebPubSub",
            "apiVersion": "2023-08-01-preview",
            "name": "[parameters('WebPubSub_wsINOWY5Zj_name')]",
            "location": "eastus",
            "sku": {
                "name": "Free_F1",
                "tier": "Free",
                "size": "F1",
                "capacity": 1
            },
            "kind": "WebPubSub",
            "properties": {
                "tls": {
                    "clientCertEnabled": false
                },
                "networkACLs": {
                    "defaultAction": "Deny",
                    "publicNetwork": {
                        "allow": [
                            "ServerConnection",
                            "ClientConnection",
                            "RESTAPI",
                            "Trace"
                        ]
                    },
                    "privateEndpoints": [],
                    "ipRules": [
                        {
                            "value": "0.0.0.0/0",
                            "action": "Allow"
                        },
                        {
                            "value": "::/0",
                            "action": "Allow"
                        }
                    ]
                },
                "publicNetworkAccess": "Enabled",
                "disableLocalAuth": false,
                "disableAadAuth": false,
                "regionEndpointEnabled": "Enabled",
                "resourceStopped": "false"
            }
        },
        {
            "type": "Microsoft.SignalRService/WebPubSub/hubs",
            "apiVersion": "2023-08-01-preview",
            "name": "[concat(parameters('WebPubSub_wsINOWY5Zj_name'), '/ChatApp')]",
            "dependsOn": [
                "[resourceId('Microsoft.SignalRService/WebPubSub', parameters('WebPubSub_wsINOWY5Zj_name'))]"
            ],
            "properties": {
                "eventHandlers": [
                    {
                        "urlTemplate": "tunnel:///eventHandler",
                        "userEventPattern": "*",
                        "systemEvents": [
                            "connected"
                        ]
                    }
                ],
                "anonymousConnectPolicy": "deny"
            }
        }
    ]
}

parameters.json

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentParameters.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "WebPubSub_wsINOWY5Zj_name": {
            "value": null
        }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment