1

I have an Event Grid System Topic that sends blob created events to a Service Bus Topic. The messages are processed by a dotnet application sitting in AKS. Now the requirement came for high availability so we decided to turn on Service Bus Geo-disaster recovery. We set the Primary and Secondary namespaces and want to use the Service Bus through the Geo-DR Alias.

Unfortunately I cannot find a way to connect the Event Grid Topic to this Service Bus Geo-DR Alias, it only allows me to select a single service bus namespace.

We are using ARM templates, and I tried different ways, but it is not allowing me to target the alias as a destination resource.

"resources": [{
    "type": "Microsoft.EventGrid/systemTopics/eventSubscriptions",
    "apiVersion": "2020-10-15-preview",
    "name": "[concat(parameters('systemTopicName'), '/', parameters('eventSubscriptionName'))]",
    "properties": {
        "deliveryWithResourceIdentity": {
            "identity": {
                "type": "SystemAssigned"
            },
            "destination": {
                "properties": {
                    "resourceId": "[concat(resourceId(resourceGroup().name, 'Microsoft.ServiceBus/namespaces', parameters('serviceBusNameSpace')),  '/topics/blobcreated-event')]"
                },
                "endpointType": "ServiceBusTopic"
            }
        },
        "filter": {
                "subjectBeginsWith": "/blobServices/default/containers/stage",
                "includedEventTypes": [
                    "Microsoft.Storage.BlobCreated"
                ],
                "enableAdvancedFilteringOnArrays": true,
                "advancedFilters": [{
                    "operatorType": "StringIn",
                    "key": "data.api",
                    "values": [
                        "PutBlob",
                        "PutBlockList",
                        "FlushWithClose"
                    ]
                }]
            },
            "labels": [],
            "eventDeliverySchema": "EventGridSchema",
            "retryPolicy": {
                "maxDeliveryAttempts": 30,
                "eventTimeToLiveInMinutes": 1440
            }
    }
}]

I have tried to add the alias to the path:

"resourceId": "[concat(resourceId(resourceGroup().name, 'Microsoft.ServiceBus/namespaces', parameters('serviceBusNameSpace')),  '/disasterRecoveryConfigs/{aliassname}/topics/blobcreated-event')]"

But that gives me 'Invalid ARM Id.' error.

Other idea was to use Webhook, but EventGrid requires handshake to prove ownership to the Webhook endpoint which I am not sure if Service Bus is capable of.
https://learn.microsoft.com/en-us/azure/event-grid/webhook-event-delivery

Has anybody got this working or found a workaround?

Lacc
  • 11
  • 3
  • You can refer to [Create system topics in Azure Event Grid using Resource Manager templates](https://learn.microsoft.com/en-us/azure/event-grid/create-view-manage-system-topics-arm) and [Build your own disaster recovery for custom topics in Event Grid](https://learn.microsoft.com/en-us/azure/event-grid/custom-disaster-recovery) – Ecstasy Nov 19 '21 at 06:55

1 Answers1

0

We had a discussion with Microsoft and got confirmation that SB Aliases are not supported with Event Grid (they are looking into options to enable this).

The options therefore would be either in a DR scenario changing the subscription or having multiple subscribers in different regions.

I am planning to write a script which switches the subscription and executing the failover after.

Lacc
  • 11
  • 3