Azure / Azure/azure-functions-host

Instance Validation Mechanism for Drain and other APIs

Open
#7,335 0 comments 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

For APIs like /admin/host/drain or other APIs invoked by App Service platform infrastructure that can result irreversible application state changes, we'd like to add a validation mechanism for the incoming request to declare the instance the operation is intending to operate on. This can help in cases where due to some upstream bug/issue, the request was accidentally routed to the wrong instance. A piece of middleware could validate the request and reject it if it's the wrong instance.

E.g. the incoming request could have a header, e.g. WEBSITE-INSTANCE-ID that contains the instance ID, and when present it must match the actual ID or the request is rejected. Either this, or some other bit of per instance state that is shared between platform and Functions host.

This isn't an authentication mechanism - it's a collaborative validation.

Contributor guide

Open the contributing guide

Research direction

The issue names /admin/host/drain and other platform-invoked APIs but no source files or tests. Start by tracing the drain endpoint and its middleware, then determine how the host exposes its instance ID and how platform requests could provide it. Done requires an agreed validation contract and coverage for matching and mismatched instance requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
api, backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.