0
votes

I want to send daily email with my application.

Background My application has web.api which created .net core & published on Azure app api (Paas). API has it's own authentication mechanism(JWT token) & it's used dependancy injection. It read configuration value ex. Database, Redis cache, bob storage connection string from Azure key vault

Solution 1)If i create new console application and set in web job. I have to do lot of coding for dependnecy injection and have to integrate azure valut. 2)Can i create web api in current api project but how to ensure security only azure web job can call api.

same question ::Securely calling a WebSite hosted Web API from an Azure WebJob

1
Have a look at hangfire. You can create Recurring jobs inside your web API and it supports .net core.Thomas

1 Answers

1
votes

As you mentioned that we could use the Azure scheduled WebJob to send daily mail. Send mail demo code please refer to another SO thread.

Can i create web api in current api project but how to ensure security only azure web job can call api.

We need to use our authentication way to security our WebApi. And Azure also supply multiple ways to help us protect our WebApp. We can get more info about Authentication and authorization for API Apps in Azure App Service from document.