Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Support Emulators such as Azurite and Azure Storage Explorer #9729

Open
jongio opened this issue Jan 31, 2020 · 2 comments
Open

[Feature] Support Emulators such as Azurite and Azure Storage Explorer #9729

jongio opened this issue Jan 31, 2020 · 2 comments

Comments

@jongio
Copy link
Member

@jongio jongio commented Jan 31, 2020

Goal:

Be able to use DefaultAzureCredential with Azurite and/or Storage Explorer

Blocking Issues:

1. HTTPS

Storage emulator and Azurite only support HTTP: https://docs.microsoft.com/en-us/azure/storage/common/storage-use-emulator#authorize-with-shared-key-credentials. TokenCredential does not allow HTTP calls, HTTPS only.

Therefore, an instantiation like this:

var client = new BlobContainerClient("http://127.0.0.1:10000/devstoreaccount1/{container}", new DefaultAzureCredential());

Will fail with this error message:

Azure.Storage.Blobs: Cannot use TokenCredential without HTTPS.

The current workaround looks like this: Use a different Client overload if you want to use emulator:

var client = emulator ? 
   new BlobContainerClient(store, container) : 
   new BlobContainerClient(uri, new DefaultAzureCredential());

Related Azurite Issue: Azure/Azurite#38

2. TokenCredential

Azurite and Storage Explorer do not support Bearer token based credentials. So you will get this exception if you try to call with DefaultAzureCredential

[2/4/2020 12:42:47 AM] System.Private.CoreLib: Exception while executing function: func1. Azure.Storage.Blobs: Server failed to authenticate the request. Make sure the value of the Authorization header is formed correctly including the signature.

Related Azurite Issue: Azure/Azurite#389

Although there is no work for the Azure SDK team with this feature, I recommend that we keep this issue open to track the workitems on Azurite.

@triage-new-issues triage-new-issues bot added the triage label Jan 31, 2020
@jsquire jsquire added Client Storage and removed triage labels Jan 31, 2020
@jsquire

This comment has been minimized.

Copy link
Member

@jsquire jsquire commented Jan 31, 2020

//cc: @tg-msft

@jongio jongio changed the title [BUG] Support Storage Emulator with TokenCredential [Feature] Allow HTTPS check bypass with TokenCredential Jan 31, 2020
@tg-msft tg-msft added Azure.Identity and removed Storage labels Jan 31, 2020
@tg-msft

This comment has been minimized.

Copy link
Member

@tg-msft tg-msft commented Jan 31, 2020

//cc @schaabs

@jongio jongio changed the title [Feature] Allow HTTPS check bypass with TokenCredential [Feature] Support Emulators such as Azurite and Azure Storage Explorer Feb 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.