Azure SAS | Azure Shared Access Signature | Storage Account Shared Access | How to generate Storage Account Shared Access Signature with .Net core program | Web API Generate Storage SAS
Shared Access Signature aka Azure storage Account SAS is a way of accessing storage account with restrictions. we can set start and expiry dates for azure storage shared access token. Storage Account Shared Access signature can be generated using .net Core programs and from the azure portal as well.
In this video I have demoed real time usage and generating Azure storage container Shared access signature(SAS) with .Net 5 program. I have explained the real time use case of a company which moved to azure cloud and has Azure storage accounts. SAS tokens are very useful when you want to restrict the access to your storage account. Shared Access Signatures can be generated on Azure Storage account level, Storage Container level, Blob level, Storage Queue level and even on Storage table level too.
To .Net core create azure storage account sas token, In this demo we have used connection string of azure storage account. We have used BlobContainerClient to access the azure storage account with .Net 5 and used BlobSasBuilder class to set Start and expiry time, restrict the permissions like Read, Write, Create and List. The same code works in .Net core and .Net 6 as well. we have used .Net core console generate SAS token and notify the users with an email using Azure SendGrid and the email will be sent with a .net 5 program. It has explanation on Azure Storage Explorer where we have accessed the Azure Storage account container with Shared Access SAS signature.
In the .Net 5 storage account SAS video, I have shown uploading a file to Azure Storage Account with Shared access signature. To upload a file to azure storage account using SAS token, we can use BlobContainerclient in .Net core program and use the SAS uri. After that read the file using any .net core file classes and upload it to azure storage account using .net core programs. In this .net core azure storage shared access signature SAS video, I have shown the issue with Azure timezones and the SAS tokens are generated in Utc timezone.
Chapters
00:00 Intro to Azure SAS Storage Shared Access Signature
01:00 Azure SAS real time use case
02:20 Storage Account SAS Basics
04:40 How to use Azure Storage Explorer
08:04 .Net core Generate Storage Account SAS
15:30 .Net core Azure Send Email with SendGrid
18:20 .Net5 Azure Storage Generate SAS Testing
20:40 .Net6 Upload file to Azure Storage Account using SAS