How to Scan an Azure Blob for Viruses in JavaScript
Cloud storage containers have become an increasingly popular method for storing and uploading files over the past few years. While these containers are efficient and mostly secure, they generally fall outside the reach of basic anti-virus software. In this quick tutorial, we will demonstrate how to scan the contents of a single Azure Blob for viruses using an API in JavaScript. Azure is Microsoft’s cloud storage solution, and one of the best options due to its ease-of-use and compatibility; however, even the best solutions are susceptible to attack.
Let’s begin the process by installing the jQuery library:
bower install jquery
Once the installation is complete, we are ready to call the virus scan function:
var settings = {
"url": "https://api.cloudmersive.com/virus/scan/cloud-storage/azure-blob/single",
"method": "POST",
"timeout": 0,
"headers": {
"connectionString": "<string>",
"containerName": "<string>",
"blobPath": "<string>",
"Apikey": "YOUR-API-KEY-HERE"
},
};$.ajax(settings).done(function (response) {
console.log(response);
});
With this quick and easy process, you will receive instant results indicating the name and file location of any viruses that are found.