0

We are having Azure Storage Container & generated the SAS token for the production usage. We need to get the SAS token expiry alert for the same.

I have tried below steps,

  1. Stored the SAS token to Azure Keyvault

  2. Got the expiry date for the SAS token using automation account runbook powershell command.

Next need to configure email alert before 7 days for the SAS token expiry date.

1 Answers1

0

I tried to reproduce the same in my environment for test email notification it's work fine

To send email Notification you have grant Mail.Send Application permission and grant Admin consent like below:

enter image description here

After granting permission I can send email notification using below cmdlet:

enter image description here

Connect-MgGraph -ClientId 'clientID' -TenantId 'tenantID' -CertificateThumbprint 'certthumbprint'
    
    $message = @{
        subject = 'test'
        ToRecipients = @(
                @{
                    EmailAddress = @{
                        Address = "email@email.com"
                    }
                }
            )
        body = @{
            contentType = 'html'
            content = 'hello'
        }
    }
    
    Send-MgUserMail -UserId 'upn_of_user_running_script' -Message $message
Imran
  • 3,875
  • 2
  • 3
  • 12
  • Hello Imran, Thanks for your reply. I need to know the SAS expiry notification. How can i configure? Please let me know if you have any ideas. – sundar1451989 Jul 14 '22 at 04:53
  • Imran, I need to notify the Storage Blob SAS token expiry. You send the document for Keyvault expert alert. – sundar1451989 Jul 14 '22 at 05:37