Feature/service bus namespace create if not exists#95
Feature/service bus namespace create if not exists#95HenrikSommer wants to merge 8 commits intoSwissLife-OSS:masterfrom Energinet-DataHub:feature/service-bus-namespace-createorupdate
Conversation
Use ServiceBusProvisioningMode CreateIfNotExists for automatic Service Bus Namespace creation. Service Bus Namespace creation is a slow process, thus reuse existing Namespace will highly speed up the creation process.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Kudos, SonarCloud Quality Gate passed!
|
glucaci
left a comment
There was a problem hiding this comment.
Thanks, looks good, only one thing I would change (see comment).
|
|
||
| private async Task<bool> CheckServiceBusNamespaceExists(string serviceBusNamespace) | ||
| { | ||
| var serviceBusNamespaces = new List<SBNamespace>(); |
There was a problem hiding this comment.
Insead of listing all the service bus namespaces I would use _client.Namespaces.CheckNameAvailabilityMethodAsync
There was a problem hiding this comment.
Good point, and we have been there as well. The reason why we didn't go with _client.Namespaces.CheckNameAvailabilityMethodAsync is that it will return the global availability of a name. In this context, we need to know the availability of a name given a resource group.
There was a problem hiding this comment.
ServiceBus namespace name must be global available because has a public endpoint.
https://docs.microsoft.com/en-us/rest/api/servicebus/create-namespace ...the name must be unique across Azure to be successfully created
Namespace-method with one parameter is reintroduced to preserve backward compatibility.
|
|
||
| private async Task<bool> CheckServiceBusNamespaceExists(string serviceBusNamespace) | ||
| { | ||
| var serviceBusNamespaces = new List<SBNamespace>(); |
There was a problem hiding this comment.
ServiceBus namespace name must be global available because has a public endpoint.
https://docs.microsoft.com/en-us/rest/api/servicebus/create-namespace ...the name must be unique across Azure to be successfully created
|
I will change the namespace checking to |
|
@HenrikSommer @Sondergaard do you need any support to finish this one? |
@glucaci Let me give you an example from my own use of the Azure ServiceBus cloud provider. Creating the ServiceBus Namespace is a slow process, whereas topic and subscription are much faster. To speed up our test run we would like to use a named ServiceBus Namespace. I addition we would like to run our integration tests in a pull request gate, in which we cannot assume that the Service Bus Namespace is created. This is the essence of this pull request. In order to do this, we need to know that the ServiceBus Namespace is present within our own resource group. In this case, it is actually of minor importance to check that the ServiceBus Namespace is available globally because:
If you still think we need to check for global availability, then I suggest a hybrid solution with both global and in resource group check. |
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Kudos, SonarCloud Quality Gate passed!
|








Added support for usage of existing Service Bus Namespaces
Creation of Service Bus Namespace is a timeconsuming task in Azure. This pull request addresses this issue with support for usage of existing Service Bus Namespace
Addresses #94