Skip to content

Issue with [API Management/backend] / API Version [2024-05-01] #1219

@domroutley

Description

@domroutley

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Service Used

API Management

API Versions Used

2024-05-01

Description

Creating a backend resource fails when type = Pool. It is currently impossible to create a backend of type Pool using this SDK.

If the url or protocol values are not set then the SDK rejects the request, as both url and protocol are set as required (omitempty is not included in the definition), if they are provided then the API returns a "ValidationError" stating that the url and protocol values must not be set when type is set to Pool.

I believe that this will only require a regeneration of the service files (specifically https://github.com/hashicorp/go-azure-sdk/blob/main/resource-manager/apimanagement/2024-05-01/backend/model_backendcontractproperties.go) if the API Spec itself is "fixed".

Local testing of the SDK proves that the API and SDK function exactly as intended with the simple addition of ,omitempty to both the url and protocol inputs in the BackendContractProperties struct. However as this is an upstream issue I believe that raising a PR to just add those values here would not be ideal, that would put this SDK OOS with the API spec.

There is also the added benefit that fixing the issue in the spec file also means that the azapi provider also gets to benefit from this fix. As that uses the API spec directly (see upstream issue for example), and currently fails with the same issue, but has a workaround (can ignore the API spec for validation).

References

Upstream issue Azure/azure-rest-api-specs#35713
Upstream PR Azure/azure-rest-api-specs#35714
Downstream issue hashicorp/terraform-provider-azurerm#24594
Downstream PR hashicorp/terraform-provider-azurerm#30065

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions