-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/service bus namespace create if not exists #95
base: master
Are you sure you want to change the base?
Feature/service bus namespace create if not exists #95
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! 0 Bugs No Coverage information |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Insead of listing all the service bus namespaces I would use _client.Namespaces.CheckNameAvailabilityMethodAsync
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! 0 Bugs No Coverage information |
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