Skip to content

Fix updating account url for WasbHook - #33457

Merged
ephraimbuddy merged 2 commits into
apache:mainfrom
astronomer:fix-azure-account-url
Aug 17, 2023
Merged

Fix updating account url for WasbHook#33457
ephraimbuddy merged 2 commits into
apache:mainfrom
astronomer:fix-azure-account-url

Conversation

@ephraimbuddy

Copy link
Copy Markdown
Contributor

There are different ways users supply the hostname(account url) in Azure, sometimes the host doesn't have a urlparse.scheme but has urlparse.path e.g. name.blob.windows.net and other times, it will just be Azure ID e.g. aldhjf9dads. While working on #32980, I assumed that if there's no scheme, then the hostname is not valid, that's incorrect since DNS can serve as the host.
The fix was to check if we don't have netloc and that urlparse.path does not include a dot and if it does not, use the login/account_name to construct the account_url

Closes: #33203

Comment threadairflow/providers/microsoft/azure/hooks/wasb.py Outdated
There are different ways users supply the hostname(account url) in azure,
sometimes the host doesn't have a urlparse.scheme but has urlparse.path e.g name.blob.windows.net
and other times, it will just be Azure ID e.g aldhjf9dads.
While working on apache#32980, I assumed that if there's no scheme, then the hostname is not valid, that's
incorrect since DNS can serve as the host.
The fix was to check if we don't have netloc and that urlparse.path does not include a dot and if it does not, use the login/account_name to construct
the account_url
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provider apache-airflow-providers-microsoft-azure no longer==6.2.3 expose account_name

4 participants

@ephraimbuddy@Lee-W@hussein-awala@eladkal