Context: While manually deploying a backend service in AZURE, I am prompted to select the type: custom, azure or service fabric.
How can I declare via terraform the type (I would like to select Azure resource) and say which app I want to use? As per documentation it says to use a resource id of the app (that i generate at the start of the deployment) and I tried this:
resource "azurerm_api_management_backend" "polo-backend" {
name = "polo-backend"
resource_group_name = azurerm_resource_group.polo-rg.name
api_management_name = azurerm_api_management.polo-api-mgmt.name
protocol = "http"
url = "https://myurl"
resource_id = azurerm_windows_web_app.app-service.id
}
But it gives me this error:
Error: creating/updating Backend: (Name "polo-backend" / Service Name "polo-api-mgmt" / Resource Group "polo1-default-rg"): apimanagement.BackendClient#CreateOrUpdate: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="ValidationError" Message="One or more fields contain incorrect values:" Details=[{"code":"ValidationError","message":"Value should represent absolute http URL","target":"resourceId"}]
Furthermore.. if the app is generated with terraform how can I assign the URL dynamically in the URL section?