0

I'm aware that it's possible to create an API Management API Policy using terraform by adding the following two resources:API Management API and API Management API Policy. The issue is that I want to add the policy for "All APIs" (seen in image)

enter image description here

and not for a specific route. I do not see a way to do that through Terraform. I am able to do it through Powershell though. So that leaves me with three thoughts:

  1. I should just do it through powershell
  2. I should NOT be using the "All APIs" option in the UI and instead should always explicitly assign the policy to each route. (kind of a pain since connecting Function Apps to APIM is going to auto generate APIs for me)
  3. I'm missing something and this can be done through Terraform.

I'm looking for an answer to point 3, and open to opinions on point 2.

Thanks

Jake Boomgaarden
  • 3,394
  • 1
  • 17
  • 31
  • We didn't manage neither. What we're doing at the moment is doing the "import from az func" process within terraform so we can loop through the APIs and apply the policies over. – Will Dec 22 '22 at 11:11
  • if it's per route, then terraform can handle that. but yeah for the entire API, that's probably the best way for now sadly. If you get it working with azapi though let me know because i think that would be a bit cleaner – Jake Boomgaarden Dec 23 '22 at 09:06

0 Answers0