Skip to content

Commit

Permalink
add default credential test
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbull committed Oct 12, 2024
1 parent a412846 commit 88551c1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_azure_specific.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os

from azure.core.credentials import AzureNamedKeyCredential
from azure.identity import DefaultAzureCredential
from azure.storage.blob import (
BlobServiceClient,
StorageStreamDownloader,
Expand Down Expand Up @@ -134,6 +135,12 @@ def _check_access(az_client, gen2=False):
)
_check_access(cl, gen2=azure_rigs.is_adls_gen2)

# discover and use credentials for service principal by having set:
# AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID
credential = DefaultAzureCredential()
cl = azure_rigs.client_class(credential=credential, account_url=bsc.url)
_check_access(cl, gen2=azure_rigs.is_adls_gen2)


def test_adls_gen2_mkdir(azure_gen2_rig):
"""Since directories can be created on gen2, we should test mkdir, rmdir, rmtree, and unlink
Expand Down

0 comments on commit 88551c1

Please sign in to comment.