Detect host id from function runtime environment#82
Merged
danielmarbach merged 11 commits intomainfrom May 5, 2026
Merged
Conversation
andreasohlund
commented
Apr 29, 2026
DavidBoike
approved these changes
May 4, 2026
Contributor
|
Discussed it with @andreasohlund and after talking it through with @bording too we think going with calling AppContext directly |
Member
Author
|
@danielmarbach app switch now set in code, ready for review |
danielmarbach
approved these changes
May 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes sure that the endpoint instances are uniquely identified as functions are scaled up or down.
The logic falls back to
CONTAINER_NAMEwhen running in Azure container apps andEnvironment.MachineNamefor local development.NOTE: This is different from the existing worker package, which uses
ENDPOINT_NAME. The reason for this was likely that ServicePulse at that time didn't have the "Do not track instances" feature yet, and we wanted a way to not continuously add instances in ServicePulse. This will be pointed out in the migration guide.Design decisions
Align with endpoint instance concept
In order to align with the definition of endpoint instance, which states
and also the documentation for heartbeats in ServicePulse, which states
Each scaled-out function instance should be uniquely identified.