iT邦幫忙

0

Azure cdn signed url

  • 分享至 

  • xImage

AZURE_CDN is kept with origin path so it will be url/{container} masked to a single url so http://{CDN}/file.png ==> this i have tested with get urls and is working fine

i have manually generated a signed url from console and used put method and changed the url to CDN which is working fine (used postman)..

The problem is with put method into the CDN that I am generating from Nodejs -->
In Azure
const credentials = new storage.StorageSharedKeyCredential(AZURE_STORAGE_ACCOUNT, AZURE_ACCOUNT_KEY);
const blobServiceClient = new storage.BlobServiceClient(AZURE_CDN+"/"+fileName, credentials);
const permissions = new storage.BlobSASPermissions();
permissions.write = true;

const currentDateTime = new Date();
const expiryDateTime = new Date(currentDateTime.setMinutes(currentDateTime.getMinutes()+5));//Expire the SAS token in 5 minutes.

const blobSAS = storage.generateBlobSASQueryParameters({
startsOn: new Date(),
expiresOn: expiryDateTime,
permissions: permissions,
protocol: storage.SASProtocol.Https

},
credentials
).toString();;
return blobServiceClient.url+ "?" + blobSAS;
};
i am able to do a http options method but put method is throwing error (used postman)

圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答