Azure / Azure/azure-functions-dotnet-worker

BlobTrigger with BlockBlobClient with managed identity connection string returns wrong URI in China

Open
#2,965 1 comment 0 reactions 0 assignees View on GitHub
extensions: storage-blobs feature: sdk-bindings needs-investigation potential-bug
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

### Description

I have a function like this:
```c#
[Function("Foo")]
public async Task Run(
[BlobTrigger("foo", Connection = "Foo")]
BlockBlobClient blobClient,
Uri uri
)
```

the connection is defined using the [managed identity syntax](https://learn.microsoft.com/en-us/azure/azure-functions/functions-reference?tabs=blob&pivots=programming-language-csharp#connecting-to-host-storage-with-an-identity), ie
```
"Foo__blobServiceUri": "https://foo.blob.core.chinacloudapi.cn"
```

In China, `blobClient` has a URI of `https://foo.blob.core.windows.net` - it should be `https://foo.blob.core.chinacloudapi.cn`.

I also added the `Uri` binding because that has the correct URI, so I can create my own `BlockBlobClient` from `uri` as a workaround.

### Steps to reproduce

As described above

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the BlobTrigger with a BlockBlobClient and the managed identity setting Foo__blobServiceUri in the issue. Compare the injected BlockBlobClient URI with the Uri binding in the China cloud environment; done means the client URI uses the configured chinacloudapi.cn endpoint rather than windows.net.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
backend, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.