Skip to content

Instantly share code, notes, and snippets.

@ThomasPe
Created July 30, 2018 11:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasPe/49f7621769e1ff501dc9060ea4529dcd to your computer and use it in GitHub Desktop.
Save ThomasPe/49f7621769e1ff501dc9060ea4529dcd to your computer and use it in GitHub Desktop.
Upload html file to Azure Storage static web hosting
function uploadSite(page){
context.log("Upload site ");
var blobService = storage.createBlobService();
// create $web container
blobService.createContainerIfNotExists('$web', function(){
// upload index.html to $web container
const options = { contentSettings: { contentType: 'text/html' } }
blobService.createBlockBlobFromText("$web", "index.html", page, options, function (error) {
context.log("uploaded");
context.done();
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment