Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
The Azure Activity Log is a log that provides insight into operations performed on resources in your subscription. Operations include create, update, delete, and other actions taken on resources. The Activity Log is a platform-wide log and isn't limited to a particular service. This article explains how to retrieve activity log data using the Azure Monitor REST API. For more information about the activity log, see Azure Activity Log event schema.
To retrieve resource logs, you must authenticate with Microsoft Entra. For more information, see Azure monitoring REST API walkthrough.
Use the Azure Monitor REST API to query activity log data.
The following request format is used to request activity log data.
GET /subscriptions/<subscriptionId>/providers/Microsoft.Insights/eventtypes/management/values \
?api-version=2015-04-01 \
&$filter=<filter> \
&$select=<select>
host: management.azure.com
authorization: Bearer <token>
$filter
reduces the set of data collected. This argument is required and it also requires at least the start date/time.
The $filter
argument accepts the following patterns:
$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceGroupName eq <resourceGroupName>
.$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceUri eq <resourceURI>
.$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z'
.$filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and resourceProvider eq <resourceProviderName>
. $filter=eventTimestamp ge '2014-07-16T04:36:37.6407898Z' and eventTimestamp le '2014-07-20T04:36:37.6407898Z' and correlationId eq '<correlationID>
.$select
fetches a specified list of properties for the returned events.
The $select
argument is a comma separated list of property names to be returned.
Valid values are:
authorization
, claims
, correlationId
, description
, eventDataId
, eventName
, eventTimestamp
, httpRequest
, level
, operationId
, operationName
, properties
, resourceGroupName
, resourceProviderName
, resourceId
, status
, submissionTimestamp
, subStatus
, and subscriptionId
.
The following sample requests use the Azure Monitor REST API to query an activity log.
The following example gets the activity logs for resource group MSSupportGroup
between the dates 2023-03-21T20:00:00Z
and 2023-03-24T20:00:00Z
GET https://management.azure.com/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2023-03-21T20:00:00Z' and eventTimestamp le '2023-03-24T20:00:00Z' and resourceGroupName eq 'MSSupportGroup'
The following example gets the activity logs for resource group MSSupportGroup
, between the dates 2023-03-21T20:00:00Z
and 2023-03-24T20:00:00Z
, returning the elements eventName, operationName, status, eventTimestamp, correlationId, submissionTimestamp, and level.
GET https://management.azure.com/subscriptions/aaaa0a0a-bb1b-cc2c-dd3d-eeeeee4e4e4e/providers/microsoft.insights/eventtypes/management/values?api-version=2015-04-01&$filter=eventTimestamp ge '2023-03-21T20:00:00Z' and eventTimestamp le '2023-03-24T20:00:00Z'and resourceGroupName eq 'MSSupportGroup'&$select=eventName,operationName,status,eventTimestamp,correlationId,submissionTimestamp,level
Stream Azure Monitor activity log data. Azure Activity Log event schema.
Events
Mar 17, 9 PM - Mar 21, 10 AM
Join the meetup series to build scalable AI solutions based on real-world use cases with fellow developers and experts.
Register nowTraining
Module
Analyze your Azure infrastructure by using Azure Monitor logs - Training
Use Azure Monitor logs to extract valuable information about your infrastructure from log data.
Certification
Microsoft Certified: Azure Administrator Associate - Certifications
Demonstrate key skills to configure, manage, secure, and administer key professional functions in Microsoft Azure.
Documentation
Azure monitoring REST API walkthrough - Azure Monitor
How to authenticate requests and use the Azure Monitor REST API to retrieve available metric definitions, metric values, and activity logs.
Querying logs for Azure resources - Azure Monitor
In Log Analytics, queries typically execute in the context of a workspace. A workspace may contain data for many resources, making it difficult to isolate data for a particular resource.
Azure Monitor REST API index - Azure Monitor
Lists the operation groups for the Azure Monitor REST API, which includes Application Insights, Log Analytics, and Monitor.