Skip to content

Conversation

@ahmedmuhsin
Copy link
Contributor

@ahmedmuhsin ahmedmuhsin commented Dec 23, 2025

This pull request adds support for setting the timezone during specialization in Azure Functions workers, addressing timezone handling as part of the function app lifecycle. In addition to the core timezone update, a set of complementary testing and infrastructure improvements are included, primarily focused on test modularity and reusability.

Timezone Support During Specialization:

  • The specialization process is enhanced to ensure the timezone setting is correctly updated, improving time-sensitive function executions.
  • A new sample Java Azure Function (TimezoneCheck) is added to demonstrate timezone detection and validation, along with its Maven configuration and Functions host settings. [1] [2] [3]

Azure Functions Test Kit Package:

  • Introduces a reusable Python package azure-functions-test-kit with a pyproject.toml for packaging and dependency management. This package exposes classes to conveniently manage Azurite, Functions containers, and the Linux Consumption test environment. [1] [2] [3] [4]
  • Provides a pytest plugin (plugin. py) that automatically loads .env files for test configuration, eliminating the need for custom fixtures in conftest.py. [1] [2]
  • Adds tests to confirm package imports and the behavior of the pytest plugin. [1] [2]

Test Environment Refactoring:

  • Refactors the Linux Consumption test environment by moving it from utils/linux_consumption_test_environment. py to azure_functions_test_kit/environments/consumption.py. Improvements include: modular design, easier imports, context manager support, and a url property for simplified use in tests. [1] [2] [3] [4] [5]
  • Updates all test imports to use the new package structure. [1] [2]

Summary:
The primary change is robust timezone configuration during function app specialization. All additional modifications—such as the introduction of the azure-functions-test-kit and related test refactoring—are supporting updates to make local testing, sample development, and test environment setup more modular and consistent.

* Sets the default timezone based on the TZ environment variable
*/
private void setTimeZone(Map<String, String> environmentVariables) {
String tzValue = environmentVariables.get("TZ");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should also check for this app setting: WEBSITE_TIME_ZONE

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated logic so that we first look at WEBSITE_TIME_ZONE and then fallback on TZ.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants