Azure / Azure/azure-functions-host
Cannot write to $web container using BlobPath dynamic binding - Static website hosting
- 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
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