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.

MethodRequest URI
PUThttps://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 nameTypeDescription
storageAccountIdstringThe resource ID of the storage account to which you would like to send the Activity Log
serviceBusRuleIdstringThe 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}”.
locationsArray of stringsList of regions for which Activity Log events should be stored or streamed.
categoriesArray of stringsMust be "Write", "Delete", and/or "Action." Describes the operation types that will be stored or streamed.
retentionPolicyJSON blobDescribes the retention policy for events in the log. Used for storage account option only.
enabledbooleanDescribes whether a retention policy is enabled.
daysIntNumber 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: