Azure API Management Backend
This page shows how to write Terraform and Azure Resource Manager for API Management Backend and write them securely.
azurerm_api_management_backend (Terraform)
The Backend in API Management can be configured in Terraform with the resource name azurerm_api_management_backend. The following sections describe 9 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_backend" "backend1" {
name = "backend2"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim.name
protocol = "http"
url = "https://backend1"
resource "azurerm_api_management_backend" "dadjoke" {
name = "ICanHazDadJoke"
resource_group_name = local.resource_group_name
api_management_name = data.azurerm_api_management.apim.name
protocol = "http"
url = "https://icanhazdadjoke.com/"
resource "azurerm_api_management_backend" "example_backend" {
name = var.res_api_backend_name
resource_group_name = var.res_rg_name
api_management_name = var.res_api_name
protocol = var.res_protocol
url = var.res_url
resource "azurerm_api_management_backend" "backend" {
for_each = var.api_backends
name = each.value.name
url = each.value.url
resource_group_name = var.resource_group_name
api_management_name = azurerm_api_management.api.name
resource "azurerm_api_management_backend" "apim_demo_backend_publish" {
name = "publish-api"
resource_group_name = azurerm_resource_group.apim_demo_rg.name
api_management_name = azurerm_api_management.apim_demo_r.name
protocol = "http"
url = "https://tm7do0vu9j.execute-api.eu-west-1.amazonaws.com"
resource "azurerm_api_management_backend" "prod-ferm-vm-00" {
name = "prod-ferm-vm-00"
resource_group_name = azurerm_resource_group.rg.name
api_management_name = azurerm_api_management.apim.name
protocol = "http"
url = "http://prod-ferm-vm-00.noclab.com.au:80/"
resource "azurerm_api_management_backend" "backend" {
count = length(var.backend)
api_management_name = element(var.api_management_name, lookup(var.backend[count.index], "api_management_id"))
name = lookup(var.backend[count.index], "name")
protocol = lookup(var.backend[count.index], "protocol")
resource_group_name = var.resource_group_name
resource "azurerm_api_management_backend" "this" {
api_management_name = var.api_management_name
description = var.description
name = var.name
protocol = var.protocol
resource_group_name = var.resource_group_name
resource "azurerm_api_management_backend" "this" {
api_management_name = var.api_management_name
description = var.description
name = var.name
protocol = var.protocol
resource_group_name = var.resource_group_name
Parameters
-
api_management_namerequired - string -
descriptionoptional - string -
idoptional computed - string -
namerequired - string -
protocolrequired - string -
resource_group_namerequired - string -
resource_idoptional - string -
titleoptional - string -
urlrequired - string -
credentialslist block-
certificateoptional - list of string -
headeroptional - map from string to string -
queryoptional - map from string to string -
authorizationlist block
-
-
proxylist block -
service_fabric_clusterlist block-
client_certificate_thumbprintrequired - string -
management_endpointsrequired - set of string -
max_partition_resolution_retriesrequired - number -
server_certificate_thumbprintsoptional - set of string -
server_x509_nameset block-
issuer_certificate_thumbprintrequired - string -
namerequired - string
-
-
-
timeoutssingle block -
tlslist block-
validate_certificate_chainoptional - bool -
validate_certificate_nameoptional - bool
-
Explanation in Terraform Registry
Manages a backend within an API Management Service.
Microsoft.ApiManagement/service/backends (Azure Resource Manager)
The service/backends in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/backends. The following sections describe how to use the resource and its parameters.
Example Usage from GitHub
An example could not be found in GitHub.
Parameters
apiVersionrequired - stringnamerequired - stringIdentifier of the Backend entity. Must be unique in the current API Management service instance.
propertiesrequiredcredentialsoptionalauthorizationoptionalparameterrequired - stringAuthentication Parameter value.
schemerequired - stringAuthentication Scheme name.
certificateoptional - arrayList of Client Certificate Thumbprints. Will be ignored if certificatesIds are provided.
certificateIdsoptional - arrayList of Client Certificate Ids.
headeroptional - arrayHeader Parameter description.
queryoptional - arrayQuery Parameter description.
descriptionoptional - stringBackend Description.
propertiesoptionalserviceFabricClusteroptionalclientCertificateIdoptional - stringThe client certificate id for the management endpoint.
clientCertificatethumbprintoptional - stringThe client certificate thumbprint for the management endpoint. Will be ignored if certificatesIds are provided
managementEndpointsrequired - arrayThe cluster management endpoint.
maxPartitionResolutionRetriesoptional - integerMaximum number of retries while attempting resolve the partition.
serverCertificateThumbprintsoptional - arrayThumbprints of certificates cluster management service uses for tls communication
serverX509Namesoptional arrayissuerCertificateThumbprintoptional - stringThumbprint for the Issuer of the Certificate.
nameoptional - stringCommon Name of the Certificate.
protocolrequired - stringBackend communication protocol.
proxyoptionalpasswordoptional - stringPassword to connect to the WebProxy Server
urlrequired - stringWebProxy Server AbsoluteUri property which includes the entire URI stored in the Uri instance, including all fragments and query strings.
usernameoptional - stringUsername to connect to the WebProxy server
resourceIdoptional - stringManagement Uri of the Resource in External System. This url can be the Arm Resource Id of Logic Apps, Function Apps or API Apps.
titleoptional - stringBackend Title.
tlsoptionalvalidateCertificateChainoptional - booleanFlag indicating whether SSL certificate chain validation should be done when using self-signed certificates for this backend host.
validateCertificateNameoptional - booleanFlag indicating whether SSL certificate name validation should be done when using self-signed certificates for this backend host.
urlrequired - stringRuntime Url of the Backend.
typerequired - string
Frequently asked questions
What is Azure API Management Backend?
Azure API Management Backend is a resource for API Management of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure API Management Backend?
For Terraform, the feranto/terraform-samples, fortunkam/apim-devops-demos and avishekansible/AzureLandingZone source code examples are useful. See the Terraform Example section for further details.