Terraform-provider-azurerm: API Management Consumption Tier

Created on 7 Jan 2019  ยท  24Comments  ยท  Source: terraform-providers/terraform-provider-azurerm

Hey all,

API Management has a consumption tier which is currently in preview. It would be great to see the azurerm_api_management resource updated to support the additional tier.

I've had a quick look and the property does exist in the Azure sdk https://github.com/Azure/azure-sdk-for-go/blob/master/services/preview/apimanagement/mgmt/2018-06-01-preview/apimanagement/models.go#L510 so it appears this should just be a case of updating the vendored package, updating the schema to include the additional tier and then testing it.

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

Description

New or Affected Resource(s)

  • azurerm_api_management
preview servicapi-management

Most helpful comment

so api version 2019-12-01 is release 3 days ago, can we go ahead and use it to fix this issue ?

https://github.com/Azure/azure-sdk-for-go/tree/master/services/apimanagement/mgmt/2019-12-01/apimanagement

https://github.com/Azure/azure-sdk-for-go/releases/tag/v40.6.0

If there anything that I can do to help I will be more than happy :)

All 24 comments

Dependent on https://github.com/Azure/azure-rest-api-specs/issues/4409 (since this exposes the new API/SDK version required)

๐Ÿ‘‹

The upstream issue's been fixed: https://github.com/Azure/azure-rest-api-specs/issues/4409 - once the SDK's been updated #3335 we should be able to go to the new version of the API Management API - at which point it should be possible to add support for this

Thanks!

Is Terraform stopped supporting Azure. a lot of new features aren't available in terraform. I.E:

  1. Consumption Tier in Azure apim
  2. throughput option in cosmos db database layer.

Those are already reported in Github months and months ago.

@tminhein this functionality requires upgrading to the new version of the API Management API (2019-01-01) - which unfortunately doesn't match the API response - as such we're unable to add support for this until the API/SDK is fixed.

@tminhein this functionality requires upgrading to the new version of the API Management API (2019-01-01) - which unfortunately doesn't match the API response - as such we're unable to add support for this until the API/SDK is fixed.

@tombuildsstuff i can see that the api response bug has been closed. I wonder that the consumption has available in the terraform ?

@stena-dev unfortunately the API's still broken, which is now being tracked in https://github.com/Azure/azure-rest-api-specs/pull/6065

@tombuildsstuff

Sorry to poke you, but do you have an update on this? I am wondering as the pull request has been closed.

Edit: I just read through all of the comments on that PR. Looks like there is some work to be done still

@arifsundrani we're still waiting on Microsoft to fix the API: https://github.com/Azure/azure-rest-api-specs/issues/6372

@tminhein this functionality requires upgrading to the new version of the API Management API (2019-01-01) - which unfortunately doesn't match the API response - as such we're unable to add support for this until the API/SDK is fixed

@tombuildsstuff , is there any chance that we could migrate from the _2018-01-01_ API spec to the _2018-06-01-preview_ API spec? This has the consumption tier in the Go SDK, link

@brunhil it's technically possible since the preview api has the field with the correct type - however older preview versions can be pulled at any time - as such we tend to avoid them where a stable API is available instead (such as in this case, where the API is available but the Swagger doesn't match the API definition).

It seems that the consumption tier is now available in most regions:
https://azure.microsoft.com/en-us/updates/api-management-consumption-tier-in-19-regions/

It seems the issue with the API is still not resolved:
https://github.com/Azure/azure-rest-api-specs/issues/6372

Any updates / timelines on this as our project would like to make use of the Consumption tier of APIM?

We're interested in this as well. Any update on this?

so api version 2019-12-01 is release 3 days ago, can we go ahead and use it to fix this issue ?

https://github.com/Azure/azure-sdk-for-go/tree/master/services/apimanagement/mgmt/2019-12-01/apimanagement

https://github.com/Azure/azure-sdk-for-go/releases/tag/v40.6.0

If there anything that I can do to help I will be more than happy :)

Hi @tombuildsstuff any chance this could be included the next release?

hey @tombuildsstuff I was working on a patch to bump the api version to either 2019-01-01 or 2019-12-01 but looks like there are lots of changes in the new APIs. Is there a way you guys are following to judge what fields to add and what to ignore ?

so @tombuildsstuff since we have the documentation generally available here, I can help a bit on this with some guidance

The fix is available at following locations
REST API doc; https://docs.microsoft.com/en-us/rest/api/apimanagement/2019-12-01/apischema/createorupdate

Go SDK
https://pkg.go.dev/github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2019-12-01/apimanagement?tab=doc

_Originally posted by @solankisamir in https://github.com/Azure/azure-rest-api-specs/issues/6372#issuecomment-606975500_

any updates to get this included? I have a client wanting to use it.

There's a two part change that needs to happen for this to be completed.

  1. Upgrade the API Management SDK from the current version, 2018-01-01, to the new version, 2019-02-01
  2. Upgrade the azurerm_api_management resource to be able to use the new SKUs

It looks like @katbyte is working on #1 currently in the following PR: [WIP] provider: upgrade API Management to 2019-12-01.

You can follow along that PR to see the changes. Once those are completed you should be able to tackle this issue!

Well, I was working on a patch locally but as I never got answer from @tombuildsstuff so I wasn't If I can submit it or not, I was looking for an answer regarding SchemaDocumentProperties as it has changed from 2018-01-01 to 2019-12-01 ...
Any way will be waiting for @katbyte patch to land and will be more than happy to help.

@brunhil It can be in the same patch no need for another patch for the SKU I think, it could happen as part of the SDK upgrade as it's not straight forward

@scottrangerio & @szaher #6479 has been merged so master is on the latest version of the API ๐Ÿ™‚๐Ÿš€

@katbyte Thanks very much for the patch.
Can we get this one merged as well https://github.com/terraform-providers/terraform-provider-azurerm/pull/6602 ?

I think you forgot the consumption tier for apim

This has been released in version 2.8.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example:

provider "azurerm" {
    version = "~> 2.8.0"
}
# ... other configuration ...

I'm going to lock this issue because it has been closed for _30 days_ โณ. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐Ÿค– ๐Ÿ™‰ , please reach out to my human friends ๐Ÿ‘‰ [email protected]. Thanks!

Was this page helpful?
0 / 5 - 0 ratings