I am currently exploring the VueJs framework and looking to integrate my project with Azure. However, I am unsure of the process. Previously, I worked with Firebase - is it a similar technique where we configure storage within the project?
Recently, I created a new blob and container in Azure, obtained a saskey, primary/secondary paths, but now I'm stuck on what to do next.
In my VueJs project, I have added the following code:
var sasKey = '....'; //Code from Azure
var blobUri = '...'; //Path
var blobService = AzureStorage.createBlobServiceWithSas(blobUri, sasKey).withFilter(new AzureStorage.ExponentialRetryPolicyFilter());
blobService.createBlockBlobFromText('ContainerName', 'BlobName', data, function(error, result, response){
if (error) {
console.log('Upload failed, please check browser console for more information.');
console.log(error);
} else {
console.log('Upload successful!');
}
});
To clarify, I am new to Vue.js and Azure. Please guide me on the correct steps to successfully upload an image to Azure storage.
Additionally, can we incorporate security headers like those used in Axios? For example, checking content-length, content-type, etc.
Whenever I run the program, it consistently displays:
Upload failed, please check browser console for more information.
Error: XHR error
at XMLHttpRequest.xhr.onerror