Log Profiles - Update

Updates an existing LogProfilesResource. To update other fields use the CreateOrUpdate method.

PATCH https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Insights/logprofiles/{logProfileName}?api-version=2016-03-01

URI Parameters

Name In Required Type Description
logProfileName
path True

string

The name of the log profile.

subscriptionId
path True

string

The ID of the target subscription.

api-version
query True

string

The API version to use for this operation.

Request Body

Name Required Type Description
properties.categories True

string[]

the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'

properties.locations True

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.

properties.retentionPolicy True

RetentionPolicy

the retention policy for the events in the log.

properties.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}'.

properties.storageAccountId

string

the resource id of the storage account to which you would like to send the Activity Log.

tags

object

Resource tags

Responses

Name Type Description
200 OK

LogProfileResource

An existing log profile was successfully updated.

Other Status Codes

ErrorResponse

Error response describing why the operation failed.

Security

azure_auth

Azure Active Directory OAuth2 Flow

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Patch a log profile

Sample request

PATCH https://management.azure.com/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/Microsoft.Insights/logprofiles/Rac46PostSwapRG?api-version=2016-03-01

{
  "tags": {
    "key1": "value1"
  },
  "properties": {
    "locations": [
      "global"
    ],
    "categories": [
      "Write",
      "Delete",
      "Action"
    ],
    "retentionPolicy": {
      "enabled": true,
      "days": 3
    },
    "storageAccountId": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
    "serviceBusRuleId": ""
  }
}

Sample response

{
  "id": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/providers/microsoft.insights/logprofiles/default",
  "type": "",
  "name": "default",
  "location": "",
  "tags": {
    "key1": "value1"
  },
  "properties": {
    "storageAccountId": "/subscriptions/df602c9c-7aa0-407d-a6fb-eb20c8bd1192/resourceGroups/JohnKemTest/providers/Microsoft.Storage/storageAccounts/johnkemtest8162",
    "serviceBusRuleId": "",
    "locations": [
      "global"
    ],
    "categories": [
      "Delete",
      "Write",
      "Action"
    ],
    "retentionPolicy": {
      "enabled": true,
      "days": 3
    }
  }
}

Definitions

Name Description
ErrorResponse

Describes the format of Error response.

LogProfileResource

The log profile resource.

LogProfileResourcePatch

The log profile resource for patch operations.

RetentionPolicy

Specifies the retention policy for the log.

ErrorResponse

Describes the format of Error response.

Name Type Description
code

string

Error code

message

string

Error message indicating why the operation failed.

LogProfileResource

The log profile resource.

Name Type Description
id

string

Azure resource Id

location

string

Resource location

name

string

Azure resource name

properties.categories

string[]

the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'

properties.locations

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.

properties.retentionPolicy

RetentionPolicy

the retention policy for the events in the log.

properties.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}'.

properties.storageAccountId

string

the resource id of the storage account to which you would like to send the Activity Log.

tags

object

Resource tags

type

string

Azure resource type

LogProfileResourcePatch

The log profile resource for patch operations.

Name Type Description
properties.categories

string[]

the categories of the logs. These categories are created as is convenient to the user. Some values are: 'Write', 'Delete', and/or 'Action.'

properties.locations

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.

properties.retentionPolicy

RetentionPolicy

the retention policy for the events in the log.

properties.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}'.

properties.storageAccountId

string

the resource id of the storage account to which you would like to send the Activity Log.

tags

object

Resource tags

RetentionPolicy

Specifies the retention policy for the log.

Name Type Description
days

integer

the number of days for the retention in days. A value of 0 will retain the events indefinitely.

enabled

boolean

a value indicating whether the retention policy is enabled.