Skip to content

Commit 87f0b8d

Browse files
authored
feat (azure): support for account in 'az://' URLs (#403)
1 parent b5001d4 commit 87f0b8d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/azure/builder.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,8 +658,8 @@ impl MicrosoftAzureBuilder {
658658
};
659659

660660
match parsed.scheme() {
661-
"az" | "adl" | "azure" => self.container_name = Some(validate(host)?),
662-
"abfs" | "abfss" => {
661+
"adl" | "azure" => self.container_name = Some(validate(host)?),
662+
"az" | "abfs" | "abfss" => {
663663
// abfs(s) might refer to the fsspec convention abfs://<container>/<path>
664664
// or the convention for the hadoop driver abfs[s]://<file_system>@<account_name>.dfs.core.windows.net/<path>
665665
if parsed.username().is_empty() {
@@ -1103,6 +1103,14 @@ mod tests {
11031103
assert_eq!(builder.container_name, Some("file_system".to_string()));
11041104
assert!(!builder.use_fabric_endpoint.get().unwrap());
11051105

1106+
let mut builder = MicrosoftAzureBuilder::new();
1107+
builder
1108+
.parse_url("az://[email protected]/path-part/file")
1109+
.unwrap();
1110+
assert_eq!(builder.account_name, Some("account".to_string()));
1111+
assert_eq!(builder.container_name, Some("container".to_string()));
1112+
assert!(!builder.use_fabric_endpoint.get().unwrap());
1113+
11061114
let mut builder = MicrosoftAzureBuilder::new();
11071115
builder
11081116
.parse_url("abfss://[email protected]/")

0 commit comments

Comments
 (0)