azure-functions-host icon indicating copy to clipboard operation
azure-functions-host copied to clipboard

Support for WEBSITE_TIME_ZONE in Linux consumption

Open balag0 opened this issue 6 years ago • 16 comments

balag0 avatar Nov 14 '19 02:11 balag0

This needs to have a higher priority. The provided workaround, which is scheduling everything in UTC, doesn't work for all scenarios - or I am missing an obvious solution for this.

or example, there is no way to have the function run every 3 hours between 9am-6pm every work day. The translated UTC schedule would be:

0 0 16,19,22,1 * * 1,2,3,4,5

But this will run once Sunday, and miss one run on Friday:

5/17/2020 6:00:00 PM
5/18/2020 9:00:00 AM
5/18/2020 12:00:00 PM
5/18/2020 3:00:00 PM
5/18/2020 6:00:00 PM
5/19/2020 9:00:00 AM
5/19/2020 12:00:00 PM
5/19/2020 3:00:00 PM
5/19/2020 6:00:00 PM
5/20/2020 9:00:00 AM
5/20/2020 12:00:00 PM
5/20/2020 3:00:00 PM
5/20/2020 6:00:00 PM
5/21/2020 9:00:00 AM
5/21/2020 12:00:00 PM
5/21/2020 3:00:00 PM
5/21/2020 6:00:00 PM
5/22/2020 9:00:00 AM
5/22/2020 12:00:00 PM
5/22/2020 3:00:00 PM

paxos avatar May 18 '20 03:05 paxos

@balag0 Is it only for Consumption plan? I see user reported it for Linux Premium or App Service plan also. https://stackoverflow.com/questions/64316818/time-zone-issue-python-function-app-on-azure

krish-gh avatar Oct 12 '20 12:10 krish-gh

Yes, this issue is specific to consumption plans only.

balag0 avatar Oct 12 '20 17:10 balag0

Hi, any updates on it? Looks like I just got this issue.

rodchenkov avatar Jul 04 '21 20:07 rodchenkov

Hi, got the same problem here. Cant find a solution. Any updates?

NvHeijningen avatar Sep 10 '21 11:09 NvHeijningen

@NvHeijningen @rodchenkov yes, this is still a limitation and we don't have an ETA yet. Are you able to workaround this in the meantime?

balag0 avatar Sep 11 '21 02:09 balag0

Some issue here. Set up WEBSITE_TIME_ZONE configuration and still running on UTC tz

pedrojunqueira avatar Oct 01 '21 04:10 pedrojunqueira

@balag0 this has been open since 2019 with no suggested work arounds. @paxos gave an example of which there seems to be no work around. Will this ever be fixed? Please advise.

jkdmyrs avatar Mar 08 '22 23:03 jkdmyrs

Thanks for the ping.. I have opened an internal WI for prioritization. Will update here once we have a plan.

In the meantime, one possible (hacky) workaround, set the frequency greater than required timer frequency. Write code in the function code to check time and either do work or silently exit based on the current time in required timezone.

Ex: To run every 3 hours between 9am-6pm every work day

Configure the trigger to fire once an hour every day. In function code, get current time in utc, check if it is time to run the function , then either silently return or run the actual function logic. Understand its not ideal, but this might help unblock while the feature is coming online.

balag0 avatar Mar 10 '22 03:03 balag0

Would love some improvement here, please! I know we've documented the deficiency here, thanks. But this issue still has the opportunity to surprise teams. For instance, say we use consumption in a lower environments and app service in production environments. Using Windows, all is well. Using Linux, then :tada: !

We've got the workaround suggestion from @balag0, but - as mentioned - it's not ideal. It passes a bit of code complexity onto the customers to solve a product inconsistency. Hopefully this gets picked up to work on? Anywhere we can help? Happy to contribute. Not sure where to start, but currently ruminating over this portion of the azure functions host code ...

If it's too far back on the backlog, could we consider some sort of mitigation? Say ... have the host detect when the app is Linux Consumption and the WEBSITE_TIME_ZONE configuration value is set and warn the user? Popup a message in the portal?

TroyWitthoeft avatar Mar 24 '22 14:03 TroyWitthoeft

@TroyWitthoeft This is a great point. Making a change to display a warning in "Diagnose and solve problems" -> "Configuration and Management" section in the portal if the app is using "WEBSITE_TIME_ZONE " or "TZ" appsettings.

balag0 avatar Apr 04 '22 17:04 balag0

+1 for proper timezones in 2023

Vox1984 avatar Feb 08 '23 11:02 Vox1984

+1 for proper timezones in 2023

alicelupsan avatar Apr 10 '23 10:04 alicelupsan

The suggestion to display a warning in "Diagnose and solve problems" until this is resolved is a good one. I have only just stumbled across the documentation that says "this isn't supported" after 2 days (on and off) of trying to solve this.

drk-mtr avatar Jun 13 '23 12:06 drk-mtr

+1 for proper timezones in 2024

daniel17903 avatar Mar 28 '24 12:03 daniel17903

+1 for proper timezones in 2025

Ben-tal avatar May 08 '25 19:05 Ben-tal