| 1 |
# -*- coding: utf-8 -*- |
| 2 |
# coding=utf-8 |
| 3 |
# -------------------------------------------------------------------------- |
| 4 |
# Copyright (c) Microsoft Corporation. All rights reserved. |
| 5 |
# Licensed under the MIT License. See License.txt in the project root for |
| 6 |
# license information. |
| 7 |
# -------------------------------------------------------------------------- |
| 8 |
|
| 9 |
import os |
| 10 |
from azure.identity import DefaultAzureCredential |
| 11 |
from tests import fake_settings |
| 12 |
STORE_NAME = os.environ['azure_data_lake_store_name'] |
| 13 |
TENANT_ID = fake_settings.TENANT_ID |
| 14 |
SUBSCRIPTION_ID = fake_settings.SUBSCRIPTION_ID |
| 15 |
RESOURCE_GROUP_NAME = fake_settings.RESOURCE_GROUP_NAME |
| 16 |
RECORD_MODE = os.environ.get('RECORD_MODE', 'all').lower() |
| 17 |
AZURE_ACL_TEST_APPID = os.environ.get('AZURE_ACL_TEST_APPID') |
| 18 |
CLIENT_ID = os.environ['azure_service_principal'] |
| 19 |
ROOT_DIR = os.environ.get('ROOT_DIR', 'azure_python_sdk_test_dir') |
| 20 |
|
| 21 |
if RECORD_MODE == 'none': |
| 22 |
STORE_NAME = fake_settings.STORE_NAME |
| 23 |
TENANT_ID = fake_settings.TENANT_ID |
| 24 |
TOKEN_CREDEDENTIAL = DefaultAzureCredential(exclude_shared_token_cache_credential=True) |
| 25 |
SUBSCRIPTION_ID = fake_settings.SUBSCRIPTION_ID |
| 26 |
RESOURCE_GROUP_NAME = fake_settings.RESOURCE_GROUP_NAME |
| 27 |
else: |
| 28 |
STORE_NAME = os.environ['azure_data_lake_store_name'] |
| 29 |
TENANT_ID = os.environ.get('azure_tenant_id', 'common') |
| 30 |
TOKEN_CREDEDENTIAL = DefaultAzureCredential(exclude_shared_token_cache_credential=True) |
| 31 |
# set the environment variable to empty to avoid confusion in auth |
| 32 |
SUBSCRIPTION_ID = os.environ['azure_subscription_id'] |
| 33 |
RESOURCE_GROUP_NAME = os.environ['azure_resource_group_name'] |