Skip to content

Commit e32f4b5

Browse files
authored
Merge pull request #89661 from lucygoldbergmicrosoft/add-kusto-examples
add steps about how to create credentials in creating cluster doc
2 parents 72793cd + 6368cbd commit e32f4b5

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

articles/data-explorer/create-cluster-database-python.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ To install the Python package for Azure Data Explorer (Kusto), open a command pr
3131

3232
```
3333
pip install azure-mgmt-kusto
34+
pip install adal
35+
pip install msrestazure
3436
```
3537

3638
## Create the Azure Data Explorer cluster
@@ -40,10 +42,19 @@ pip install azure-mgmt-kusto
4042
```Python
4143
from azure.mgmt.kusto.kusto_management_client import KustoManagementClient
4244
from azure.mgmt.kusto.models import Cluster, AzureSku
45+
from adal import AuthenticationContext
46+
from msrestazure.azure_active_directory import AdalAuthentication
47+
48+
tenant_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
49+
client_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
50+
client_secret = "xxxxxxxxxxxxxx"
51+
subscription_id = "xxxxxxxx-xxxxx-xxxx-xxxx-xxxxxxxxx"
52+
context = AuthenticationContext('https://login.microsoftonline.com/{}'.format(tenant_id))
53+
credentials = AdalAuthentication(context.acquire_token_with_client_credentials,
54+
resource="https://management.core.windows.net/",
55+
client_id=client_id,
56+
client_secret=client_secret)
4357

44-
credentials = xxxxxxxxxxxxxxx
45-
46-
subscription_id = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxx'
4758
location = 'Central US'
4859
sku = 'D13_v2'
4960
capacity = 5

0 commit comments

Comments
 (0)