Azure devOps WebJobs fails after .NET 5 Migration - azure

I've got several webjobs that I deploy using an Azure DevOps pipeline. After the .NET 5 migration I have these errors in Kudu
This happened after .net 5 migration but I don't really think it is connected to it. The app service configuration is set to NET5.
I already try these actions:
Manually delete all jobs in kudu and redeploy them
Deploy the webjobs in another app service
Obviously (ironically) in the local environment it works
The fact that they won't work in another app service means the problem is in the devOps pipeline, but I didn't change it. I mean, it builds in net5 right now, that's all.
Could someone know about this type of error? I never encountered something like this in kudu and It's difficult to even search for a solution.
Thanks in advance.

You can add extension on portal or in scm site. After installed ASP.NET Core 5.0 (x86 and x64) Runtime, your issue will be solved.
1. On portal.
2. On scm site.

At the end of the day, we developed a brand new application based on .net 5 and we deployed it to a new app service based on .NET 5.
We didn't install anything to the app service, so it wasn't the problem.
I don't really know what happened.

Related

Azure DevOps IIS Deployment failing

I have a release pipeline to deploy my ASP.NET MVC web app to Azure VM. I have configured the release pipeline and everything was working fine.
But all of a sudden, it started throwing the error shown here. I am using IIS Web App deployment tool for this in Azure DevOps:
Looks like it's been reported as an issue related to a new task versions for WebAppDeployment tasks. See here, you might find a workaround that will work for you: https://github.com/microsoft/azure-pipelines-tasks/issues/17634

Azure WebJobs get deleted each time I redeploy?

Are Azure WebJobs get deleted each time when I redeploy? I found those WebJobs mysterious disappeared, so I guess maybe it's because I redeployed my app but didn't go to Azure portal to re set WebJobs again.
If that's the case, it is really a trouble to re set WebJobs again and again. Is there a way to automate this?
I deploy from Visual Studio. I read somewhere saying I can put my WebJobs (e.g. xxx.ps1) under App_Data/jobs/continuous/, and then whenever I deploy, the WebJobs will be deployed automatically. I did that, but I didn't see those WebJobs in my Azure portal.
See https://learn.microsoft.com/en-us/azure/app-service-web/websites-dotnet-deploy-webjobs for instructions on how to add WebJobs to your Web App from VS. Note that you don't need to worry about the App_Data/jobs/continuous folder, as that's taken care of by VS deployment.
Note that this is supported for ASP.NET but not yet for ASP.NET Core.

NodeJs project as a Azure WebJob

What is process to upload NodeJs project as Azure WebJob from Visual Studio.
I want to upload my nodeJs Project to azure as a WebJob from visual studio with out a WebAPP I am not able to find any blogs or articles to progress further.
Any suggestions?
There is an offical tutorial Deploy WebJobs using Visual Studio which you can refer to, but the deployment is within a WebApp.
However, I discovered a new preview feature Azure WebJobs as Api App on Azure new portal. I think it seems to satisfy your needs, please see and try at the link.
Hope it helps.
This question is problematic, WebJobs run always in the context of a WebApp, that's what they are designed for.
In the meantime Microsoft published Azure Functions https://azure.microsoft.com/en-us/services/functions/
which can do mostly the same and more, only problem is you'll be developing more functional (haha) as global objects/settings/environment variables aren't accessible (because there is no WebApp context).

How to publish the Console Application (package from asp.net 5) as an Azure Web Job

I have a new ASP.NET 5 application (beta 8) and I have created a console application (the new Package version). I have followed this guide by Microsoft on publishing it to Azure Web Jobs. The guide is based on 2013 and do not use vNext, but it describes all the files, etc. that are required to publish the webjob. I have followed it and created:
webjob-publish-settings.json
added reference to Microsoft.Web.WebJobs.Publish
added webjobs-list.json (with reference to .xproj)
After I do publish my web application, no job appears (so I guess it just does not use the config properly). There is no context menu to Publish As WebJob either on the console application.
Is there any proper way to overcome it or we'll have to wait till full release of ASP.NET 5 to have it fixed and I have to create an ordinary console application meanwhile? I hope there is some workaround to publish it at least manually.
Currently, there is no support in VS to deploy DNX WebJobs. This will come later, but until then there are still ways to deploy manually.
Related reading:
http://ahmelsayed.com/running-dnx-based-webjobs/
publish dnx based WebJob with local dependencies

Azure WebJob running old code

We have a bug in our WebJob running in our live environment, I have identified the bug and fixed it, this I can verify in our Dev-environment. I published my WebJob as a "Azure WebJob" to our live environment but the bug i still present. To add to the confusion the bug now just occurs sometimes. So for some reason the old code is running somewhere sometimes.
Can someone please help me understand this?
I had a similar problem. We deploy using a stage environment in Azure and it turned out that the "old" WebJobs (running code with an old version of the entity framework model) where still running on the queue. These jobs where then fetching messages and consuming them. To add to the problem the exception was consumed in a try catch and the status of the WebJob was success.
Check if you have a stage environment (add -stage to the Webapp name) and if so go in to the Azure management portal and stop them.
Note, it is not enough to stop the Webapp, you must stop the WebJobs directly. This is done (in the new portal) under Settings->WebJobs and then right-clicking on the webjobs name selecting stop.
I spent ages looking into this problem. Turns out I had the web job project running in a console on my PC at work! No matter what I did on Azure the presence of this exe running and using the same storage for the web jobs meant that the old code running on my work PC picked up the jobs before Azure did. Easy fix: just make sure no exes are running outside of Azure!
In our case the web app was published to physical path /site/www instead of the default /site/wwwroot, because of this the Azure web portal interface adds the WebJobs to folder /site/jobs, but the webdeploy via VS or Azure are still trying to publish the webjobs inside the /site/www.
More details at Publishing WebJobs with Azure Pipelines

Resources