Hello Team,
how to trigger notification for blob policy expiration ?
Any option to generate SAS for container using C# code [programatically]
Thanks
Madan S B
Hello Team,
how to trigger notification for blob policy expiration ?
Any option to generate SAS for container using C# code [programatically]
Thanks
Madan S B
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jefferson S. MottaRank #207 · 11.7K reputationPosted Jan 26, 2023, 9:37 AM EST
Hello,
When a blob policy expires, you can use Azure Event Grid to trigger a notification.
Anupam MaitiRank #295 · 8.5K reputationPosted Jan 26, 2023, 1:04 PM EST
You can use Azure Event Grid, for trigger a notification for Azure blob policy expiration. You will need to create an event subscription and configure it to listen for "Blob Policy Expiration" events.
Generating SAS for container using C# code:
string containerName = "mycontainer"; string connectionString = "DefaultEndpointsProtocol=https;AccountName=myAccount;AccountKey=myKey"; // Create a BlobContainerClient object BlobContainerClient container = new BlobContainerClient(connectionString, containerName); // Create a SharedAccessBlobPolicy object that expires in one hour SharedAccessBlobPolicy policy = new SharedAccessBlobPolicy { SharedAccessExpiryTime = DateTime.UtcNow.AddHours(1), Permissions = SharedAccessBlobPermissions.Read }; // Generate a SAS token string sas = container.GetSharedAccessSignature(policy);Madan ShekarRank #428 · 5.9K reputationPosted Jan 26, 2023, 11:06 PM EST
Thank you Anupam , Jefferson
Please suggest me a any blog to refer impimentation.