Skip to content

Comments

pull AZURE_STORAGE_ACCESS_KEY from env if not provided as arg to AzureSession#2637

Merged
snowman2 merged 1 commit intorasterio:mainfrom
hrodmn:azure-storage-access-key
Nov 10, 2022
Merged

pull AZURE_STORAGE_ACCESS_KEY from env if not provided as arg to AzureSession#2637
snowman2 merged 1 commit intorasterio:mainfrom
hrodmn:azure-storage-access-key

Conversation

@hrodmn
Copy link
Contributor

@hrodmn hrodmn commented Nov 8, 2022

I believe adding AZURE_STORAGE_ACCESS_KEY to the credentials in an AzureSession follows the authentication logic: use AZURE_CONNECTION_STRING if available, use AZURE_STORAGE_ACCOUNT and AZURE_STORAGE_ACCESS_KEY unless AZURE_NO_SIGN_REQUEST is set in which case we only need AZURE_STORAGE_ACCOUTN. I assume that we get away without passing any secrets for S3 authentication because boto handles it.

resolves #2636

@snowman2 snowman2 added this to the 1.3.4 milestone Nov 8, 2022
Copy link
Member

@snowman2 snowman2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hrodmn 👍

@snowman2 snowman2 added the bug label Nov 8, 2022
@hrodmn
Copy link
Contributor Author

hrodmn commented Nov 8, 2022

@snowman2 thanks for shepherding the PR through the CI git installation snarl! I have PRs open in another repo that are held up by intermittent problems with the git ppa.

Copy link
Member

@sgillies sgillies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hrodmn

@snowman2 snowman2 merged commit d270bde into rasterio:main Nov 10, 2022
snowman2 pushed a commit to snowman2/rasterio that referenced this pull request Nov 10, 2022
snowman2 added a commit that referenced this pull request Nov 10, 2022
@hrodmn hrodmn deleted the azure-storage-access-key branch November 10, 2022 17:53
@drwelby
Copy link

drwelby commented Nov 23, 2022

Would it be possible to also check the env for a AZURE_STORAGE_CONNECTION_STRING and use that in a similar matter?

@hrodmn
Copy link
Contributor Author

hrodmn commented Dec 2, 2022

Would it be possible to also check the env for a AZURE_STORAGE_CONNECTION_STRING and use that in a similar matter?

Yes I think we could make a similar change to unblock AZURE_STORAGE_CONNECTION_STRING but it did not occur to me when I opened the pull request.

@drwelby
Copy link

drwelby commented Dec 2, 2022

I'm not sure how, but I was able to get AZURE_STORAGE_CONNECTION_STRING working once I had a valid connection string.

It's used prior to rasterio by adlfs in my application so maybe that's adding in some things to os.environ on my behalf. I couldn't find any reference to it in rasterio, but maybe I missed it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unable to read private key from azure with az://{container}/{key} but /vsiaz/{container}/{key} works

5 participants