Reputation: 63
Hi I have searched through docs on and can't quite find how to publish the developer portal through terraform. My terraform does spool a resource group with an API Management service resource but I want it to also publish the developer portal and enable CORS. Is this possible through terraform or has to be done manually after I have the rg spooled?
Updated terraform looking at the documentation here: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/api_management#host_name
There is a block for developer portal but I am not sure if this actually publishes it and also not sure what to put in the host_name. Please assist.
Upvotes: 5
Views: 2373
Reputation: 13673
You can completely configure the APIM and its portal from an ARM template but you can't publish the content. There are scripts in the Github repo to do this using the rest API.
Publishing content using those scripts will work for the managed portal. If you're hosting your own version of the portal you'll have to take some additional steps, according to the migration script.
If you can get Terraform to execute NodeJs scripts, you should be able to use these to push content to the portal and publish it.
Please also check the docs that were recently added about the migration script.
Upvotes: 4
Reputation:
Try creating an APIM manually and see what settings is it using for the developer portal in Azure Resource Explorer. Try to replicate those settings in your code.
Upvotes: 0
Reputation: 170
I have never used terraform but I believe what you highlighted would only create a custom domain for your developer portal.
Hostname would be a custom domain, or you can use the default {apimname}.developer.azure-api.net. If you provide a custom domain for your developer portal you would have to provide a SSL certificate and also you have to have a CName for this custom domain.
I do no think the developer portal would be published Can I deploy everything through ARM templates now? The only thing that's not available is developer portal content. Everything else is available through ARM.
link
Upvotes: 1