Azure / Azure/azure-functions-dotnet-worker

AZFW0011 reported if Azure Function environment variable passed as blobPath for BlobInputAttribute

Open
#3,108 0 comments 0 reactions 0 assignees View on GitHub
area: metadata-source-generator enhancement
Dominant language
C#
Stars
466
Forks
215
Avg merge
3d 10h
Merged PRs (30d)
7

Description

### Description

Link to AZFW0011: https://dotnet-worker-rules.azurewebsites.net/rules?ruleid=AZFW0011

Workarounds:
- Disable analyzer
- Use two variables, one for container directory and one for blobname and join them with `/`

Suggested behaviour:
- The analyzer should not detect environment variables as containers and expect an interable as parameter type

### Steps to reproduce

Create an Azure function with a `BlobInputAttribute`, where the blobPath is an environment variable for example:
`[BlobInput($"%{AcceptedFilePathEnvironmentVariableName}%")] BlobClient blobClient`

The analyzer will report: `AZFW0011: The binding type 'Azure.Storage.Blobs.BlobClient' must be iterable for container path. (https://aka.ms/azfw-rules?ruleid=AZFW0011)`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the AZFW0011 rule documentation and the BlobInputAttribute reproduction in this issue. Trace how the analyzer interprets a blobPath containing an environment-variable placeholder and identify the existing tests for container paths. Done means the placeholder no longer produces the iterable-parameter diagnostic while ordinary container paths remain validated.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
cloud, tooling
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.