Publish simple Asp.Net Core App (.Net Framework) with WebJob

前端 未结 4 457
萌比男神i
萌比男神i 2020-12-10 08:14

I would like to create a simple ASP.NET Core Web Application (.NET Framework) and publish a WebJob alongside it to Azure.

I\'m using Visual Studio 2017, but the resu

4条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-10 08:40

    To add to Tomas' answer, if you want to set this up using git deploy, you need to modify the deploy.cmd file inside your Azure WebApp.

    There's a working example here.

    In order for this to work, make sure that you add a run.cmd file to your WebJob project:

    @echo off
    dotnet SampleWebJob.dll (you can change this to run an .exe if you want to)
    

    You also need to modify your .csproj and include

    
        
    
    

    Also, if you want to automate this using git deployment, you need to modify the deploy.cmd under site/deployments/tools and include this line.

    :: 2.1 Build and publish WebJobs
    echo Building and deploying Radius365.WebJob
    call :ExecuteCmd dotnet publish "SampleWebJob\SampleWebJob.csproj" -o "%DEPLOYMENT_TEMP%\App_Data\Jobs\Continuous\SampleWebJob" -c Release
    

    You can get more information here. and here.

    Hope this helps.

提交回复
热议问题