Log Profile
The log profile resource. Uses Azure REST API version 2016-03-01. In version 1.x of the Azure Native provider, it used API version 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,
});
});
Content copied to clipboard
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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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}
Content copied to clipboard
Properties
Link copied to clipboard
the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
the retention policy for the events in the log.
Link copied to clipboard
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}'.
Link copied to clipboard
the resource id of the storage account to which you would like to send the Activity Log.