djflocko
djflocko

Reputation: 89

Terraform AzureRM Azure API Managment creates stv1 instead stv2

I've created Azure API Managment with terraform. Now I read that Microsoft is retiring stv1 in 2024. I'm wondering why my API Management instances that were created mid 2022 do not have stv2 as default?

Is there a way to tell AzureRM Provider which Azure Rest API it should use ?

https://learn.microsoft.com/en-us/azure/api-management/compute-infrastructure#how-do-i-migrate-to-the-stv2-platform

Upvotes: 3

Views: 3511

Answers (3)

Dustin
Dustin

Reputation: 129

As stated by @djflocko, if you deploy with a PIP for APIM, it will not use stv1. Without the PIP, it will use stv1. A bit problematic because reason leads you to not using a PIP... since you're doing an "Internal" deployment.

EDIT: The architecture of APIM is that it basically has a publicly facing API for the management of the APIM gateways. This always needs a public IP address and is never deployed inside of your VNET, regardless of a normal deployment or VNET External/Internal deployments. This does create some odd challenges. The other part of APIM is a VM Scale Set (unless doinng self-managed gateways); so a load balancer and then a set of VMs behind that vIP. The VM Scale Set is deployed on the VNET when doing a VNET deployment.

In my view the solution has some deficiencies that aren't well documentented. One thing that is documented is that a VNET Internal deployment "breaks" the "Testing" tab within an API, because that management service isn't inside your network and cannot talk to the gateways (the gateways, which are the VM Scale Set, pull their configuration information) directly, for many aspects other than triggering updates. Also, the import of a schema via URL cannot work with a VNET Internal deployment for the same reason (and there is zero documentation on that). This could be fixed by leveraging a Service Bus for the management API to dump requests and the gateways can read the bus for operations to perform, like asking the gateways to perform a test or import a schema via URL, and then returning the response to the management API via the bus.

Upvotes: 2

djflocko
djflocko

Reputation: 89

The following image explains what is implemented on the Rest API page. In my case, I did not specify a public_ip_address_id or zones in terraform. Unfortunately the provider didn't indicate this somehow and the parameter is also optional. https://techcommunity.microsoft.com/t5/azure-paas-blog/compute-platform-versions-for-azure-api-management-service/ba-p/2836971 techcommunity.microsoft.com/t5/azure-paas-blog/…

Upvotes: 0

VenkateshDodda
VenkateshDodda

Reputation: 5506

As mentioned in this terraform documentation, using the same sample and provider the azurerm provider version 3.0.0. We have created an APIM instance(of developer sku). Post the creation we are able to see the platform version value as stv2 as shown in the below image here.

enter image description here

If you are using the azurerm provider version 3.0.0 also if you are facing the issue I would suggest you create the API management instance using azapi provider.

Refer to this documentation for more information on how to create APIM instance using azapi provider and also you can specify the specific resource provider api version in azapi provider.

Upvotes: 0

Related Questions