[BUG]AZURE_USERNAME is case sensitive for use with DefaultAzureCredential(). #10816
Labels
Azure.Identity
bug
This issue requires a change to an existing behavior in the product in order to be resolved.
Client
This issue points to a problem in the data-plane of the library.
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
Milestone
Describe the bug
AZURE_USERNAME is case sensitive for use with DefaultAzureCredential(). If the case of this environment variable differs to the actual visual studio account case (when there are multiple accounts), then the request to upload a blob using this credential fails. Possibly related to #10543?
Expected behavior
I have several Azure accounts in my Visual Studio. One of them is [email protected].
When I Enter [email protected] into a NetCore 3.1 app as a debug environment variable AZURE_USERNAME, I am correctly authenticated against an authorized Azure Blob when using BlobClient.UploadAsync().
Actual behavior (include Exception or Stack Trace)
If my Visual Studio account was registered as [email protected], when the AZURE_USERNAME is [email protected] then the request fails with
To Reproduce
Steps to reproduce the behavior (include a code snippet, screenshot, or any additional information that might help us reproduce the issue)
These specific steps are untested but represent exactly the changes that causes the failure in my app. the steps mimic those that I did (simply changing the case of the username).
Environment:
Azure.Storage.Blobs 12.3.0
Azure.Identity 1.1.1
NetStandard 2.1 library
Netcore 3.1 console app running webjob.
VS 16.5
.NET Core SDK (reflecting any global.json):
Version: 3.1.200
Commit: c5123d973b
Runtime Environment:
OS Name: Windows
OS Version: 10.0.18363
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\3.1.200\
Host (useful for support):
Version: 3.1.2
Commit: 916b5cba26
.NET Core SDKs installed:
2.1.802 [C:\Program Files\dotnet\sdk]
3.1.100 [C:\Program Files\dotnet\sdk]
3.1.200 [C:\Program Files\dotnet\sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.All 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 2.1.16 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 3.1.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 3.1.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
The text was updated successfully, but these errors were encountered: