Skip to content

Commit 9ae10f6

Browse files
authored
Update EnvironmentVariableLoader for new auth options (#35695)
1 parent 0c48307 commit 9ae10f6

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

tools/azure-sdk-tools/devtools_testutils/envvariable_loader.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,19 @@ def _set_mgmt_settings_real_values(self):
6262

6363
# If environment variables are not all set, check if user-based authentication is requested
6464
if not all(x is not None for x in [tenant, client, secret]):
65-
use_pwsh = os.environ.get("AZURE_TEST_USE_PWSH_AUTH", "false")
66-
use_cli = os.environ.get("AZURE_TEST_USE_CLI_AUTH", "false")
67-
user_auth = use_pwsh.lower() == "true" or use_cli.lower() == "true"
65+
use_pwsh = os.environ.get("AZURE_TEST_USE_PWSH_AUTH", "false").lower()
66+
use_cli = os.environ.get("AZURE_TEST_USE_CLI_AUTH", "false").lower()
67+
use_vscode = os.environ.get("AZURE_TEST_USE_VSCODE_AUTH", "false").lower()
68+
use_azd = os.environ.get("AZURE_TEST_USE_AZD_AUTH", "false").lower()
69+
user_auth = use_pwsh == "true" or use_cli == "true" or use_vscode == "true" or use_azd == "true"
6870
if not user_auth:
6971
# All variables are required for service principal authentication
70-
raise AzureTestError(
71-
f"Environment variables for service principal credentials are not all set. "
72+
_logger.warn(
73+
"Environment variables for service principal credentials are not all set. "
7274
"Please either set the variables or request user-based authentication by setting "
73-
"'AZURE_TEST_USE_PWSH_AUTH' or 'AZURE_TEST_USE_CLI_AUTH' to 'true'."
75+
"an 'AZURE_TEST_USE_X_AUTH' environment variable to 'true'. See "
76+
"https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/tests.md#configure-test-variables "
77+
"for more information."
7478
)
7579

7680
_logger.debug(

0 commit comments

Comments
 (0)