Search in sources :

Example 1 with EventHubNamespaceAuthorizationRule

use of com.microsoft.azure.management.eventhub.EventHubNamespaceAuthorizationRule in project azure-tools-for-java by Microsoft.

the class CreateFunctionAction method getEventHubNamespaceConnectionString.

private String getEventHubNamespaceConnectionString(EventHubNamespace eventHubNamespace) {
    Azure azure = AuthMethodManager.getInstance().getAzureClient(eventHubNamespace.id().split("/")[2]);
    EventHubNamespaceAuthorizationRule eventHubNamespaceAuthorizationRule = azure.eventHubNamespaces().authorizationRules().getByName(eventHubNamespace.resourceGroupName(), eventHubNamespace.name(), "RootManageSharedAccessKey");
    return eventHubNamespaceAuthorizationRule.getKeys().primaryConnectionString();
}
Also used : Azure(com.microsoft.azure.management.Azure) EventHubNamespaceAuthorizationRule(com.microsoft.azure.management.eventhub.EventHubNamespaceAuthorizationRule)

Aggregations

Azure (com.microsoft.azure.management.Azure)1 EventHubNamespaceAuthorizationRule (com.microsoft.azure.management.eventhub.EventHubNamespaceAuthorizationRule)1