Skip to content

Commit c231008

Browse files
Merge pull request #34670 from MicrosoftDocs/main
Auto Publish – main to live - 2025-07-10 17:30 UTC
2 parents 6952e9a + 1a09d89 commit c231008

18 files changed

Lines changed: 234 additions & 171 deletions

azure-sql/database/xevent-code-event-file.md

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Provides example steps to create an event session in Azure SQL, usi
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
77
ms.reviewer: wiassaf, mathoma, randolphwest
8-
ms.date: 10/21/2024
8+
ms.date: 07/09/2025
99
ms.service: azure-sql
1010
ms.subservice: performance
1111
ms.topic: sample
@@ -23,20 +23,21 @@ The high-level steps in this walkthrough are:
2323
1. Create an Azure Storage account, or find an existing suitable account to use.
2424
1. Create a container in this storage account.
2525
1. Grant the [!INCLUDE [ssde-md](../../docs/includes/ssde-md.md)] required access to the container using either an RBAC role assignment, or a SAS token.
26-
1. Create a credential in the database or managed instance where you create the event session.
26+
1. Create a credential in the database or SQL managed instance where you create the event session.
2727
1. Create, start, and use an event session.
2828

2929
## Create a storage account and container
3030

3131
For a detailed description of how to create a storage account in Azure Storage, see [Create a storage account](/azure/storage/common/storage-account-create). You learn how to create a storage account using Azure portal, PowerShell, Azure SQL, an ARM template, or a Bicep template.
3232

33-
We recommended you use an account that:
33+
Use an account that:
3434

3535
- Is a `Standard general-purpose v2` account.
3636
- Has its redundancy type matching the redundancy of the Azure SQL database, elastic pool, or managed instance where event sessions are created.
3737
- For [locally redundant](high-availability-sla-local-zone-redundancy.md#locally-redundant-availability) Azure SQL resources, use LRS, GRS, or RA-GRS. For [zone-redundant](high-availability-sla-local-zone-redundancy.md#zone-redundant-availability) Azure SQL resources, use ZRS, GZRS, or RA-GZRS. For more information, see [Azure Storage redundancy](/azure/storage/common/storage-redundancy).
3838
- Uses the `Hot` [blob access tier](/azure/storage/blobs/access-tiers-overview).
3939
- Is in the same Azure region as the Azure SQL database, elastic pool, or managed instance.
40+
- Doesn't have the [hierarchical namespace](/azure/storage/blobs/data-lake-storage-namespace) enabled.
4041

4142
Next, [create a container](/azure/storage/blobs/blob-containers-portal#create-a-container) in this storage account using Azure portal. You can also create a container [using PowerShell](/azure/storage/blobs/blob-containers-powershell#create-a-container), or [using Azure CLI](/azure/storage/blobs/blob-containers-cli#create-a-container).
4243

@@ -70,7 +71,7 @@ To read and write event data, the [!INCLUDE [ssde-md](../../docs/includes/ssde-m
7071

7172
# [SQL Database](#tab/sqldb)
7273

73-
Create a database-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS or ADS, open a new query window, connect to the database where you create the event session, and paste the following T-SQL batch. Make sure you're connected to your user database, and not to the `master` database.
74+
Create a database-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS, open a new query window, connect to the database where you create the event session, and paste the following T-SQL batch. Make sure you're connected to your user database, and not to the `master` database.
7475

7576
> [!NOTE]
7677
> Executing the following T-SQL batch requires the `CONTROL` database permission, which is held by the database owner (`dbo`), by the members of the `db_owner` database role, and by the administrator of the logical server.
@@ -96,10 +97,10 @@ To read and write event data, the [!INCLUDE [ssde-md](../../docs/includes/ssde-m
9697

9798
# [SQL Managed Instance](#tab/sqlmi)
9899

99-
Create a server-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS or ADS, open a new query window, connect it to the `master` database on the managed instance where you create the event session, and paste the following T-SQL batch.
100+
Create a server-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS, open a new query window, connect it to the `master` database on the SQL managed instance where you create the event session, and paste the following T-SQL batch.
100101

101102
> [!NOTE]
102-
> Executing the following T-SQL batch requires the `CONTROL` database permission in the `master` database, which is held by the members of the `db_owner` database role in `master`, and by the members of the `sysadmin` server role on the managed instance.
103+
> Executing the following T-SQL batch requires the `CONTROL` database permission in the `master` database, which is held by the members of the `db_owner` database role in `master`, and by the members of the `sysadmin` server role on the SQL managed instance.
103104

104105
```sql
105106
/*
@@ -146,7 +147,7 @@ To read and write event data, the [!INCLUDE [ssde-md](../../docs/includes/ssde-m
146147

147148
# [SQL Database](#tab/sqldb)
148149

149-
Store the SAS token in a database-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS or ADS, open a new query window, connect to the database where you create the event session, and paste the following T-SQL batch. Make sure you're connected to your user database, and not to the `master` database.
150+
Store the SAS token in a database-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS, open a new query window, connect to the database where you create the event session, and paste the following T-SQL batch. Make sure you're connected to your user database, and not to the `master` database.
150151
151152
> [!NOTE]
152153
> Executing the following T-SQL batch requires the `CONTROL` database permission, which is held by the database owner (`dbo`), by the members of the `db_owner` database role, and by the administrator of the logical server.
@@ -188,10 +189,10 @@ To read and write event data, the [!INCLUDE [ssde-md](../../docs/includes/ssde-m
188189

189190
# [SQL Managed Instance](#tab/sqlmi)
190191

191-
Store the SAS token in a server-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS or ADS, open a new query window, connect it to the `master` database on the managed instance where you create the event session, and paste the following T-SQL batch.
192+
Store the SAS token in a server-scoped [credential](/sql/relational-databases/security/authentication-access/credentials-database-engine). Using a client tool such as SSMS, open a new query window, connect it to the `master` database on the SQL managed instance where you create the event session, and paste the following T-SQL batch.
192193

193194
> [!NOTE]
194-
> Executing the following T-SQL batch requires the `CONTROL` database permission in the `master` database, which is held by the members of the `db_owner` database role in `master`, and by the members of the `sysadmin` server role on the managed instance.
195+
> Executing the following T-SQL batch requires the `CONTROL` database permission in the `master` database, which is held by the members of the `db_owner` database role in `master`, and by the members of the `sysadmin` server role on the SQL managed instance.
195196

196197
```sql
197198
/*
@@ -271,10 +272,30 @@ Select **OK** to create the session.
271272

272273
In Object Explorer, expand the **Sessions** folder to see the event session you created. By default, the session isn't started when it's created. To start the session, right-click on the session name, and select **Start Session**. You can later stop it by similarly selecting **Stop Session**, once the session is running.
273274

274-
As T-SQL batches are executed in this database or managed instance, the session writes events to the `example-session.xel` blob in the storage container.
275+
As T-SQL batches are executed in this database or SQL managed instance, the session writes events to the `example-session.xel` blob in the storage container.
275276

276277
To stop the session, right-click it in Object Explorer, and select **Stop Session**.
277278

279+
### Troubleshoot event sessions with an event_file target in Azure Storage
280+
281+
The following list contains errors that you might encounter when starting an extended event session that uses Azure Storage, with the possible explanations for the error.
282+
283+
- **The operating system returned error 5: 'Access is denied.'**
284+
- If using managed identity authentication:
285+
- The managed identity of a logical server or SQL managed instance doesn't have the required RBAC role assignment. For more information, see [Grant access using managed identity](#grant-access-using-managed-identity).
286+
- The storage account [firewall](/azure/storage/common/storage-network-security) is enabled and an exception to allow trusted Azure services to access the storage account is also enabled, but a `Microsoft.Sql/servers` resource instance for the logical server hasn't been added to the list of resource instances that are granted access. For more information, see [Grant access from Azure resource instances](/azure/storage/common/storage-network-security#grant-access-from-azure-resource-instances).
287+
- If using SAS token authentication:
288+
- The storage account [firewall](/azure/storage/common/storage-network-security) is enabled. This is not supported for event sessions that use SAS token authentication.
289+
- The SAS token doesn't have sufficient permissions, or has expired. For more information, see [Grant access using a SAS token](#grant-access-using-a-sas-token).
290+
- **The operating system returned error 86: 'The specified network password is not correct.'**
291+
- There is no database-scoped credential (for Azure SQL Database) or server-scoped credential (for Azure SQL Managed Instance) with the name matching the blob container URL. For more information, see the examples in [Grant access to the container](#grant-access-to-the-container).
292+
- The credential name ends with a slash (`/`). The credential name should end with the container name not including the trailing slash.
293+
- **The operating system returned error 3: 'The system cannot find the path specified.'**
294+
- The container specified in the blob container URL doesn't exist.
295+
- **The operating system returned error 13: 'The data is invalid.'**
296+
- There is an [immutability policy](/azure/storage/blobs/immutable-policy-configure-container-scope) on the blob container. Immutable storage isn't supported for event sessions.
297+
- The storage account has the [hierarchical namespace](/azure/storage/blobs/data-lake-storage-namespace) enabled. Storage accounts with hierarchical namespace enabled aren't supported for event sessions.
298+
278299
## View event data
279300

280301
You can view event data in the SQL Server Management Studio (SSMS) event viewer UI, where you can use filters and aggregations to analyze the data you captured. For more information on using the event viewer in SSMS, see [View event data in SSMS](/sql/relational-databases/extended-events/advanced-viewing-of-target-data-from-extended-events-in-sql-server).

azure-sql/database/xevent-db-diff-from-svr.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Describes extended events (XEvents) in Azure SQL Database and Azure
55
author: WilliamDAssafMSFT
66
ms.author: wiassaf
77
ms.reviewer: wiassaf, mathoma, randolphwest
8-
ms.date: 10/21/2024
8+
ms.date: 07/09/2025
99
ms.service: azure-sql
1010
ms.subservice: performance
1111
ms.topic: reference
@@ -36,7 +36,7 @@ The feature set, functionality, and usage scenarios for Extended Events in Azure
3636

3737
There are two examples to help you get started with Extended Events in Azure SQL Database and Azure SQL Managed Instance quickly:
3838

39-
- [Create a session with an event_file target in Azure Storage](xevent-code-event-file.md). This example shows you how to capture event data in a file (blob) in Azure Storage using the `event_file` target. Use this if you need to persist captured event data, or if you want to use event viewer in SQL Server Management Studio (SSMS) to analyze captured data.
39+
- [Create a session with an event_file target in Azure Storage](xevent-code-event-file.md). This example shows you how to capture event data in a file (blob) in Azure Storage using the `event_file` target, and includes [troubleshooting guidance](xevent-code-event-file.md#troubleshoot-event-sessions-with-an-event_file-target-in-azure-storage) for common errors. Use this if you need to persist captured event data, or if you want to use event viewer in SQL Server Management Studio (SSMS) to analyze captured data.
4040
- [Create a session with a ring_buffer target in memory](xevent-code-ring-buffer.md). This example shows you how to capture the latest events from an event session in memory using the `ring_buffer` target. Use this as a quick way to look at recent events during ad hoc investigations or troubleshooting, without having to store captured event data.
4141

4242
Extended Events can be used to monitor read-only replicas. For more information, see [Read queries on replicas](read-scale-out.md#monitor-read-only-replicas-with-extended-events).
@@ -49,6 +49,7 @@ Adopt the following best practices to use Extended Events in Azure SQL Database
4949
- Use a storage account in the same Azure region as the database or managed instance where you create event sessions.
5050
- Align the redundancy of the storage account with the redundancy of the database, elastic pool, or managed instance. For [locally redundant](high-availability-sla-local-zone-redundancy.md#locally-redundant-availability) resources, use LRS, GRS, or RA-GRS. For [zone-redundant](high-availability-sla-local-zone-redundancy.md#zone-redundant-availability) resources, use ZRS, GZRS, or RA-GZRS. See [Azure Storage redundancy](/azure/storage/common/storage-redundancy) for details.
5151
- Don't use any [blob access tier](/azure/storage/blobs/access-tiers-overview) other than `Hot`.
52+
- Don't enable the [hierarchical namespace](/azure/storage/blobs/data-lake-storage-namespace) for the storage account.
5253
- If you want to create a continuously running event session that starts automatically after each [!INCLUDE [ssde-md](../../docs/includes/ssde-md.md)] restart (for example, after a failover or a maintenance event), include the event session option of `STARTUP_STATE = ON` in your `CREATE EVENT SESSION` or `ALTER EVENT SESSION` statements.
5354
- Conversely, use `STARTUP_STATE = OFF` for short-term event sessions such as those used in ad hoc troubleshooting.
5455
- In Azure SQL Database, do not read deadlock events from the built-in `dl` event session. If there is a large number of deadlock events collected, reading them with the [sys.fn_xe_file_target_read_file()](/sql/relational-databases/system-functions/sys-fn-xe-file-target-read-file-transact-sql) function can cause an out-of-memory error in the `master` database. This might impact login processing and result in an application outage. For the recommended ways to monitor deadlocks, see [Collect deadlock graphs in Azure SQL Database with Extended Events](analyze-prevent-deadlocks.md#collect-deadlock-graphs-in-azure-sql-database-with-extended-events).

azure-sql/managed-instance/automated-backups-change-settings.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
title: Change automated backup settings
33
titleSuffix: Azure SQL Managed Instance
44
description: Change point-in-time restore and backup redundancy options for automatic backups in Azure SQL Managed Instance by using the Azure portal, the Azure CLI, Azure PowerShell, and the REST API.
5-
author: Stralle
6-
ms.author: strrodic
7-
ms.reviewer: wiassaf, mathoma, danil
8-
ms.date: 07/20/2022
5+
author: dinethi
6+
ms.author: dinethi
7+
ms.reviewer: wiassaf, mathoma, strrodic, mlandzic
8+
ms.date: 07/08/2025
99
ms.service: azure-sql-managed-instance
1010
ms.subservice: backup-restore
1111
ms.topic: how-to
@@ -82,6 +82,7 @@ az sql midb short-term-retention-policy set \
8282
--retention-days 1 \
8383
```
8484

85+
For more information, see the [Backup retention Azure CLI command](/cli/azure/sql/midb/short-term-retention-policy).
8586

8687
### [PowerShell](#tab/powershell)
8788

@@ -119,12 +120,14 @@ Get-AzSqlDeletedInstanceDatabaseBackup -ResourceGroupName resourceGroup -Instanc
119120

120121
Zero days of retention would denote that a backup is immediately deleted and no longer kept for a deleted database. After you reduce PITR backup retention for a deleted database, you can no longer increase it.
121122

123+
For more information, see the [Backup retention PowerShell command](/powershell/module/az.sql/set-azsqlinstancedatabasebackupshorttermretentionpolicy).
124+
122125
### [Rest API](#tab/rest-api)
123126

124127
#### Sample request
125128

126129
```http
127-
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup/providers/Microsoft.Sql/servers/testserver/databases/testDatabase/backupShortTermRetentionPolicies/default?api-version=2017-10-01-preview
130+
PUT https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/resourceGroup/providers/Microsoft.Sql/managedInstances/testManagedInstance/databases/testDatabase/backupShortTermRetentionPolicies/default?api-version=2017-10-01-preview
128131
```
129132

130133
#### Request body
@@ -143,16 +146,16 @@ Status code: 200
143146

144147
```json
145148
{
146-
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/servers/testserver/databases/testDatabase/backupShortTermRetentionPolicies/default",
149+
"id": "/subscriptions/00000000-1111-2222-3333-444444444444/providers/Microsoft.Sql/resourceGroups/resourceGroup/managedInstances/testserver/databases/testDatabase/backupShortTermRetentionPolicies/default",
147150
"name": "default",
148-
"type": "Microsoft.Sql/resourceGroups/servers/databases/backupShortTermRetentionPolicies",
151+
"type": "Microsoft.Sql/resourceGroups/managedInstances/databases/backupShortTermRetentionPolicies",
149152
"properties": {
150153
"retentionDays": 28
151154
}
152155
}
153156
```
154157

155-
For more information, see [Backup retention REST API](/rest/api/sql/backup-short-term-retention-policies).
158+
For more information, see the [Backup retention REST API](/rest/api/sql/managed-backup-short-term-retention-policies).
156159

157160
---
158161

azure-sql/managed-instance/doc-changes-updates-known-issues.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ This article lists the currently known issues with [Azure SQL Managed Instance](
2222

2323
| Issue | Date discovered | Status | Date resolved |
2424
| --- | --- | --- | --- |
25+
| [Modifying backup retention period for the free offer](#modifying-backup-retention-period-for-the-free-offer) | June 2025 | Has workaround | |
2526
| [Login to read-secondary failed due to long wait on "HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING"](#login-to-read-secondary-failed-due-to-long-wait-on-hadr_database_wait_for_transition_to_versioning) | April 2025 | Has workaround | |
2627
| [Interim guidance on 2024 time zone updates for Paraguay](#interim-guidance-on-2024-time-zone-updates-for-paraguay) | March 2025 | Has workaround | |
2728
| [Error 8992 when running DBCC CHECKDB on a SQL Server database that originated from SQL Managed Instance](#error-8992-when-running-dbcc-checkdb-on-a-sql-server-database-that-originated-from-sql-managed-instance) | March 2025 | Has workaround | |
@@ -69,6 +70,10 @@ This article lists the currently known issues with [Azure SQL Managed Instance](
6970

7071
## Has workaround
7172

73+
### Modifying backup retention period for the free offer
74+
75+
You can only modify the backup retention policy of your databases in the free SQL managed instance by using [REST API](/rest/api/sql/managed-backup-short-term-retention-policies), [PowerShell](/powershell/module/az.sql/set-azsqlinstancedatabasebackupshorttermretentionpolicy) and [Azure CLI](/cli/azure/sql/midb/short-term-retention-policy) commands. It's not possible to modify the backup retention policy through the [Azure portal](https://portal.azure.com).
76+
7277
### Login to read-secondary failed due to long wait on "HADR_DATABASE_WAIT_FOR_TRANSITION_TO_VERSIONING"
7378

7479
You might see this error as an exception for the **Microsoft OLE DB Driver 19 for SQL Server** driver when you try to connect to a read-only secondary replica of a [failover group](failover-group-sql-mi.md), or a database replicated through the [Managed Instance link](managed-instance-link-feature-overview.md).

0 commit comments

Comments
 (0)