How to get a reminder before a SAS token expires

Kumari, Sweta 20 Reputation points
2024-03-07T12:31:05.7333333+00:00

How can I set up monitoring for my storage account so that I receive an alert before any SAS keys expire? I want to be notified when the expiration of a SAS key for this storage account is approaching.

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
669 questions
Azure Storage Accounts
Azure Storage Accounts
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
2,871 questions
0 comments No comments
{count} votes

Accepted answer
  1. Amrinder Singh 4,185 Reputation points Microsoft Employee
    2024-03-07T14:00:58.77+00:00

    Hi Sweta - Thanks for reaching out.

    Storage doesn't provide any inbuilt mechanism to notify for SAS expiry as storage doesn't stores any SAS it's end. This is because SAS is confidential data and as part of compliance, need to be maintained on the customer side only. So, you need to maintain or track the expiry from your side only.

    Alternatively, you can make use of Azure Key Vault to store the SAS and the AKV will be taking care of renewals of the same. In that way, you don't have to track the expiry at all.

    Lastly, it is also encouraged to make use of Azure AD roles for authorization instead of SAS which provide better control by managing the permissions via roles.

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Marcin Policht 16,730 Reputation points MVP
    2024-03-07T12:44:41.4866667+00:00

    You'd need to set up a custom SAS provisioning process that configures notification when the SAS is provisioned. There is no built-in functionality that would support this behavior.


    hth

    Marcin