I am working on macOS with an external text editor (NOT VisualStudio).
I have an asp.net project that I push to my app service using
git push azure main:master
the remote is configured as such https://$name:[email protected]:443/name.git
when I go to the web jobs section in the app service to add a web job, I get the error message:
I want to continue using my source control push method while developing…
however I would also like to add a csharp console webjob .
I have followed the tutorial here (A) https://learn.microsoft.com/en-us/azure/app-service/webjobs-sdk-get-started, and have a functoining console app that consumes a message from a queue.
How can I push this extra console app to my Kudu instance?
I read here that there is a ‘hidden’ structure not in the main doucmentation (A) I linked above for the tutorial: https://github.com/projectkudu/kudu/wiki/WebJobs.
Do I have to manually zip the result of dotnet publish -c Release
to some Kudu folder? Or is there a more elegant way by somehow including this project inside my git repo that I push normally… or using an az cli
tool to push the webjob to the app?
2
Answers
Found a way to push directly using az cli
for larger programs in .net I just dumped the project on Kudu, unzipped, and rebuilt (I'm on a mac m1 so can't build against x64 without some hoops, this was easier workaround)
then on the app service (using kudu cmd/powershell)
I created the Web Job and tried to Add it from App service, got the below error.
Using Azure CLI, we can deploy our Web Jobs to App Service
Web Jobs need to be deployed to the below folder in KUDU Console, Create a folder with Web Job Name in the below path
wwwroot
folder path will be read-only mode, we need to enable it by setting WEBSITE_RUN_FROM_PACKAGE to 1WEBSITE_RUN_FROM_PACKAGE
to 1 in WebApp => Configuration => Application Settings or run the CLI command to set it.We can FTP / Use Build Pipelines/ Zip Deploy.