1. Packages
  2. Azure Native
  3. API Docs
  4. apimanagement
  5. Logger
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

azure-native.apimanagement.Logger

Explore with Pulumi AI

This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi

Logger details.

Uses Azure REST API version 2022-09-01-preview. In version 2.x of the Azure Native provider, it used API version 2022-08-01.

Other available API versions: 2021-04-01-preview, 2021-08-01, 2021-12-01-preview, 2022-04-01-preview, 2022-08-01, 2023-03-01-preview, 2023-05-01-preview, 2023-09-01-preview, 2024-05-01, 2024-06-01-preview. These can be accessed by generating a local SDK package using the CLI command pulumi package add azure-native apimanagement [ApiVersion]. See the version guide for details.

Example Usage

ApiManagementCreateAILogger

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var logger = new AzureNative.ApiManagement.Logger("logger", new()
    {
        Credentials = 
        {
            { "instrumentationKey", "11................a1" },
        },
        Description = "adding a new logger",
        LoggerId = "loggerId",
        LoggerType = AzureNative.ApiManagement.LoggerType.ApplicationInsights,
        ResourceGroupName = "rg1",
        ServiceName = "apimService1",
    });

});
Copy
package main

import (
	apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apimanagement.NewLogger(ctx, "logger", &apimanagement.LoggerArgs{
			Credentials: pulumi.StringMap{
				"instrumentationKey": pulumi.String("11................a1"),
			},
			Description:       pulumi.String("adding a new logger"),
			LoggerId:          pulumi.String("loggerId"),
			LoggerType:        pulumi.String(apimanagement.LoggerTypeApplicationInsights),
			ResourceGroupName: pulumi.String("rg1"),
			ServiceName:       pulumi.String("apimService1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apimanagement.Logger;
import com.pulumi.azurenative.apimanagement.LoggerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var logger = new Logger("logger", LoggerArgs.builder()
            .credentials(Map.of("instrumentationKey", "11................a1"))
            .description("adding a new logger")
            .loggerId("loggerId")
            .loggerType("applicationInsights")
            .resourceGroupName("rg1")
            .serviceName("apimService1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const logger = new azure_native.apimanagement.Logger("logger", {
    credentials: {
        instrumentationKey: "11................a1",
    },
    description: "adding a new logger",
    loggerId: "loggerId",
    loggerType: azure_native.apimanagement.LoggerType.ApplicationInsights,
    resourceGroupName: "rg1",
    serviceName: "apimService1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

logger = azure_native.apimanagement.Logger("logger",
    credentials={
        "instrumentationKey": "11................a1",
    },
    description="adding a new logger",
    logger_id="loggerId",
    logger_type=azure_native.apimanagement.LoggerType.APPLICATION_INSIGHTS,
    resource_group_name="rg1",
    service_name="apimService1")
Copy
resources:
  logger:
    type: azure-native:apimanagement:Logger
    properties:
      credentials:
        instrumentationKey: 11................a1
      description: adding a new logger
      loggerId: loggerId
      loggerType: applicationInsights
      resourceGroupName: rg1
      serviceName: apimService1
Copy

ApiManagementCreateEHLogger

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var logger = new AzureNative.ApiManagement.Logger("logger", new()
    {
        Credentials = 
        {
            { "connectionString", "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********=" },
            { "name", "hydraeventhub" },
        },
        Description = "adding a new logger",
        LoggerId = "eh1",
        LoggerType = AzureNative.ApiManagement.LoggerType.AzureEventHub,
        ResourceGroupName = "rg1",
        ServiceName = "apimService1",
    });

});
Copy
package main

import (
	apimanagement "github.com/pulumi/pulumi-azure-native-sdk/apimanagement/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := apimanagement.NewLogger(ctx, "logger", &apimanagement.LoggerArgs{
			Credentials: pulumi.StringMap{
				"connectionString": pulumi.String("Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="),
				"name":             pulumi.String("hydraeventhub"),
			},
			Description:       pulumi.String("adding a new logger"),
			LoggerId:          pulumi.String("eh1"),
			LoggerType:        pulumi.String(apimanagement.LoggerTypeAzureEventHub),
			ResourceGroupName: pulumi.String("rg1"),
			ServiceName:       pulumi.String("apimService1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apimanagement.Logger;
import com.pulumi.azurenative.apimanagement.LoggerArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var logger = new Logger("logger", LoggerArgs.builder()
            .credentials(Map.ofEntries(
                Map.entry("connectionString", "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********="),
                Map.entry("name", "hydraeventhub")
            ))
            .description("adding a new logger")
            .loggerId("eh1")
            .loggerType("azureEventHub")
            .resourceGroupName("rg1")
            .serviceName("apimService1")
            .build());

    }
}
Copy
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const logger = new azure_native.apimanagement.Logger("logger", {
    credentials: {
        connectionString: "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********=",
        name: "hydraeventhub",
    },
    description: "adding a new logger",
    loggerId: "eh1",
    loggerType: azure_native.apimanagement.LoggerType.AzureEventHub,
    resourceGroupName: "rg1",
    serviceName: "apimService1",
});
Copy
import pulumi
import pulumi_azure_native as azure_native

logger = azure_native.apimanagement.Logger("logger",
    credentials={
        "connectionString": "Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********=",
        "name": "hydraeventhub",
    },
    description="adding a new logger",
    logger_id="eh1",
    logger_type=azure_native.apimanagement.LoggerType.AZURE_EVENT_HUB,
    resource_group_name="rg1",
    service_name="apimService1")
Copy
resources:
  logger:
    type: azure-native:apimanagement:Logger
    properties:
      credentials:
        connectionString: Endpoint=sb://hydraeventhub-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=********=
        name: hydraeventhub
      description: adding a new logger
      loggerId: eh1
      loggerType: azureEventHub
      resourceGroupName: rg1
      serviceName: apimService1
Copy

Create Logger Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Logger(name: string, args: LoggerArgs, opts?: CustomResourceOptions);
@overload
def Logger(resource_name: str,
           args: LoggerArgs,
           opts: Optional[ResourceOptions] = None)

@overload
def Logger(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           logger_type: Optional[Union[str, LoggerType]] = None,
           resource_group_name: Optional[str] = None,
           service_name: Optional[str] = None,
           credentials: Optional[Mapping[str, str]] = None,
           description: Optional[str] = None,
           is_buffered: Optional[bool] = None,
           logger_id: Optional[str] = None,
           resource_id: Optional[str] = None)
func NewLogger(ctx *Context, name string, args LoggerArgs, opts ...ResourceOption) (*Logger, error)
public Logger(string name, LoggerArgs args, CustomResourceOptions? opts = null)
public Logger(String name, LoggerArgs args)
public Logger(String name, LoggerArgs args, CustomResourceOptions options)
type: azure-native:apimanagement:Logger
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. LoggerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. LoggerArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. LoggerArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. LoggerArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. LoggerArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var loggerResource = new AzureNative.ApiManagement.Logger("loggerResource", new()
{
    LoggerType = "string",
    ResourceGroupName = "string",
    ServiceName = "string",
    Credentials = 
    {
        { "string", "string" },
    },
    Description = "string",
    IsBuffered = false,
    LoggerId = "string",
    ResourceId = "string",
});
Copy
example, err := apimanagement.NewLogger(ctx, "loggerResource", &apimanagement.LoggerArgs{
	LoggerType:        pulumi.String("string"),
	ResourceGroupName: pulumi.String("string"),
	ServiceName:       pulumi.String("string"),
	Credentials: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Description: pulumi.String("string"),
	IsBuffered:  pulumi.Bool(false),
	LoggerId:    pulumi.String("string"),
	ResourceId:  pulumi.String("string"),
})
Copy
var loggerResource = new Logger("loggerResource", LoggerArgs.builder()
    .loggerType("string")
    .resourceGroupName("string")
    .serviceName("string")
    .credentials(Map.of("string", "string"))
    .description("string")
    .isBuffered(false)
    .loggerId("string")
    .resourceId("string")
    .build());
Copy
logger_resource = azure_native.apimanagement.Logger("loggerResource",
    logger_type="string",
    resource_group_name="string",
    service_name="string",
    credentials={
        "string": "string",
    },
    description="string",
    is_buffered=False,
    logger_id="string",
    resource_id="string")
Copy
const loggerResource = new azure_native.apimanagement.Logger("loggerResource", {
    loggerType: "string",
    resourceGroupName: "string",
    serviceName: "string",
    credentials: {
        string: "string",
    },
    description: "string",
    isBuffered: false,
    loggerId: "string",
    resourceId: "string",
});
Copy
type: azure-native:apimanagement:Logger
properties:
    credentials:
        string: string
    description: string
    isBuffered: false
    loggerId: string
    loggerType: string
    resourceGroupName: string
    resourceId: string
    serviceName: string
Copy

Logger Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Logger resource accepts the following input properties:

LoggerType This property is required. string | Pulumi.AzureNative.ApiManagement.LoggerType
Logger type.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
Credentials Dictionary<string, string>
The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
Description string
Logger description.
IsBuffered bool
Whether records are buffered in the logger before publishing. Default is assumed to be true.
LoggerId Changes to this property will trigger replacement. string
Logger identifier. Must be unique in the API Management service instance.
ResourceId string
Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
LoggerType This property is required. string | LoggerType
Logger type.
ResourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
ServiceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
Credentials map[string]string
The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
Description string
Logger description.
IsBuffered bool
Whether records are buffered in the logger before publishing. Default is assumed to be true.
LoggerId Changes to this property will trigger replacement. string
Logger identifier. Must be unique in the API Management service instance.
ResourceId string
Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
loggerType This property is required. String | LoggerType
Logger type.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management service.
credentials Map<String,String>
The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
description String
Logger description.
isBuffered Boolean
Whether records are buffered in the logger before publishing. Default is assumed to be true.
loggerId Changes to this property will trigger replacement. String
Logger identifier. Must be unique in the API Management service instance.
resourceId String
Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
loggerType This property is required. string | LoggerType
Logger type.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
string
The name of the resource group. The name is case insensitive.
serviceName
This property is required.
Changes to this property will trigger replacement.
string
The name of the API Management service.
credentials {[key: string]: string}
The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
description string
Logger description.
isBuffered boolean
Whether records are buffered in the logger before publishing. Default is assumed to be true.
loggerId Changes to this property will trigger replacement. string
Logger identifier. Must be unique in the API Management service instance.
resourceId string
Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
logger_type This property is required. str | LoggerType
Logger type.
resource_group_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the resource group. The name is case insensitive.
service_name
This property is required.
Changes to this property will trigger replacement.
str
The name of the API Management service.
credentials Mapping[str, str]
The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
description str
Logger description.
is_buffered bool
Whether records are buffered in the logger before publishing. Default is assumed to be true.
logger_id Changes to this property will trigger replacement. str
Logger identifier. Must be unique in the API Management service instance.
resource_id str
Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).
loggerType This property is required. String | "azureEventHub" | "applicationInsights" | "azureMonitor"
Logger type.
resourceGroupName
This property is required.
Changes to this property will trigger replacement.
String
The name of the resource group. The name is case insensitive.
serviceName
This property is required.
Changes to this property will trigger replacement.
String
The name of the API Management service.
credentials Map<String>
The name and SendRule connection string of the event hub for azureEventHub logger. Instrumentation key for applicationInsights logger.
description String
Logger description.
isBuffered Boolean
Whether records are buffered in the logger before publishing. Default is assumed to be true.
loggerId Changes to this property will trigger replacement. String
Logger identifier. Must be unique in the API Management service instance.
resourceId String
Azure Resource Id of a log target (either Azure Event Hub resource or Azure Application Insights resource).

Outputs

All input properties are implicitly available as output properties. Additionally, the Logger resource produces the following output properties:

AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
AzureApiVersion string
The Azure API version of the resource.
Id string
The provider-assigned unique ID for this managed resource.
Name string
The name of the resource
Type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azureApiVersion string
The Azure API version of the resource.
id string
The provider-assigned unique ID for this managed resource.
name string
The name of the resource
type string
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azure_api_version str
The Azure API version of the resource.
id str
The provider-assigned unique ID for this managed resource.
name str
The name of the resource
type str
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
azureApiVersion String
The Azure API version of the resource.
id String
The provider-assigned unique ID for this managed resource.
name String
The name of the resource
type String
The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Supporting Types

LoggerType
, LoggerTypeArgs

AzureEventHub
azureEventHubAzure Event Hub as log destination.
ApplicationInsights
applicationInsightsAzure Application Insights as log destination.
AzureMonitor
azureMonitorAzure Monitor
LoggerTypeAzureEventHub
azureEventHubAzure Event Hub as log destination.
LoggerTypeApplicationInsights
applicationInsightsAzure Application Insights as log destination.
LoggerTypeAzureMonitor
azureMonitorAzure Monitor
AzureEventHub
azureEventHubAzure Event Hub as log destination.
ApplicationInsights
applicationInsightsAzure Application Insights as log destination.
AzureMonitor
azureMonitorAzure Monitor
AzureEventHub
azureEventHubAzure Event Hub as log destination.
ApplicationInsights
applicationInsightsAzure Application Insights as log destination.
AzureMonitor
azureMonitorAzure Monitor
AZURE_EVENT_HUB
azureEventHubAzure Event Hub as log destination.
APPLICATION_INSIGHTS
applicationInsightsAzure Application Insights as log destination.
AZURE_MONITOR
azureMonitorAzure Monitor
"azureEventHub"
azureEventHubAzure Event Hub as log destination.
"applicationInsights"
applicationInsightsAzure Application Insights as log destination.
"azureMonitor"
azureMonitorAzure Monitor

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:apimanagement:Logger eh1 /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiManagement/service/{serviceName}/loggers/{loggerId} 
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0
This is the latest version of Azure Native. Use the Azure Native v2 docs if using the v2 version of this package.
Azure Native v3.1.0 published on Tuesday, Apr 8, 2025 by Pulumi