Skip to content

Commit

Permalink
default creds
Browse files Browse the repository at this point in the history
  • Loading branch information
jakevc committed Jul 12, 2024
1 parent fd4c98f commit f433bde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
"source.organizeImports": "explicit"
}
},
}
4 changes: 3 additions & 1 deletion snakemake_storage_plugin_azure/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

from azure.core.credentials import AzureSasCredential
from azure.core.exceptions import HttpResponseError
from azure.identity import DefaultAzureCredential
from azure.storage.blob import BlobClient, BlobServiceClient, ContainerClient
from snakemake_interface_storage_plugins.common import Operation
from snakemake_interface_storage_plugins.io import IOCacheStorageInterface, Mtime
Expand Down Expand Up @@ -138,11 +139,12 @@ def __post_init__(self):

self.set_storage_account_name()

self.credential = None
if self.access_key:
self.credential = self.access_key
elif self.sas_token:
self.credential = AzureSasCredential(self.sas_token)
else:
self.credential = DefaultAzureCredential()


# Required:
Expand Down

0 comments on commit f433bde

Please sign in to comment.