Azure Front Door - cache purge (Aspire.Hosting.Azure.FrontDoor)
- 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
### Is your feature request related to a problem? Please describe the problem.
If you use AFD's caching, you often need to purge it on deploy.
Aspire can't currently easily do this, requiring some shelling out to the az cli or similiar.
### Describe the solution you'd like
It'd be nice if we could, eg.:
``` csharp
builder.AddAzureFrontDoor("frontdoor")
.WithOrigin(web)
.WithCachePurgeAfterDeploy("/*");
```
Maybe we need multiple endpoints, I haven't thought too hard yet :)
``` csharp
frontDoor.WithCachePurgeAfterDeploy(options =>
{
options.AddEndpoint(frontDoorEndpointName, ["/*"]);
});
```
I don't know if the resource graph models precisely enough eg. SPA deployments to be smart(er) around that instead of just "AfterDeploy", but it'd be cool if it was, and could wire up ViteApp. Sounds kinda hard because it'd need to trace through how the app was served - eg. in my app it's added to the backend container, so the purge needs to be after the new version of the container is the only one running.
### Additional context
_No response_
Contributor guide
Research direction
Start by reading the existing Aspire.Hosting.Azure.FrontDoor APIs and the deployment lifecycle around AddAzureFrontDoor and WithOrigin. Define whether WithCachePurgeAfterDeploy should support one or multiple endpoints and how purge ordering relates to deployed resources; done means a settled API design with implementation and coverage for configured purge paths.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- cloud, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100