0

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

chintan310
  • 334
  • 3
  • 10
  • 1
    Have a look at [hangfire](https://www.hangfire.io/). You can create Recurring jobs inside your web API and it supports .net core. – Thomas Jun 06 '17 at 21:24

1 Answers1

1

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.

Tom Sun - MSFT
  • 24,161
  • 3
  • 30
  • 47
  • How can i authenticate my one api allowed to call from webjob ? Current authentication in API implemented with MFA with client information – chintan310 Jun 08 '17 at 05:39
  • As webjob has no Interactive interface for us. If you API is implemented with MFA, we may have no way to do that. If other authentication for API is possible, we could use Azure AD authorization, we could do that it easy with Azure portal. And we could get more info about authorization from [document](https://learn.microsoft.com/en-us/azure/active-directory/develop/active-directory-devquickstarts-webapi-dotnet). We also could refer another [SO thread](https://stackoverflow.com/questions/41260442/azure-api-authentication) about how to get authorization for API. – Tom Sun - MSFT Jun 08 '17 at 06:20