Skip to content

Fix WASB log source URLs to use storage account endpoint#68510

Merged
dabla merged 2 commits into
apache:mainfrom
Bafff:fix-wasb-log-source-url
Jul 16, 2026
Merged

Fix WASB log source URLs to use storage account endpoint#68510
dabla merged 2 commits into
apache:mainfrom
Bafff:fix-wasb-log-source-url

Conversation

@Bafff

@Bafff Bafff commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

The WASB task log handler currently reports remote log source URLs as:

https://<container>.blob.core.windows.net/<blob>

That makes the container name look like the storage account. Log reads still work because they use WasbHook, but the URL shown in the UI points at the wrong host.

This PR builds the source URL from the Azure BlobServiceClient instead:

  • Uses primary_endpoint when available.
  • Adds the container and blob path to that endpoint.
  • Removes query strings and fragments before showing the URL.
  • Keeps Azurite-style account paths, while dropping SAS-like path segments.
  • Falls back to account_name, then to the old container-host format.

Tests cover normal Azure endpoints, Azurite endpoints, SAS query/fragment removal, SAS-in-path removal, and fallback paths. The logging docs example now shows account/container/blob.

Tests:

  • uv run --project providers/microsoft/azure ruff check providers/microsoft/azure/src/airflow/providers/microsoft/azure/log/wasb_task_handler.py providers/microsoft/azure/tests/unit/microsoft/azure/log/test_wasb_task_handler.py
  • uv run --project providers/microsoft/azure pytest providers/microsoft/azure/tests/unit/microsoft/azure/log/test_wasb_task_handler.py -q
  • git diff --check

Was generative AI tooling used to co-author this PR?
  • Yes, OpenAI Codex was used to help prepare the patch and PR text. Claude Code and Gemini were used to review the diff. The code and tests were checked locally before submission.

Generated-by: OpenAI Codex following the guidelines

@boring-cyborg

boring-cyborg Bot commented Jun 13, 2026

Copy link
Copy Markdown

Congratulations on your first Pull Request and welcome to the Apache Airflow community! If you have any issues or are unsure about any anything please check our Contributors' Guide
Here are some useful points:

  • Pay attention to the quality of your code (ruff, mypy and type annotations). Our prek-hooks will help you with that.
  • In case of a new feature add useful documentation (in docstrings or in docs/ directory). Adding a new operator? Check this short guide Consider adding an example Dag that shows how users should use it.
  • Consider using Breeze environment for testing locally, it's a heavy docker but it ships with a working Airflow and a lot of integrations.
  • Be patient and persistent. It might take some time to get a review or get the final approval from Committers.
  • Please follow ASF Code of Conduct for all communication including (but not limited to) comments on Pull Requests, Mailing list and Slack.
  • Be sure to read the Airflow Coding style.
  • Always keep your Pull Requests rebased, otherwise your build might fail due to changes not related to your commits.
    Apache Airflow is a community-driven project and together we are making it better 🚀.
    In case of doubts contact the developers at:
    Mailing List: dev@airflow.apache.org
    Slack: https://s.apache.org/airflow-slack

@eladkal
eladkal requested a review from dabla June 15, 2026 14:10
@potiuk potiuk added the ready for maintainer review Set after triaging when all criteria pass. label Jun 17, 2026
@eladkal
eladkal requested a review from dabla July 1, 2026 19:21
@Bafff

Bafff commented Jul 16, 2026

Copy link
Copy Markdown
Contributor Author

hey, any news on this?

@dabla
dabla merged commit f7c0b96 into apache:main Jul 16, 2026
81 checks passed
@boring-cyborg

boring-cyborg Bot commented Jul 16, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants