You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sdk/tables/Azure.Data.Tables/CHANGELOG.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
### Features Added
6
6
7
+
- Support for Azure Active Directory (AAD) authorization has been added to `TableServiceClient` and `TableClient`. This enables use of `TokenCredential` credentials. Note: Only Azure Storage API endpoints currently support AAD authorization.
Learn more about options for authentication _(including Connection Strings, Shared Key, and Shared Key Signatures)_[in our samples.](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/tables/Azure.Data.Tables/samples/Sample0Auth.md)
54
+
Learn more about options for authentication _(including Connection Strings, Shared Key, Shared Key Signatures, and TokenCredentials)_[in our samples.](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/tables/Azure.Data.Tables/samples/Sample0Auth.md)
Azure Tables provides integration with Azure Active Directory (Azure AD) for identity-based authentication of requests
107
+
to the Table service when targeting a Storage endpoint. With Azure AD, you can use role-based access control (RBAC) to
108
+
grant access to your Azure Table resources to users, groups, or applications.
109
+
110
+
To access a table resource with a `TokenCredential`, the authenticated identity should have either the "Storage Table Data Contributor" or "Storage Table Data Reader" role.
111
+
112
+
With the `Azure.Identity` package, you can seamlessly authorize requests in both development and production environments.
113
+
To learn more about Azure AD integration in Azure Storage, see the [Azure.Identity README](https://github.com/Azure/azure-sdk-for-net/blob/master/sdk/identity/Azure.Identity/README.md)
114
+
115
+
```C# Snippet:TablesAuthTokenCredential
116
+
// Construct a new TableClient using a TokenCredential.
117
+
varclient=newTableClient(
118
+
newUri(storageUri),
119
+
tableName,
120
+
newDefaultAzureCredential());
121
+
122
+
// Create the table if it doesn't already exist to verify we've successfully authenticated.
@@ -212,6 +219,52 @@ public TableClient(string connectionString, string tableName, TableClientOptions
212
219
Name=tableName;
213
220
}
214
221
222
+
/// <summary>
223
+
/// Initializes a new instance of the <see cref="TableClient"/> using the specified <see cref="Uri" /> and <see cref="TokenCredential"/>.
224
+
/// </summary>
225
+
/// <param name="endpoint">
226
+
/// A <see cref="Uri"/> referencing the table service account.
227
+
/// This is likely to be similar to "https://{account_name}.table.core.windows.net/{table_name}"
228
+
/// or "https://{account_name}.table.cosmos.azure.com/{table_name}".
229
+
/// </param>
230
+
/// <param name="tableName">The name of the table with which this client instance will interact.</param>
231
+
/// <param name="tokenCredential">The <see cref="TokenCredential"/> used to authorize requests.</param>
232
+
/// <param name="options">
233
+
/// Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.
234
+
/// </param>
235
+
/// <exception cref="ArgumentException"><paramref name="endpoint"/> does not start with 'https'. or <paramref name="tableName"/> is an empty string.</exception>
236
+
/// <exception cref="ArgumentNullException"><paramref name="tableName"/>, <paramref name="endpoint"/>, or <paramref name="tokenCredential"/> is null.</exception>
0 commit comments