Azure API Management Diagnostic
This page shows how to write Terraform and Azure Resource Manager for API Management Diagnostic and write them securely.
azurerm_api_management_diagnostic (Terraform)
The Diagnostic in API Management can be configured in Terraform with the resource name azurerm_api_management_diagnostic. The following sections describe 3 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_diagnostic" "this" {
api_management_name = var.api_management_name
enabled = var.enabled
identifier = var.identifier
resource_group_name = var.resource_group_name
resource "azurerm_api_management_diagnostic" "this" {
api_management_name = var.api_management_name
enabled = var.enabled
identifier = var.identifier
resource_group_name = var.resource_group_name
resource "azurerm_api_management_diagnostic" "this" {
count = var.application_insights_instrumentation_key != null ? 1 : 0
identifier = "applicationinsights"
resource_group_name = var.resource_group_name
api_management_name = azurerm_api_management.this.name
Parameters
-
always_log_errorsoptional computed - bool -
api_management_logger_idrequired - string -
api_management_namerequired - string -
enabledoptional - bool -
http_correlation_protocoloptional computed - string -
idoptional computed - string -
identifierrequired - string -
log_client_ipoptional computed - bool -
resource_group_namerequired - string -
sampling_percentageoptional computed - number -
verbosityoptional computed - string -
backend_requestlist block-
body_bytesoptional - number -
headers_to_logoptional - set of string
-
-
backend_responselist block-
body_bytesoptional - number -
headers_to_logoptional - set of string
-
-
frontend_requestlist block-
body_bytesoptional - number -
headers_to_logoptional - set of string
-
-
frontend_responselist block-
body_bytesoptional - number -
headers_to_logoptional - set of string
-
-
timeoutssingle block
Explanation in Terraform Registry
Manages an API Management Service Diagnostic.
Microsoft.ApiManagement/service/diagnostics (Azure Resource Manager)
The service/diagnostics in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/diagnostics. 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 - stringDiagnostic identifier. Must be unique in the current API Management service instance.
propertiesrequiredalwaysLogoptional - stringSpecifies for what type of messages sampling settings should not apply.
backendoptionalrequestoptionalbodyoptionalbytesoptional - integerNumber of request body bytes to log.
dataMaskingoptionalheadersoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
queryParamsoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
headersoptional - arrayArray of HTTP Headers to log.
responseoptionalbodyoptionalbytesoptional - integerNumber of request body bytes to log.
dataMaskingoptionalheadersoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
queryParamsoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
headersoptional - arrayArray of HTTP Headers to log.
frontendoptionalrequestoptionalbodyoptionalbytesoptional - integerNumber of request body bytes to log.
dataMaskingoptionalheadersoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
queryParamsoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
headersoptional - arrayArray of HTTP Headers to log.
responseoptionalbodyoptionalbytesoptional - integerNumber of request body bytes to log.
dataMaskingoptionalheadersoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
queryParamsoptional arraymodeoptional - stringData masking mode.
valueoptional - stringThe name of an entity to mask (e.g. a name of a header or a query parameter).
headersoptional - arrayArray of HTTP Headers to log.
httpCorrelationProtocoloptional - stringSets correlation protocol to use for Application Insights diagnostics.
logClientIpoptional - booleanLog the ClientIP. Default is false.
loggerIdrequired - stringResource Id of a target logger.
operationNameFormatoptional - stringThe format of the Operation Name for Application Insights telemetries. Default is Name.
samplingoptionalpercentageoptional - numberRate of sampling for fixed-rate sampling.
samplingTypeoptional - stringSampling type.
verbosityoptional - stringThe verbosity level applied to traces emitted by trace policies.
typerequired - string
Frequently asked questions
What is Azure API Management Diagnostic?
Azure API Management Diagnostic 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 Diagnostic?
For Terraform, the kevinhead/azurerm, niveklabs/azurerm and pagopa/azurerm source code examples are useful. See the Terraform Example section for further details.