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

EventHubNamespace validation: API docs mismatched with actual API enforcement #1057

Closed
shawnjones253 opened this issue Aug 10, 2021 · 7 comments
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed upstream/open-api

Comments

@shawnjones253
Copy link

I'm trying to enable auto-inflate on a "standard" SKU event hubs namespace. The actual limit on maximum TUs is 40 (and the API / UI will allow you to select up to 40): https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-quotas#basic-vs-standard-vs-premium-vs-dedicated-tiers but the API docs state that the limit is 20 https://github.com/Azure/azure-rest-api-specs/blob/main/specification/eventhub/resource-manager/Microsoft.EventHub/stable/2017-04-01/namespaces.json#L473

Steps to reproduce

var eventHubNamespace = new Namespace(
                "myEventHubNamespace",
                new NamespaceArgs()
                {
                    KafkaEnabled = true,
                    NamespaceName = "myEventHubNamespace",
                    ResourceGroupName = "myResourceGroup",
                    Location = "westus2",
                    IsAutoInflateEnabled = true,
                    MaximumThroughputUnits = 40
                });

Expected: success
Actual:

Diagnostics:
  azure-native:eventhub/v20170401:Namespace (myEventHubNamespace):
    error: azure-native:eventhub/v20170401:Namespace resource 'myEventHubNamespace' has a problem: 'maximumThroughputUnits' is too high (40.000000 > 20.000000)
@shawnjones253 shawnjones253 added the kind/bug Some behavior is incorrect or out of spec label Aug 10, 2021
@mikhailshilkov
Copy link
Member

I opened a PR upstream - let's see if it gets accepted: Azure/azure-rest-api-specs#15619

@mikhailshilkov mikhailshilkov self-assigned this Aug 11, 2021
@shawnjones253
Copy link
Author

If your upstream PR gets accepted, would its just start working with the current version of Azure-Native, or would it require you to release a new version?

@mikhailshilkov
Copy link
Member

It would require a new release. We use those API specs as the source to generate our code and validation, we don't use them at runtime.

@mikhailshilkov
Copy link
Member

By the way, as a crude workaround - I think you could provision a resource with 20, then change it to 40 in the portal, and then add maximumThroughputUnits to IgnoreChanges resource options. I know it sucks but maybe this can get you going.

@shawnjones253
Copy link
Author

@mikhailshilkov -- I tried the IgnoreChanges workaround you suggested above, but then got the following:

error: Code="BadRequest" Message="EventHub capacity out of range for AutoInflate."

@mikhailshilkov
Copy link
Member

Why does it try updating the resource? What is the diff? My hope was you'd avoid any updates to it (that was the goal of IgnoreChanges).

@mikhailshilkov mikhailshilkov added the resolution/fixed This issue was fixed label Sep 20, 2021
@mikhailshilkov
Copy link
Member

mikhailshilkov commented Sep 20, 2021

I think the original problem got fixed upstream in Azure/azure-rest-api-specs#15233. There's no max value set in the spec anymore, so I'll close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed upstream/open-api
Projects
None yet
Development

No branches or pull requests

2 participants