How do I enable non-interactive authentication when deploying a web project using Azure Webjobs and schedules?

Q: How do I enable non-interactive authentication (through management certificates) for multiple subscriptions when deploying a web project using Azure Webjobs and schedules?

Full text: Some time ago, we added Azure WebJob (planned) to our Azure / .NET project. We really liked simplicity until we tried to deploy it, especially using CI. We use Jenkins for one-click deployment for production.

However, in order for WebJobs to be published with a web project (and especially for creating a scheduler), we had to enable Non-Interactive Azure Authentication , which was an unpleasant surprise related to WebJobs. But we decided by adding the "webjob.props" file to the "WebJob Project Properties" project containing the management certificate. Here is the code:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Target Name="AfterSetScheduleProperties" AfterTargets="SetScheduleProperties">
      <PropertyGroup>
        <ManagementCertificate>Here is the cert.</ManagementCertificate>
        <SubscriptionId>Here was our production subscription ID</SubscriptionId>
      </PropertyGroup>
  </Target>
</Project>

, , , : CI (Jenkins) . . ? . , - webjobs.props. , , .

+4
1

WebJob :

  • WebJob -

, # 2, # 1. , WebJob CRON, - ( # 2). .

+3

Source: https://habr.com/ru/post/1615234/


All Articles