Azure Chaos Studio supports new fault for Azure Event Hub
Azure Chaos Studio supports new fault for Azure Event Hubs.
Azure Chaos Studio is a managed service that uses chaos engineering to help you measure, understand, and improve your cloud application and service resilience. Chaos engineering is a methodology by which you inject real-world faults into your application to run controlled fault injection experiments.
Azure Chaos Studio has added a new fault action for Azure Event Hubs called Change Event Hub State.
This fault action lets users disable entities within a targeted Azure Event Hubs namespace either partially or fully to test messaging infrastructure for maintenance or failure scenarios for an application dependent on an Event Hub.
The fault can be used in the Azure portal by designing experiments, deploying templates, or using the REST API. The fault library contains more information and examples.
This article will cover the how-to setup the fault action in Azure Chaos Studio for Azure Event Hub called Change Event Hub State.
Create Event Hubs namespace
Step 1: Go to Azure Portal – https://portal.azure.com/ ; Login with your userId and password.
Step 2: Click on Create a resource and then select Event Hubs.
Step 3: Click on Create event hubs namespace.
Step 4: Click on Review + Create.
Step 5: Click on Create.
Step 6: Click on Go to resource.
Create Event Hub
Step 1: Now create the Event Hub.
Step 2: Click on Event Hub
Step 3: Provide a suitable name to the event Hub. Then Click on review & Create.
Step 4: Click on Create.
The Event Hub is created.
Chaos Studio
Step 1: Now Create Chaos Studio
Step 2: Click on Target
Step 3: You will be able to view the Event Hub namespace created by earlier.
Step 4: Select on Eventhubnamespace Created and click on “Enable targets”.
Step 5: Click on Review+ Enable
Step 6: Click on Enable
Step 7: Click on Go to Resource
Step 7: Go to Chaos Studio, by searching Chaos Studio in the Search bar.
Step 8: Click on Create.
Step 9: Provide a suitable name to the experiment. Click on Experiment Designer.
Step 10: Add the Action.
Step 11: Firstly, add the fault to disable the Azure Event Hub.
Step 12: In Faults dropdown select the Change Event Hub State.
Chage the event hub state to “Disable”.
Step 13: Click on Target Resources.
Step 14: On Target Resources Select the radio button “Manually select from a list”. Select your Event hub namespace. And Click on Add.
Step 15: Click on Add Delay.
Then change the Duration to the desired delay. In this case, I have added a 1-minute delay. Click on Add.
This means that when this experiment runs, it will first disable the Event Hub for the duration of 1 minute.
In the next step, we will change the Event Hub State back to Active.
Step 16: Now again add the fault and select the Change Event Hub state, like you did in Step 11.
Step 17: Now set the desiredState as Active.
Step 18: Click on Target Resources and select the Event Hub namespace like you did in previous step and click on Add.
Step 19: Click on Review and Create.
Step 20: Click on Create.
Step 21: Click on Go to resource.
Step 22: Now click on Identity.
Step 23: Click on Azure Add role assignments. Change the role to Azure Event Hub Data Owner and Save it.
Step 24: Click on Overview. The status will change to Running after approximately a min.
Step 25: Once the state is running. Go to your Event Hub. You will notice that state is disabled.
Step 26: As we have added the delay of 1 min in our experiment setup earlier, the event hub state change to Active after a minute.
Microsoft Tech Community – Latest Blogs –Read More