You need to sign in to do that
Don't have an account?
Pankaj Pahade
How to delete file from Azure Storage using Apex or LWC?
How to delete file from AzureStorage using Apex or LWC?
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
You need to provide more detail about your requirement.
Thanks!
I have two ways in my mind,
1. using Http call from Apex
2. Calling AzureStorage or CloudBlobClient directly in LWC (But I am not able to import AzureStorage inside LWC to utilized Azure standard methods )
Currently I am doing,
HttpRequest req = new HttpRequest();
req.setTimeout(120000);
req.setMethod('DELETE');
req.setHeader('x-ms-blob-type', 'BlockBlob');
req.setHeader('x-ms-date',System.Now().formatGMT('EEE, dd MMM yyyy HH:mm:ss z'));
req.setHeader('x-ms-version', '2015-12-11');
req.setEndpoint('https://'+StorageName+'.blob.core.windows.net/'+Container+'/'+image (1).png+'?'+SASToken);
Http http = new Http();
try {
HTTPResponse res = http.send(req);
if(res.getStatusCode() == 201){
System.debug('res.getStatusCode()--------> '+res.getBody());
}else{
System.debug('Not Deleted--------> ');
System.debug('res.getStatusCode() in else--------> '+res.getBody());
System.debug('res.toString()--------> '+res.toString());
}
} catch (system.CalloutException ce){
system.debug(ce);
}
But, I am getting 'HTTP Error 400. The request is badly formed.' as result, if more information needed let comment on same,
please give me some idea or some related reference on this part
Can you or anyone help me to solve my requirment