Last active
March 29, 2023 06:40
-
-
Save StigHaraldGustavsen/ebaeb85fc04201ba97210ff4b1ea3c9d to your computer and use it in GitHub Desktop.
Access Open Industrial Data Project through AAD.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# first !pip install cognite-sdk | |
from cognite.client import CogniteClient, ClientConfig | |
from cognite.client.credentials import OAuthInteractive | |
# This value will depend on the cluster your CDF project runs on | |
base_url = 'https://api.cognitedata.com' | |
tenant_id = '48d5043c-cf70-4c49-881c-c638f5796997' | |
creds = OAuthInteractive( | |
authority_url=f"https://login.microsoftonline.com/{tenant_id}", | |
client_id="1b90ede3-271e-401b-81a0-a4d52bea3273", | |
scopes=[f"{base_url}/.default"] | |
) | |
cnf = ClientConfig( | |
client_name='publicdata_user', | |
project='publicdata', | |
credentials=creds, | |
base_url=base_url | |
) | |
client = CogniteClient(cnf) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment