hiFI
hiFI

Reputation: 1961

SQL Server DB Mail attachment from App Service Folder

I have a web app running in Azure and one of its requirement is to send e-mail from SQL Server's DB Mail; however the attachments are stored in App Service environment.

My question is how can access the attachment in App Service folder?

My Setup:

  1. Web App on Azure App Services
  2. SQL Server PAAS model
  3. NO VMs used

In App Service Editor, I have an URL for each file like

https://xxxxx.scm.azurewebsites.net/dev/wwwroot/uploads/test.pdf;

Can I use this URL? Or is there anyway I can use?

Upvotes: 0

Views: 200

Answers (1)

Fei Han
Fei Han

Reputation: 27793

As hiFI said, Database mail feature is not supported in Azure SQL Database.

If possible, please send email in your web app code behind (when you do operations on your database in your code) and use https://{your app name}.azurewebsites.net/uploads/test.pdf that would be accessible.

Besides, you could store the pdf files in Azure Blob storage and provide the URL to the pdf file, and a SAS could be used to grant limited access to objects in storage account.

Upvotes: 1

Related Questions