Azure / Azure/azure-functions-host

TimerTrigger in Azure Function in Docker container on Kubernetes runs on every instance (.NET Core)

Open
#6,015 28 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
C#
Stars
2k
Forks
482
Avg merge
2d 12h
Merged PRs (30d)
38

Description

TimerTrigger to run only once for all instances makes a lease in a BlobStorage. Name of the container depends on a Machine name in case of Kubernetes and it's unique for all instances. Because of that TimerTrigger runs on all instances at the same time.

As temporary solution I have to use env. variables WEBSITE_SITE_NAME and WEBSITE_INSTANCE_ID to make it work as expected, but maybe it's better to provide a way to override default container name for Azure Functions.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the TimerTrigger lease and default container naming behavior described for Azure Functions running in Docker on Kubernetes. Evaluate how an override for the default container name would coordinate all instances, and consider the issue resolved when one lease reliably prevents duplicate timer execution across instances.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp, docker, kubernetes
Domain
cloud, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.