2

We have an Azure Function (dotnet) deployed that relies heavily on the current date/time for many operations.

We are writing an integration test suite for it and would really love to keep a blackbox approach. That is, we'd rather not internally mock the date/time if possible.

Is there a way to adjust the system time of the app service to achieve this? Ideally, there would be a non-intrusive way to achieve this, but I'm open to lightly-instrusive options

Peter Dongan
  • 1,762
  • 12
  • 17
Tyler Murry
  • 2,705
  • 3
  • 29
  • 46

2 Answers2

1

In the Azure portal, in your App Service subscription, go to the Application settings menu. Under App settings, add this setting:

Key = WEBSITE_TIME_ZONE

Value = The time zone you want

List of timezone values to use with linux

Juanma Feliu
  • 1,298
  • 4
  • 16
0

Perhaps you could deploy using a Docker container and set the time in that as described here: Is it possible change date in docker container?

Peter Dongan
  • 1,762
  • 12
  • 17