Create or update a log profile in Azure Monitor REST API
Updated: September 26, 2016
See common parameters and header for headers and parameters that are used by all requests related to log profiles.
| Method | Request URI |
|---|---|
| PUT | https://management.azure.com/subscriptions/{subscription-id}/providers/microsoft.insights/logprofiles/default?api-version={api-version} |
JSON
{
"properties": {
"storageAccountId": "/subscriptions/6983c752-c9b8-48dd-b4d4-da739beb7e98/resourceGroups/Default-Storage-WestUS/providers/Microsoft.ClassicStorage/storageAccounts/armlogs1",
"serviceBusRuleId": "/subscriptions/6983c752-c9b8-48dd-b4d4-da739beb7e98/resourceGroups/Default-ServiceBus-WestUS/providers/Microsoft.ServiceBus/namespaces/myNamespace/RootManageSharedAccessKey",
"locations": [
"eastus",
"westus"
],
"categories": [
"Write",
"Delete",
"Action"
],
"retentionPolicy": {
"enabled": true,
"days": 1
}
}
}
| Element name | Type | Description |
|---|---|---|
| storageAccountId | string | The resource ID of the storage account to which you would like to send the Activity Log |
| 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}”. |
| locations | Array of strings | List of regions for which Activity Log events should be stored or streamed. |
| categories | Array of strings | Must be "Write", "Delete", and/or "Action." Describes the operation types that will be stored or streamed. |
| retentionPolicy | JSON blob | Describes the retention policy for events in the log. Used for storage account option only. |
| enabled | boolean | Describes whether a retention policy is enabled. |
| days | Int | Number of days to retain the events. A value of 0 will retain the events indefinitely. Used for storage account option only. |
Status code 200
Show: