Created
July 30, 2018 11:53
-
-
Save ThomasPe/49f7621769e1ff501dc9060ea4529dcd to your computer and use it in GitHub Desktop.
Upload html file to Azure Storage static web hosting
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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