jedcunningham commented on code in PR #33851:
URL: https://github.com/apache/airflow/pull/33851#discussion_r1307976832


##########
airflow/providers/microsoft/azure/hooks/wasb.py:
##########
@@ -163,10 +163,18 @@ def get_conn(self) -> BlobServiceClient:
         account_url = conn.host if conn.host else 
f"https://{conn.login}.blob.core.windows.net/";
         parsed_url = urlparse(account_url)
 
-        if not parsed_url.netloc and "." not in parsed_url.path:
-            # if there's no netloc and no dots in the path, then user only
-            # provided the Active Directory ID, not the full URL or DNS name
-            account_url = f"https://{conn.login}.blob.core.windows.net/";
+        if not parsed_url.netloc:
+            if "." not in parsed_url.path:
+                # if there's no netloc and no dots in the path, then user only
+                # provided the Active Directory ID, not the full URL or DNS 
name
+                account_url = f"https://{conn.login}.blob.core.windows.net/";
+            else:
+                # if there's no netloc but there are dots in the path, then 
user
+                # provided the DNS name without the https:// prefix.
+                # Azure storage account name can only be 3 to 24 characters in 
length
+                # 
https://learn.microsoft.com/en-us/azure/storage/common/storage-account-overview#storage-account-name
+                acc_name = parsed_url.path.split(".")[0][:24]
+                account_url = f"https://{acc_name}."; + 
".".join(parsed_url.path.split(".")[1:])

Review Comment:
   ```suggestion
                   acc_name = account_url.split(".")[0][:24]
                   account_url = f"https://{acc_name}."; + 
".".join(account_url.split(".")[1:])
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to