- Eine mit Angular gerenderte Web-App ()
Code: Select all
myapp.com
- Eine C#-REST-API, die von der Web-App aufgerufen wird ()
Code: Select all
myapi.com
- Ein Azure Blob Storage-Konto mit privaten und öffentlichen Containern ()
Code: Select all
myblob.com
Code: Select all
myapp.com/media/image.png
Bisher war ich dazu in der Lage um das Bild von meiner REST-API bereitzustellen (
Code: Select all
myapi.com/media/image.png
Code: Select all
[HttpGet("{path}")]
public IActionResult GetFileAsync(string path, CancellationToken cancellation)
{
string containerName = "mycontainer";
var blobContainerClient = _blobServiceClient.GetBlobContainerClient(containerName);
var blobClient = blobContainerClient.GetBlobClient(path);
var sasUri = blobClient.GenerateSasUri(
Azure.Storage.Sas.BlobSasPermissions.Read,
DateTimeOffset.UtcNow.AddHours(1));
var signedUrl = blobClient.Uri + sasUri.Query;
return Redirect(signedUrl);
}