79727964

Date: 2025-08-07 00:16:20
Score: 0.5
Natty:
Report link

As @Pratik Pathak mentioned, one way is to use the actual Azure storage URL, which has worked for me in the past, but you could also use blobServiceClient instead of bobClient .

Refer to this doc : https://learn.microsoft.com/en-us/azure/storage/blobs/storage-quickstart-blobs-dotnet?tabs=visual-studio%2Cmanaged-identity%2Croles-azure-portal%2Csign-in-azure-cli%2Cidentity-visual-studio

string connectionString = _configuration.GetConnectionString("AzureStorage");
string containerName = "container-name"; 
var blobServiceClient = new BlobServiceClient(connectionString);
var containerClient = blobServiceClient.GetBlobContainerClient(containerName);
var blobClient = containerClient.GetBlobClient(filePath);

var blobDownloadInfo = await blobClient.DownloadAsync();

var contentType = blobDownloadInfo.Value.Details.ContentType ?? "application/octet-stream";

return File(blobDownloadInfo.Value.Content, contentType, Path.GetFileName(filePath));
Reasons:
  • Whitelisted phrase (-1): worked for me
  • Probably link only (1):
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Pratik
  • Low reputation (0.5):
Posted by: Rajeev KR