Skip to content
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

Event Hubs Management API Version Mismatch #3763

Closed
ASchwenkerBM opened this issue Oct 4, 2017 · 2 comments
Closed

Event Hubs Management API Version Mismatch #3763

ASchwenkerBM opened this issue Oct 4, 2017 · 2 comments
Assignees
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Event Hubs Service Attention Workflow: This issue is responsible by Azure service team.

Comments

@ASchwenkerBM
Copy link

The latest version of the Event Hubs Management SDK uses API Version 2017-04-01. The Azure documentation lists version 2015-08-01 as the latest version for all operations on Event Hubs.

There appears to be an issue with the 2017-04-01 API in that the List By Subscription method for Namespaces (and potentially other methods but I have not tested them) return deleted Namespaces.

Below are example requests and responses between the two APIs after I had deleted an Event Hub named aschwenkertestdelete (shortened for brevity and security):

2017-04-01 Request

GET https://management.azure.com/subscriptions/[subscription]/providers/Microsoft.EventHub/namespaces?api-version=2017-04-01 HTTP/1.1 Authorization: Bearer [Token] User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.16299.0 Host: management.azure.com Connection: Keep-Alive

2017-04-01 Response

`HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1902
Content-Type: application/json; charset=utf-8
Expires: -1
x-ms-request-id: 77ce921c-d213-4c0c-8d45-205154d79b92_M0_M0
Server-SB: Service-Bus-Resource-Provider/SN1
Server: Service-Bus-Resource-Provider/SN1
Server: Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-reads: 14991
x-ms-correlation-request-id: 00696c1e-7a73-4d19-8fb8-ad52d050645d
x-ms-routing-request-id: NORTHCENTRALUS:20171004T152222Z:00696c1e-7a73-4d19-8fb8-ad52d050645d
Strict-Transport-Security: max-age=31536000; includeSubDomains
Date: Wed, 04 Oct 2017 15:22:22 GMT

{"value":[{"sku":{"name":"Basic","tier":"Basic","capacity":1},"id":"/subscriptions/[subscription]/resourceGroups/[resource group name]/providers/Microsoft.EventHub/namespaces/eventhubdev","name":"eventhubdev","type":"Microsoft.EventHub/Namespaces","location":"East US","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"provisioningState":"Succeeded","metricId":"[subscription]:eventhubdev","createdAt":"2016-11-16T18:00:37.323Z","updatedAt":"2017-08-25T16:40:54.513Z","serviceBusEndpoint":"https://eventhubdev.servicebus.windows.net:443/"}},{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/[subscription]/resourceGroups/[resource group name]/providers/Microsoft.EventHub/namespaces/aschwenkertest","name":"aschwenkertest","type":"Microsoft.EventHub/Namespaces","location":"West Europe","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"provisioningState":"Succeeded","metricId":"[subscription]:aschwenkertest","createdAt":"2017-09-19T15:53:29.25Z","updatedAt":"2017-09-19T15:53:52.657Z","serviceBusEndpoint":"https://aschwenkertest.servicebus.windows.net:443/"}},{"sku":{"name":"Standard","tier":"Standard","capacity":1},"id":"/subscriptions/[subscription]/resourceGroups/[resource group name]/providers/Microsoft.EventHub/namespaces/aschwenkertestdelete","name":"aschwenkertestdelete","type":"Microsoft.EventHub/Namespaces","location":"West Europe","tags":{},"properties":{"isAutoInflateEnabled":false,"maximumThroughputUnits":0,"provisioningState":"Succeeded","metricId":"[subscription]:aschwenkertestdelete","createdAt":"2017-10-04T14:46:37.027Z","updatedAt":"2017-10-04T14:53:16.887Z","serviceBusEndpoint":"https://aschwenkertestdelete.servicebus.windows.net:443/"}}]}`

2015-08-01 Request

GET https://management.azure.com/subscriptions/[subscription]/providers/Microsoft.EventHub/namespaces?api-version=2015-08-01 HTTP/1.1 Authorization: Bearer [Token] User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.16299.0 Host: management.azure.com

2015-08-01 Response

`HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 1419
Content-Type: application/json; charset=utf-8
Expires: -1
x-ms-request-id: e7f9db4f-b9a1-4fc3-9d7b-e65f6bb8f354_M0_M0
Server-SB: Service-Bus-Resource-Provider/SN1
Server: Service-Bus-Resource-Provider/SN1
Server: Microsoft-HTTPAPI/2.0
x-ms-ratelimit-remaining-subscription-reads: 14990
x-ms-correlation-request-id: 68e7c609-0fe0-4c11-a877-d62546428513
x-ms-routing-request-id: NORTHCENTRALUS:20171004T152244Z:68e7c609-0fe0-4c11-a877-d62546428513
Strict-Transport-Security: max-age=31536000; includeSubDomains
Date: Wed, 04 Oct 2017 15:22:43 GMT

{"value":[{"id":"/subscriptions/[subscription]/resourceGroups/[resource group name]/providers/Microsoft.EventHub/namespaces/eventhubdev","name":"eventhubdev","type":"Microsoft.EventHub/namespaces","location":"East US","kind":"EventHub","sku":{"name":"Basic","tier":"Basic","capacity":1},"tags":{},"properties":{"provisioningState":"Succeeded","metricId":"[subscription]:eventhubdev","status":"Active","createdAt":"2016-11-16T18:00:37.323Z","serviceBusEndpoint":"https://eventhubdev.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2017-08-25T16:40:54.513Z","eventHubEnabled":true,"namespaceType":"EventHub","messagingSku":1}},{"id":"/subscriptions/[subscription]/resourceGroups/[resource group name]/providers/Microsoft.EventHub/namespaces/aschwenkertest","name":"aschwenkertest","type":"Microsoft.EventHub/namespaces","location":"West Europe","kind":"EventHub","sku":{"name":"Standard","tier":"Standard","capacity":1},"tags":{},"properties":{"provisioningState":"Succeeded","metricId":"[subscription]:aschwenkertest","status":"Active","createdAt":"2017-09-19T15:53:29.25Z","serviceBusEndpoint":"https://aschwenkertest.servicebus.windows.net:443/","enabled":true,"critical":false,"updatedAt":"2017-09-19T15:53:52.657Z","eventHubEnabled":true,"namespaceType":"EventHub","messagingSku":2}}],"nextLink":null}`

As is evident, the 2017-04-01 version results in deleted Namespaces being returned. In my code built on the Event Hubs Management SDK, this results in quite a few issues as I have to check each Namespace for it actually existing once I get a list. Ideally this would get fixed in Azure, but for now I would settle for this SDK switching back to the 2015-08-01 API, which, as far as I can tell, is functionally equivalent to the 2017-04-01 API.

@shahabhijeet
Copy link
Member

@arundsouza can you comment on this one, seems there are two issues:

  1. Documentation
  2. seems like a product bug while returning event hub namespace.

@bsiegel bsiegel added the Service Attention Workflow: This issue is responsible by Azure service team. label Sep 26, 2018
@jfggdl jfggdl added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label May 31, 2019
@apraovjr
Copy link

apraovjr commented Jun 20, 2019

@shahabhijeet @ASchwenkerBM I created 4-5 namespaces and deleted it. To verify the namespaces are deleted, API listbysubscription was called. I am not able to repo this issue since the list response did not return the deleted namespace as reported in above call.

Delete Namespace
EventHubManagementClient.Namespaces.Delete(resourceGroup, namespaceName);

List by subscription
var listNamespaces = EventHubManagementClient.Namespaces.List();

Check if exists returned null
var deletedNamespace = listNamespaces.Where(x => x.Name == namespaceName);

Note: All the API version are 2017-04-01

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue requires a change to an existing behavior in the product in order to be resolved. Event Hubs Service Attention Workflow: This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

7 participants