Azure API Management Logger
This page shows how to write Terraform and Azure Resource Manager for API Management Logger and write them securely.
azurerm_api_management_logger (Terraform)
The Logger in API Management can be configured in Terraform with the resource name azurerm_api_management_logger
. The following sections describe 8 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_api_management_logger" "apim-logger" {
name = var.res_name
api_management_name = var.res_api_management_name
resource_group_name = var.res_rg_name
resource_id = var.res_resource_id
resource "azurerm_api_management_logger" "module" {
name = var.apimlog_name
resource_group_name = var.rg_name
api_management_name = var.apimlog_apim_name
resource "azurerm_api_management_logger" "this" {
api_management_name = var.api_management_name
buffered = var.buffered
description = var.description
name = var.name
resource_group_name = var.resource_group_name
resource "azurerm_api_management_logger" "logger" {
name = var.api_management_logger_name
api_management_name = var.api_management_name
resource_group_name = var.resource_group_name
resource_id = var.application_insights_id
resource "azurerm_api_management_logger" "this" {
api_management_name = var.api_management_name
buffered = var.buffered
description = var.description
name = var.name
resource_group_name = var.resource_group_name
resource "azurerm_api_management_logger" "apim_logger" {
name = var.api_management_logger_name
api_management_name = var.api_management_name
resource_group_name = var.resource_group_name
resource_id = var.app_insights_id
resource "azurerm_api_management_logger" "example" {
name = "example-apimlogger"
resource_group_name = var.resource_group_name
api_management_name = azurerm_api_management.example.name
application_insights {
resource "azurerm_api_management_logger" "this" {
count = var.application_insights_instrumentation_key != null ? 1 : 0
name = format("%s-logger", var.name)
api_management_name = azurerm_api_management.this.name
resource_group_name = var.resource_group_name
Parameters
-
api_management_name
required - string -
buffered
optional - bool -
description
optional - string -
id
optional computed - string -
name
required - string -
resource_group_name
required - string -
resource_id
optional - string -
application_insights
list block-
instrumentation_key
required - string
-
-
eventhub
list block-
connection_string
required - string -
name
required - string
-
-
timeouts
single block
Explanation in Terraform Registry
Manages a Logger within an API Management Service.
Microsoft.ApiManagement/service/loggers (Azure Resource Manager)
The service/loggers in Microsoft.ApiManagement can be configured in Azure Resource Manager with the resource name Microsoft.ApiManagement/service/loggers
. 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
apiVersion
required - stringname
required - stringLogger identifier. Must be unique in the API Management service instance.
properties
requiredcredentials
optional - stringThe name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
description
optional - stringLogger description.
isBuffered
optional - booleanWhether records are buffered in the logger before publishing. Default is assumed to be true.
loggerType
required - stringLogger type.
resourceId
optional - stringAzure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
type
required - string
Frequently asked questions
What is Azure API Management Logger?
Azure API Management Logger 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 Logger?
For Terraform, the avishekansible/AzureLandingZone, jessewilk/terraform and kevinhead/azurerm source code examples are useful. See the Terraform Example section for further details.