There is html code written for download button.
The complete Sharepoint 2013 hosted application functionality has JS code.
There is WCF solution using C# to get data from SAP system.
There is one page in application which has download button. Once clicked by the user, the file should get downloaded from Azure blob storage.
Kindly help how we can achieve this.
I have tested in my environment
You can use the below javascript function to download files from Azure blob storage :
async function main() {
var fs = require('fs');
const { BlobServiceClient, StorageSharedKeyCredential } = require("@azure/storage-blob");
const account = "storage account name";
const accountKey = "storage account key"
const sharedKeyCredential = new StorageSharedKeyCredential(account, accountKey);
const blobServiceClient = new BlobServiceClient(
`https://${account}.blob.core.windows.net`,
sharedKeyCredential);
const containerClient = blobServiceClient.getContainerClient("container name");
const blobClient = containerClient.getBlobClient("blob file name to be downloaded");
const response = await blobClient.downloadToFile("blob file name to be downloaded");
main();