Skip to content

Commit 1235afb

Browse files
Learn Build Service GitHub AppLearn Build Service GitHub App
authored andcommitted
Merging changes synced from https://github.com/MicrosoftDocs/dataexplorer-docs-pr (branch live)
2 parents 2d605b7 + 650fae4 commit 1235afb

File tree

2 files changed

+47
-26
lines changed

2 files changed

+47
-26
lines changed

data-explorer/kusto/api/connection-strings/kusto.md

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Kusto connection strings
33
description: This article describes Kusto connection strings.
44
ms.reviewer: ygilad
55
ms.topic: reference
6-
ms.date: 11/23/2025
6+
ms.date: 11/25/2025
77
ms.custom: sfi-ropc-nochange
88
---
99
# Kusto connection strings
@@ -146,6 +146,9 @@ The following examples show how to set up connections using C#. For examples in
146146
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID for federated authentication. The user is prompted for credentials, when necessary.
147147

148148
```csharp
149+
using Kusto.Data;
150+
151+
149152
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
150153
var authority = "contoso.com"; // Or the AAD tenant GUID
151154
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
@@ -158,6 +161,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
158161
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID for federated authentication and prefills the user's identity using the `userID` variable. The user is prompted for credentials, when necessary.
159162

160163
```csharp
164+
using Kusto.Data;
165+
161166
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
162167
var authority = "contoso.com"; // Or the AAD tenant GUID
163168
var userId = "[email protected]";
@@ -171,6 +176,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
171176
The following example shows how to authenticate to a Kusto service using Microsoft Entra ID for federated authentication with an application client ID and key.
172177

173178
```csharp
179+
using Kusto.Data;
180+
174181
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
175182
var appId = "<appId>";
176183
var appKey = "<appKey>";
@@ -185,6 +192,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
185192
The following example shows how to authenticate to a Kusto service using a system-assigned Managed Identity for authentication.
186193

187194
```csharp
195+
using Kusto.Data;
196+
188197
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
189198
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
190199
.WithAadSystemManagedIdentity();
@@ -195,6 +204,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
195204
The following example shows how to authenticate to a Kusto service using a user-assigned Managed Identity for authentication.
196205

197206
```csharp
207+
using Kusto.Data;
208+
198209
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
199210
var managedIdentityClientId = "<managedIdentityClientId>";
200211
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
@@ -206,6 +217,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
206217
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID with either a user access token or an application access token.
207218

208219
```csharp
220+
using Kusto.Data;
221+
209222
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
210223
var userAccessToken = "<userAccessToken>";
211224
var appAccessToken = "<appAccessToken>";
@@ -226,6 +239,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
226239
The following example shows how to authenticate to a Kusto service using Microsoft Entra ID with a custom token provider callback. The token is invoked each time a token is required.
227240

228241
```csharp
242+
using Kusto.Data;
243+
229244
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
230245
Func<string> tokenProviderCallback; // User-defined method to retrieve the access token
231246
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
@@ -237,6 +252,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
237252
The following example shows how to authenticate to a Kusto service using Microsoft Entra ID for federated authentication with an application certificate.
238253

239254
```csharp
255+
using Kusto.Data;
256+
240257
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
241258
var appId = "<appId>";
242259
X509Certificate2 appCert;
@@ -251,6 +268,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
251268
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID with an application certificate thumbprint. The client attempts to load the certificate from a local store.
252269

253270
```csharp
271+
using Kusto.Data;
272+
254273
var kustoUri = "https://<clusterName>.<region>.kusto.windows.net";
255274
var appId = "<appId>";
256275
var appCert = "<appCert>";
@@ -259,6 +278,7 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
259278
.WithAadApplicationThumbprintAuthentication(appId, appCert, authority);
260279
// Equivalent Kusto connection string: $"Data Source={kustoUri};Database=NetDefaultDB;Fed=True;AppClientId={appId};AppCert={appCert};Authority Id={authority}"
261280
```
281+
262282
::: moniker-end
263283
:::moniker range="microsoft-fabric"
264284

@@ -267,6 +287,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
267287
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID for federated authentication. The user is prompted for credentials, when necessary.
268288

269289
```csharp
290+
using Kusto.Data;
291+
270292
var kustoUri = "serviceURI";
271293
var authority = "contoso.com"; // Or the AAD tenant GUID
272294
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
@@ -279,6 +301,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
279301
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID for federated authentication and prefills the user's identity using the `userID` variable. The user is prompted for credentials, when necessary.
280302

281303
```csharp
304+
using Kusto.Data;
305+
282306
var kustoUri = "serviceURI";
283307
var authority = "contoso.com"; // Or the AAD tenant GUID
284308
var userId = "[email protected]";
@@ -292,6 +316,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
292316
The following example shows how to authenticate to a Kusto service using Microsoft Entra ID for federated authentication with an application client ID and key.
293317

294318
```csharp
319+
using Kusto.Data;
320+
295321
var kustoUri = "serviceURI";
296322
var appId = "<appId>";
297323
var appKey = "<appKey>";
@@ -306,6 +332,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
306332
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID with either a user access token or an application access token.
307333

308334
```csharp
335+
using Kusto.Data;
336+
309337
var kustoUri = "serviceURI";
310338
var userAccessToken = "<userAccessToken>";
311339
var appAccessToken = "<appAccessToken>";
@@ -326,6 +354,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
326354
The following example shows how to authenticate to a Kusto service using Microsoft Entra ID with a custom token provider callback. The token is invoked each time a token is required.
327355

328356
```csharp
357+
using Kusto.Data;
358+
329359
var kustoUri = "serviceURI";
330360
Func<string> tokenProviderCallback; // User-defined method to retrieve the access token
331361
var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
@@ -337,6 +367,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
337367
The following example shows how to authenticate to a Kusto service using Microsoft Entra ID for federated authentication with an application certificate.
338368

339369
```csharp
370+
using Kusto.Data;
371+
340372
var kustoUri = "serviceURI";
341373
var appId = "<appId>";
342374
X509Certificate2 appCert;
@@ -351,6 +383,8 @@ var kustoConnectionStringBuilder = new KustoConnectionStringBuilder(kustoUri)
351383
The following example shows how to set up a connection to a Kusto service using Microsoft Entra ID with an application certificate thumbprint. The client attempts to load the certificate from a local store.
352384

353385
```csharp
386+
using Kusto.Data;
387+
354388
var kustoUri = "serviceURI";
355389
var appId = "<appId>";
356390
var appCert = "<appCert>";

data-explorer/kusto/api/get-started/app-client-network-restrictions.md

Lines changed: 12 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -98,23 +98,10 @@ import (
9898
"github.com/Azure/azure-kusto-go/azkustodata/trustedEndpoints"
9999
)
100100

101-
// Add a DNS domain
102-
trustedEndpoints.Instance.AddTrustedHosts([]trustedEndpoints.MatchRule{
103-
security.NewMatchRule(".domain.com", false),
104-
})
105-
106-
// Add a fully qualified domain name
107-
trustedEndpoints.Instance.AddTrustedHosts([]trustedEndpoints.MatchRule{
108-
security.NewMatchRule("mykusto.domain.com", true),
109-
})
110-
111-
// Set a custom validation policy
112-
trustedEndpoints.Instance.SetOverrideMatcher(
113-
func(h string) bool {
114-
return true
115-
},
116-
security.KustoTrustedEndpoints.KustoEndpointContext,
117-
)
101+
// Due to an issue in Go SDK, the only available bypass option in old versions is to provide a custom policy
102+
// For simplicity, the suggestion is to blank allow requests, until an SDK upgrade is possible
103+
// This doc will be updated when a fixed version is available
104+
trustedEndpoints.Instance.SetOverridePolicy( func(s string) bool { return true} )
118105

119106
```
120107

@@ -144,16 +131,16 @@ KustoTrustedEndpoints.setOverridePolicy(
144131

145132
```javascript
146133

147-
import { KustoTrustedEndpoints, MatchRule } from "azure.kusto.data";
134+
import { kustoTrustedEndpoints, MatchRule } from "azure.kusto.data";
148135

149136
// Add a DNS domain
150-
KustoTrustedEndpoints.addTrustedHosts([new MatchRule(".domain.com", false)]);
137+
kustoTrustedEndpoints.addTrustedHosts([new MatchRule(".domain.com", false)]);
151138

152139
// Add a fully qualified domain name
153-
KustoTrustedEndpoints.addTrustedHosts([new MatchRule("mykusto.domain.com", true)]);
140+
kustoTrustedEndpoints.addTrustedHosts([new MatchRule("mykusto.domain.com", true)]);
154141

155142
// Set a custom validation policy
156-
KustoTrustedEndpoints.setOverrideMatcher(
143+
kustoTrustedEndpoints.setOverrideMatcher(
157144
(h) => true,
158145
KustoTrustedEndpoints.KustoEndpointContext
159146
);
@@ -164,16 +151,16 @@ KustoTrustedEndpoints.setOverrideMatcher(
164151

165152
```python
166153

167-
from azure.kusto.data.security import KustoTrustedEndpoints, MatchRule
154+
from azure.kusto.data.security import well_known_kusto_endpoints, MatchRule
168155

169156
# Add a DNS domain
170-
KustoTrustedEndpoints.add_trusted_hosts([MatchRule(".domain.com", exact=False)])
157+
well_known_kusto_endpoints.add_trusted_hosts([MatchRule(".domain.com", exact=False)])
171158

172159
# Add a fully qualified domain name
173-
KustoTrustedEndpoints.add_trusted_hosts([MatchRule("mykusto.domain.com", exact=True)])
160+
well_known_kusto_endpoints.add_trusted_hosts([MatchRule("mykusto.domain.com", exact=True)])
174161

175162
# Set a custom validation policy
176-
KustoTrustedEndpoints.set_override_matcher(
163+
well_known_kusto_endpoints.set_override_matcher(
177164
lambda h: True,
178165
KustoTrustedEndpoints.KustoEndpointContext)
179166

0 commit comments

Comments
 (0)