Aspire not sending args to Azure Functions
- Dominant language
- C#
- Stars
- 6.3k
- Forks
- 991
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 196
Description
### Is there an existing issue for this?
- [x] I have searched the existing issues
### Describe the bug
Using `.WithArgs(...)` in the Aspire host when building the Azure Functions doesn't pass the arguments to the function:
```
// Aspire
builder.AddAzureFunctionsProject("my-function")
.WithArgs("--test", "true");
...
// Function
var builder = FunctionsApplication.CreateBuilder(args);
if (!args.Contains("--test"))
{
throw new System.Exception("Missing required argument: --test");
}
...
```
### Expected Behavior
Function should get the custom arguments
### Steps To Reproduce
This [repo](https://github.com/darianferrer/AspireFunction) can be used to reproduce the bug. It throws an exception if the argument passed in Aspire is not present.
### Exceptions (if any)
_No response_
### Aspire doctor output
Aspire Environment Check
========================
.NET SDK
✅ .NET 10.0.301 installed (x64)
Container Runtime
✅ Docker: running (auto-detected (default)) ← active
Environment
✅ HTTPS development certificate is trusted
Summary: 3 passed, 0 warnings, 0 failed
### Anything else?
This is the output when running the above repo
Contributor guide
Research direction
Run the linked AspireFunction reproduction and start at AddAzureFunctionsProject(...).WithArgs(...), following the arguments to the FunctionsApplication.CreateBuilder(args) entry point. Done means the function receives --test and true and no longer throws the missing-argument exception.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100