From af3a900b4db6d8da3ff8f0c9ce2d20ef8ee3392f Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Wed, 24 Jul 2024 15:40:51 +0000 Subject: [PATCH 1/2] (tests) - Try azure AD auth directly. --- litellm/tests/test_secret_manager.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/litellm/tests/test_secret_manager.py b/litellm/tests/test_secret_manager.py index d18d0ea63..e7290a77d 100644 --- a/litellm/tests/test_secret_manager.py +++ b/litellm/tests/test_secret_manager.py @@ -12,6 +12,7 @@ sys.path.insert( import pytest from litellm import get_secret from litellm.proxy.secret_managers.aws_secret_manager import load_aws_secret_manager +from litellm.llms.azure import get_azure_ad_token_from_oidc @pytest.mark.skip(reason="AWS Suspended Account") @@ -76,3 +77,16 @@ def test_oidc_circleci_v2(): ) print(f"secret_val: {redact_oidc_signature(secret_val)}") + + +@pytest.mark.skipif( + os.environ.get("CIRCLE_OIDC_TOKEN") is None, + reason="Cannot run without being in CircleCI Runner", +) +def test_oidc_circleci_with_azure(): + # TODO: Switch to our own Azure account, currently using ai.moda's account + os.environ["AZURE_TENANT_ID"] = "17c0a27a-1246-4aa1-a3b6-d294e80e783c" + os.environ["AZURE_CLIENT_ID"] = "4faf5422-b2bd-45e8-a6d7-46543a38acd0" + azure_ad_token = get_azure_ad_token_from_oidc("oidc/circleci/") + + print(f"secret_val: {redact_oidc_signature(azure_ad_token)}") From 4b89397136db8ceee828bbff433211f6e5cadca3 Mon Sep 17 00:00:00 2001 From: David Manouchehri Date: Wed, 24 Jul 2024 15:42:57 +0000 Subject: [PATCH 2/2] (tests) - Skip embedding Azure AD test for now. --- litellm/tests/test_embedding.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/litellm/tests/test_embedding.py b/litellm/tests/test_embedding.py index a5a2adb75..fb707ad5e 100644 --- a/litellm/tests/test_embedding.py +++ b/litellm/tests/test_embedding.py @@ -197,10 +197,11 @@ def test_openai_azure_embedding(): pytest.fail(f"Error occurred: {e}") -@pytest.mark.skipif( - os.environ.get("CIRCLE_OIDC_TOKEN") is None, - reason="Cannot run without being in CircleCI Runner", -) +# @pytest.mark.skipif( +# os.environ.get("CIRCLE_OIDC_TOKEN") is None, +# reason="Cannot run without being in CircleCI Runner", +# ) +@pytest.mark.skip(reason="Temporarily skipping this test.") def test_openai_azure_embedding_with_oidc_and_cf(): # TODO: Switch to our own Azure account, currently using ai.moda's account os.environ["AZURE_TENANT_ID"] = "17c0a27a-1246-4aa1-a3b6-d294e80e783c"