Search code examples
pythonazureazure-iot-hubazure-eventgrid

Unable to delete, crate or modify Event Subscription in Azure IoT Hub


I tried to create an event subscription for Azure Event Grid Namespace. I am a bit new to Azure so I messed up and chose a storage queue as an endpoint as at that time I did not know how to create an event gris system topic and namespace.

Then I deleted that queue without removing the event subscription in IoT Hub. Now after doing some research, I got to know how to create a namespace and system topic and link it with IoT Hub. But maybe due to the above mess-up, I am unable to do any operation on Event Subscription. It's through errors such as below when deleting.

Deletion Error Image:

enter image description here

If I try to change the below message is pops up.

Creation Error Image:

enter image description here

Another one I tried is creating a new event grid namespace and switching the event subscription endpoint from storage queue to Azure Event grid namespace endpoint system topic but during creation time I created Azure Event Subscription with Event Grid Schema now I am unable to change it.

How to solve this issue please enlighten me and really sorry if I was unable to explain properly. Any information I can provide no issues.


Solution

  • Refer to this link about Error generated with code: 500 and message: Failed to disable publisher notifications.

    Below are the steps to route events from Azure IoT Hub to an Azure Storage Queue using Event Subscription:

    • Create an Azure Storage Account and a queue.

    • Navigate to your Azure IoT Hub instance and select "Event Subscription" to create a new subscription by giving a unique name for the subscription.

    • Select the types of events you want to route and choose "Storage Queue" as the endpoint type.

    • Provide details about the Azure Storage Account and Queue that you created earlier.

    • Choose whether to use a managed identity or not. If you select "None," it means you'll need to manage access to the storage account manually and save it.

    enter image description here

    Below are the steps to route events from Azure IoT Hub to an Event Grid Namespace Topic using Event Subscription:

    • Create an Event Grid Namespace and Topic.

    • Navigate to Identity in the Event Grid Namespace and enable System assigned.

    • Navigate to Access control and click on Add role assignment.

    • Add EventGrid Data Sender to the Topic/Event Grid Namespace Topic with (principal) ID.

    enter image description here

    • Navigate to the Event Subscription of Azure IoT and create an Event Subscription with Event Grid Namespace Topic as Endpoint by selecting the above event grid that was created.

    • Managed identity type can be system-assigned/User-assigned. I used the system assigned.

    enter image description here

    enter image description here