1

I've got a web job with a timer trigger that set to execute at midnight GMT. The web job is a .NET Core Console project and it's deployed to three different app service instances via a DevOps release pipeline. On the first environment the web job was deployed to, the job is triggered on schedule and the executable runs with Kudu log statements indicating success. On the other two environments the web job is triggered as scheduled however the executable doesn't run as indicated by no log statements indicating success showing. In all three environments, the logs indicate that the web job has triggered and that the function method has been found, however only the app instance where it was initially deployed executes the logic.

When running the same web job in different app service environments, is there anything required to ensure that each job executes successfully? I'm thinking that since each job's app settings are pointing to the same storage account that this has something to do with it, but to be honest this is the first web job I've created so I'm not sure.

I've tried to manually kick off the web job in the portal but since it's a timer job I don't believe it will execute successfully that way

1
  • 1
    I think you're correct, each environment should have it's own storage account in order to proper execute the triggers Commented Nov 29, 2022 at 21:10

1 Answer 1

1

As @Thiago Custodio said is correct,

each environment should have its own storage account in order to proper execute the triggers

Normally, the timer trigger Web Jobs will run a single instance at any point of time because of its Singleton lock feature.

This singleton lock feature is activated when the Job Host is started for that Timer Trigger Web Job or Azure Function which ensures only a single instance is running or if the singleton lock feature means blob lease is not acquired, then it generates another instance of that running timer trigger function or Web Job - the similar functionality I had reproduced earlier but didn't get multiple instances.

Hence, having the individual storage accounts for every environment like developer, staging/testing, production makes comfortable to trace the logs and here is the GitHub Azure Web Jobs Timer Trigger singleton lock article where it has given the code for Job Host configuration of different environments.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.