1. Packages
  2. Azure Native v2
  3. API Docs
  4. insights
  5. LogProfile
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

azure-native-v2.insights.LogProfile

Explore with Pulumi AI

These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi

The log profile resource. Azure REST API version: 2016-03-01. Prior API version in Azure Native 1.x: 2016-03-01.

Example Usage

Create or update a log profile

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

return await Deployment.RunAsync(() => 
{
    var logProfile = new AzureNative.Insights.LogProfile("logProfile", new()
    {
        Categories = new[]
        {
            "Write",
            "Delete",
            "Action",
        },
        Location = "",
        Locations = new[]
        {
            "global",
        },
        LogProfileName = "Rac46PostSwapRG",
        RetentionPolicy = new AzureNative.Insights.Inputs.RetentionPolicyArgs
        {
            Days = 3,
            Enabled = true,
        },
        ServiceBusRuleId = "",
        StorageAccountId = "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
        Tags = null,
    });

});
Copy
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := insights.NewLogProfile(ctx, "logProfile", &insights.LogProfileArgs{
			Categories: pulumi.StringArray{
				pulumi.String("Write"),
				pulumi.String("Delete"),
				pulumi.String("Action"),
			},
			Location: pulumi.String(""),
			Locations: pulumi.StringArray{
				pulumi.String("global"),
			},
			LogProfileName: pulumi.String("Rac46PostSwapRG"),
			RetentionPolicy: &insights.RetentionPolicyArgs{
				Days:    pulumi.Int(3),
				Enabled: pulumi.Bool(true),
			},
			ServiceBusRuleId: pulumi.String(""),
			StorageAccountId: pulumi.String("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162"),
			Tags:             pulumi.StringMap{},
		})
		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.insights.LogProfile;
import com.pulumi.azurenative.insights.LogProfileArgs;
import com.pulumi.azurenative.insights.inputs.RetentionPolicyArgs;
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 logProfile = new LogProfile("logProfile", LogProfileArgs.builder()
            .categories(            
                "Write",
                "Delete",
                "Action")
            .location("")
            .locations("global")
            .logProfileName("Rac46PostSwapRG")
            .retentionPolicy(RetentionPolicyArgs.builder()
                .days(3)
                .enabled(true)
                .build())
            .serviceBusRuleId("")
            .storageAccountId("/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162")
            .tags()
            .build());

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

const logProfile = new azure_native.insights.LogProfile("logProfile", {
    categories: [
        "Write",
        "Delete",
        "Action",
    ],
    location: "",
    locations: ["global"],
    logProfileName: "Rac46PostSwapRG",
    retentionPolicy: {
        days: 3,
        enabled: true,
    },
    serviceBusRuleId: "",
    storageAccountId: "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
    tags: {},
});
Copy
import pulumi
import pulumi_azure_native as azure_native

log_profile = azure_native.insights.LogProfile("logProfile",
    categories=[
        "Write",
        "Delete",
        "Action",
    ],
    location="",
    locations=["global"],
    log_profile_name="Rac46PostSwapRG",
    retention_policy={
        "days": 3,
        "enabled": True,
    },
    service_bus_rule_id="",
    storage_account_id="/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
    tags={})
Copy
resources:
  logProfile:
    type: azure-native:insights:LogProfile
    properties:
      categories:
        - Write
        - Delete
        - Action
      location: ""
      locations:
        - global
      logProfileName: Rac46PostSwapRG
      retentionPolicy:
        days: 3
        enabled: true
      serviceBusRuleId: ""
      storageAccountId: /subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162
      tags: {}
Copy

Create LogProfile Resource

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

Constructor syntax

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

@overload
def LogProfile(resource_name: str,
               opts: Optional[ResourceOptions] = None,
               categories: Optional[Sequence[str]] = None,
               locations: Optional[Sequence[str]] = None,
               retention_policy: Optional[RetentionPolicyArgs] = None,
               location: Optional[str] = None,
               log_profile_name: Optional[str] = None,
               service_bus_rule_id: Optional[str] = None,
               storage_account_id: Optional[str] = None,
               tags: Optional[Mapping[str, str]] = None)
func NewLogProfile(ctx *Context, name string, args LogProfileArgs, opts ...ResourceOption) (*LogProfile, error)
public LogProfile(string name, LogProfileArgs args, CustomResourceOptions? opts = null)
public LogProfile(String name, LogProfileArgs args)
public LogProfile(String name, LogProfileArgs args, CustomResourceOptions options)
type: azure-native:insights:LogProfile
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. LogProfileArgs
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. LogProfileArgs
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. LogProfileArgs
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. LogProfileArgs
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. LogProfileArgs
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 logProfileResource = new AzureNative.Insights.LogProfile("logProfileResource", new()
{
    Categories = new[]
    {
        "string",
    },
    Locations = new[]
    {
        "string",
    },
    RetentionPolicy = 
    {
        { "days", 0 },
        { "enabled", false },
    },
    Location = "string",
    LogProfileName = "string",
    ServiceBusRuleId = "string",
    StorageAccountId = "string",
    Tags = 
    {
        { "string", "string" },
    },
});
Copy
example, err := insights.NewLogProfile(ctx, "logProfileResource", &insights.LogProfileArgs{
	Categories: []string{
		"string",
	},
	Locations: []string{
		"string",
	},
	RetentionPolicy: map[string]interface{}{
		"days":    0,
		"enabled": false,
	},
	Location:         "string",
	LogProfileName:   "string",
	ServiceBusRuleId: "string",
	StorageAccountId: "string",
	Tags: map[string]interface{}{
		"string": "string",
	},
})
Copy
var logProfileResource = new LogProfile("logProfileResource", LogProfileArgs.builder()
    .categories("string")
    .locations("string")
    .retentionPolicy(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .location("string")
    .logProfileName("string")
    .serviceBusRuleId("string")
    .storageAccountId("string")
    .tags(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    .build());
Copy
log_profile_resource = azure_native.insights.LogProfile("logProfileResource",
    categories=[string],
    locations=[string],
    retention_policy={
        days: 0,
        enabled: False,
    },
    location=string,
    log_profile_name=string,
    service_bus_rule_id=string,
    storage_account_id=string,
    tags={
        string: string,
    })
Copy
const logProfileResource = new azure_native.insights.LogProfile("logProfileResource", {
    categories: ["string"],
    locations: ["string"],
    retentionPolicy: {
        days: 0,
        enabled: false,
    },
    location: "string",
    logProfileName: "string",
    serviceBusRuleId: "string",
    storageAccountId: "string",
    tags: {
        string: "string",
    },
});
Copy
type: azure-native:insights:LogProfile
properties:
    categories:
        - string
    location: string
    locations:
        - string
    logProfileName: string
    retentionPolicy:
        days: 0
        enabled: false
    serviceBusRuleId: string
    storageAccountId: string
    tags:
        string: string
Copy

LogProfile 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 LogProfile resource accepts the following input properties:

Categories This property is required. List<string>
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
Locations This property is required. List<string>
List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
RetentionPolicy This property is required. Pulumi.AzureNative.Insights.Inputs.RetentionPolicy
the retention policy for the events in the log.
Location Changes to this property will trigger replacement. string
Resource location
LogProfileName Changes to this property will trigger replacement. string
The name of the log profile.
ServiceBusRuleId string
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
StorageAccountId string
the resource id of the storage account to which you would like to send the Activity Log.
Tags Dictionary<string, string>
Resource tags
Categories This property is required. []string
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
Locations This property is required. []string
List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
RetentionPolicy This property is required. RetentionPolicyArgs
the retention policy for the events in the log.
Location Changes to this property will trigger replacement. string
Resource location
LogProfileName Changes to this property will trigger replacement. string
The name of the log profile.
ServiceBusRuleId string
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
StorageAccountId string
the resource id of the storage account to which you would like to send the Activity Log.
Tags map[string]string
Resource tags
categories This property is required. List<String>
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
locations This property is required. List<String>
List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
retentionPolicy This property is required. RetentionPolicy
the retention policy for the events in the log.
location Changes to this property will trigger replacement. String
Resource location
logProfileName Changes to this property will trigger replacement. String
The name of the log profile.
serviceBusRuleId String
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
storageAccountId String
the resource id of the storage account to which you would like to send the Activity Log.
tags Map<String,String>
Resource tags
categories This property is required. string[]
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
locations This property is required. string[]
List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
retentionPolicy This property is required. RetentionPolicy
the retention policy for the events in the log.
location Changes to this property will trigger replacement. string
Resource location
logProfileName Changes to this property will trigger replacement. string
The name of the log profile.
serviceBusRuleId string
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
storageAccountId string
the resource id of the storage account to which you would like to send the Activity Log.
tags {[key: string]: string}
Resource tags
categories This property is required. Sequence[str]
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
locations This property is required. Sequence[str]
List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
retention_policy This property is required. RetentionPolicyArgs
the retention policy for the events in the log.
location Changes to this property will trigger replacement. str
Resource location
log_profile_name Changes to this property will trigger replacement. str
The name of the log profile.
service_bus_rule_id str
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
storage_account_id str
the resource id of the storage account to which you would like to send the Activity Log.
tags Mapping[str, str]
Resource tags
categories This property is required. List<String>
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
locations This property is required. List<String>
List of regions for which Activity Log events should be stored or streamed. It is a comma separated list of valid ARM locations including the 'global' location.
retentionPolicy This property is required. Property Map
the retention policy for the events in the log.
location Changes to this property will trigger replacement. String
Resource location
logProfileName Changes to this property will trigger replacement. String
The name of the log profile.
serviceBusRuleId String
The service bus rule ID of the service bus namespace in which you would like to have Event Hubs created for streaming the Activity Log. The rule ID is of the format: '{service bus resource ID}/authorizationrules/{key name}'.
storageAccountId String
the resource id of the storage account to which you would like to send the Activity Log.
tags Map<String>
Resource tags

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Name string
Azure resource name
Type string
Azure resource type
Id string
The provider-assigned unique ID for this managed resource.
Name string
Azure resource name
Type string
Azure resource type
id String
The provider-assigned unique ID for this managed resource.
name String
Azure resource name
type String
Azure resource type
id string
The provider-assigned unique ID for this managed resource.
name string
Azure resource name
type string
Azure resource type
id str
The provider-assigned unique ID for this managed resource.
name str
Azure resource name
type str
Azure resource type
id String
The provider-assigned unique ID for this managed resource.
name String
Azure resource name
type String
Azure resource type

Supporting Types

RetentionPolicy
, RetentionPolicyArgs

Days This property is required. int
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled This property is required. bool
a value indicating whether the retention policy is enabled.
Days This property is required. int
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled This property is required. bool
a value indicating whether the retention policy is enabled.
days This property is required. Integer
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. Boolean
a value indicating whether the retention policy is enabled.
days This property is required. number
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. boolean
a value indicating whether the retention policy is enabled.
days This property is required. int
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. bool
a value indicating whether the retention policy is enabled.
days This property is required. Number
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. Boolean
a value indicating whether the retention policy is enabled.

RetentionPolicyResponse
, RetentionPolicyResponseArgs

Days This property is required. int
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled This property is required. bool
a value indicating whether the retention policy is enabled.
Days This property is required. int
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
Enabled This property is required. bool
a value indicating whether the retention policy is enabled.
days This property is required. Integer
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. Boolean
a value indicating whether the retention policy is enabled.
days This property is required. number
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. boolean
a value indicating whether the retention policy is enabled.
days This property is required. int
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. bool
a value indicating whether the retention policy is enabled.
days This property is required. Number
the number of days for the retention in days. A value of 0 will retain the events indefinitely.
enabled This property is required. Boolean
a value indicating whether the retention policy is enabled.

Import

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

$ pulumi import azure-native:insights:LogProfile default /subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName} 
Copy

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

Package Details

Repository
azure-native-v2 pulumi/pulumi-azure-native
License
Apache-2.0
These are the docs for Azure Native v2. We recommenend using the latest version, Azure Native v3.
Azure Native v2 v2.90.0 published on Thursday, Mar 27, 2025 by Pulumi