Skip to content

Instantly share code, notes, and snippets.

@aribornstein
Created March 17, 2019 10:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aribornstein/817982ab981f7a34a83b73855771f92b to your computer and use it in GitHub Desktop.
Save aribornstein/817982ab981f7a34a83b73855771f92b to your computer and use it in GitHub Desktop.
Fetch Azure Blob Container List JS
fetch("https://{namespace}.blob.core.windows.net/{containerName}/?restype=container&comp=list")
.then(response => response.text())
.then(str => new window.DOMParser().parseFromString(str, "text/xml"))
.then(xml => {
let blobList = Array.from(xml.querySelectorAll("Url")); //.getAttribute("Url");
blobList.forEach(async blobUrl => {
console.log(blobUrl);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment