Skip to content

Commit c652a33

Browse files
20251118 function permissions in Fabric
1 parent 2728388 commit c652a33

2 files changed

Lines changed: 56 additions & 5 deletions

File tree

docs/relational-databases/system-functions/sys-fn-get-audit-file-transact-sql.md

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "The sys.fn_get_audit_file system function returns information from
44
author: sravanisaluru
55
ms.author: srsaluru
66
ms.reviewer: wiassaf, randolphwest
7-
ms.date: 10/27/2025
7+
ms.date: 11/17/2025
88
ms.service: sql
99
ms.subservice: system-objects
1010
ms.topic: "reference"
@@ -20,18 +20,30 @@ helpviewer_keywords:
2020
- "fn_get_audit_file function"
2121
dev_langs:
2222
- "TSQL"
23-
monikerRange: "=azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =azure-sqldw-latest || =fabric-sqldb"
23+
monikerRange: "=azuresqldb-current || >=sql-server-2016 || >=sql-server-linux-2017 || =azuresqldb-mi-current || =azure-sqldw-latest || =fabric ||=fabric-sqldb"
2424
---
2525
# sys.fn_get_audit_file (Transact-SQL)
2626

2727
[!INCLUDE [sql-asdb-asdbmi-asa-fabricsqldb](../../includes/applies-to-version/sql-asdb-asdbmi-asa-fabricsqldb.md)]
2828

2929
Returns information from an audit file created by a server audit in [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. For more information, see [SQL Server Audit (Database Engine)](../security/auditing/sql-server-audit-database-engine.md).
3030

31-
::: moniker range="=azuresqldb-current || =fabric || = fabric-sqldb"
31+
::: moniker range="=azuresqldb-current"
3232

33-
> [!NOTE]
34-
> Consider using [sys.fn_get_audit_file_v2](sys-fn-get-audit-file-v2-transact-sql.md) instead. `sys.fn_get_audit_file_v2` introduces time-based filtering at both the file and record levels, providing significant performance improvements, particularly for queries targeting specific time ranges.
33+
> [!TIP]
34+
> Consider using [sys.fn_get_audit_file_v2](sys-fn-get-audit-file-v2-transact-sql.md) instead. The `sys.fn_get_audit_file_v2` function introduces time-based filtering at both the file and record levels, providing significant performance improvements, particularly for queries targeting specific time ranges.
35+
36+
::: moniker-end
37+
::: moniker range="=fabric"
38+
39+
> [!TIP]
40+
> For Fabric Data Warehouse, `sys.fn_get_audit_file` is supported but [sys.fn_get_audit_file_v2 (Transact-SQL)](sys-fn-get-audit-file-v2-transact-sql.md) is recommended. The `sys.fn_get_audit_file_v2` function introduces time-based filtering at both the file and record levels, providing significant performance improvements, particularly for queries targeting specific time ranges. For more information and examples, see [Configure Auditing in Fabric Data Warehouse](/fabric/data-warehouse/configure-sql-audit-logs).
41+
42+
::: moniker-end
43+
::: moniker range="= fabric-sqldb"
44+
45+
> [!TIP]
46+
> For SQL database in Fabric, `sys.fn_get_audit_file` is supported but [sys.fn_get_audit_file_v2 (Transact-SQL)](sys-fn-get-audit-file-v2-transact-sql.md) is recommended. The `sys.fn_get_audit_file_v2` function introduces time-based filtering at both the file and record levels, providing significant performance improvements, particularly for queries targeting specific time ranges. For more information and examples, see [Configure Auditing in Fabric SQL database](/fabric/database/sql/auditing).
3547
3648
::: moniker-end
3749

@@ -71,6 +83,12 @@ This argument is used to specify a blob URL (including the storage endpoint and
7183

7284
- `<Storage_endpoint>/<Container>/<ServerName>/<DatabaseName>/<AuditName>/<CreationDate>/<FileName>.xel` - collects a specific audit file (blob).
7385

86+
## [Fabric](#tab/fabric)
87+
88+
This argument is used to specify a blob URL (including the storage endpoint and container in Fabric OneLake). While it doesn't support an asterisk wildcard, you can use a partial file (blob) name prefix (instead of the full blob name) to collect multiple files (blobs) that begin with this prefix. For example:
89+
90+
- `https://onelake.blob.fabric.microsoft.com/<fabric workspace id>/<item id>/Audit/sqldbauditlogs/`
91+
7492
---
7593

7694
#### *initial_file_name*
@@ -165,6 +183,21 @@ Requires the `CONTROL DATABASE` permission.
165183

166184
- Blobs that don't meet the above criteria are skipped (a list of skipped blobs is displayed in the query output message). The function returns logs only from blobs for which access is allowed.
167185

186+
## [Fabric](#tab/fabric)
187+
188+
### Permissions required in Fabric SQL database
189+
190+
To manage auditing using Fabric workspace roles, users must have membership in the Fabric workspace **Contributor** role or higher permissions.
191+
To manage auditing with SQL permissions:
192+
- To configure the database audit, users must have ALTER ANY DATABASE AUDIT permission.
193+
- To view audit logs using T-SQL, users must have the VIEW DATABASE SECURITY AUDIT permission.
194+
195+
For more information, see [Auditing in Fabric SQL database](/fabric/database/sql/auditing).
196+
197+
### Permissions required in Fabric Data Warehouse
198+
199+
Users must have the Fabric item `Audit` permission. For more information, see [Permissions](/fabric/data-warehouse/sql-audit-logs#permissions).
200+
168201
---
169202

170203
## Examples
@@ -215,6 +248,15 @@ GO
215248

216249
For information on setting up Azure SQL Database auditing, see [Get Started with SQL Database auditing](/azure/sql-database/sql-database-auditing).
217250

251+
## [Fabric](#tab/fabric)
252+
253+
For Fabric Data Warehouse and SQL database in Fabric, `sys.fn_get_audit_file` is supported but [sys.fn_get_audit_file_v2 (Transact-SQL)](sys-fn-get-audit-file-v2-transact-sql.md) is recommended.
254+
255+
For more information and examples, see:
256+
257+
- [Configure Auditing in Fabric SQL database](/fabric/database/sql/auditing)
258+
- [Configure Auditing in Fabric Data Warehouse](/fabric/data-warehouse/configure-sql-audit-logs)
259+
218260
---
219261

220262
## Limitations

docs/relational-databases/system-functions/sys-fn-get-audit-file-v2-transact-sql.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,15 @@ Requires the `CONTROL DATABASE` permission.
180180

181181
- Blobs that don't meet the above criteria are skipped (a list of skipped blobs is displayed in the query output message). The function returns logs only from blobs for which access is allowed.
182182

183+
### Permissions required in Fabric SQL database
184+
185+
To manage auditing using Fabric workspace roles, users must have membership in the Fabric workspace **Contributor** role or higher permissions.
186+
To manage auditing with SQL permissions:
187+
- To configure the database audit, users must have ALTER ANY DATABASE AUDIT permission.
188+
- To view audit logs using T-SQL, users must have the VIEW DATABASE SECURITY AUDIT permission.
189+
190+
For more information, see [Auditing in Fabric SQL database](/fabric/database/sql/auditing).
191+
183192
### Permissions required in Fabric Data Warehouse
184193

185194
Users must have the Fabric item `Audit` permission. For more information, see [Permissions](/fabric/data-warehouse/sql-audit-logs#permissions).

0 commit comments

Comments
 (0)