Is it possible to create a new event hub in an event hub namespace programatically? The EventHubsNamespaceResource Class from the Azure.ResourceManager.EventHubs library does not seem to support this. Is there some other way?
ResourceGroupResource _resourceGroup;
public EventHubResource GetOrCreateEventHub(string eventHubNamespaceName, string eventHubName)
{
var eventHubNamespace = _resourceGroup.GetEventHubsNamespace(eventHubNamespaceName).Value;
try
{
return eventHubNamespace.GetEventHub(eventHubName).Value;
}
catch (Exception ex)
{
// TODO: create a new event hub
}
}