Event Hubs Management API Version Mismatch #3763
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.
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.
The text was updated successfully, but these errors were encountered: