azureterraformterraform-provider-azureazure-api-apps

how to create API App in Azure using Terraform?


I am trying to create an API App in Azure App Service using Terraform but could not get anything to do so. Even I could not find anything in AZ CLI to create an API app.

Is there any work-around to do the same using terraform?


Solution

  • Unfortunately it is not possible to create Azure API App from Terraform at the moment.

    https://github.com/terraform-providers/terraform-provider-azurerm/issues/443

    There is workaround how to create Azure API App with AZ CLI

    az resource create -g yugangw2 -n yugangw2-api12 --resource-type Microsoft.web/sites  --is-full-object -p "{\"kind\":\"api\", \"location\":\"West US\", \"properties\":{  \"serverFarmId\":\"/subscriptions/0b1f6471-1bf0-4dda-aec3-cb9272xxxxxx/resourcegroups/yugangw2/providers/Microsoft.Web/serverfarms/yugangw2-plan\"}}"
    

    https://github.com/Azure/azure-cli/issues/2866#issuecomment-317544291