Azure / Azure/azure-functions-host

Cannot write to $web container using BlobPath dynamic binding - Static website hosting

Open
#3,804 12 comments 2 reactions 0 assignees View on GitHub
enhancement
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 10h
Merged PRs (30d)
36

Description

Azure Functions version: 2.x

Azure Storage now supports hosting static websites in a special Azure container name called **$web**: https://azure.microsoft.com/en-us/blog/azure-storage-static-web-hosting-public-preview/

Up until now, the **$** character was not allowed in container names. However, this preview feature breaks this previous assumption, since their container name has a dollar sign.

When I try to write to this container using dynamic binding, I get an error - I am guessing because of the $ character:
```
Validation failed for property 'BlobPath', value '$web/some-website/index.html'
```

Sample code
```csharp
var blobAttribute = new BlobAttribute(@"$web/some-website/index.html");

using (var writer = await binder.BindAsync(blobAttribute))
{
writer.Write("Hello World");
}
```

Contributor guide

Open the contributing guide

Research direction

Start with the BlobAttribute and Binder.BindAsync reproduction shown in the issue, focusing on validation of the BlobPath value. Run the sample against the $web container and trace where the path is rejected. Done means dynamic binding accepts "$web/some-website/index.html" and writes the file successfully.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.