How to deploy a C# Console app to Azure App Service using Github Actions - azure-web-app-service

I am trying to deploy a C# Console app. (which inserts data from a third party API to Azure SQL) using Github Actions (push to Azure App Service), and I need some guidance for an option.
I pushed my C# code into Github from my Visual Studio solution in my laptop.
I chose this option ("Deploy .Net Core app to an Azure Web App") at Github Actions:
This is result that I got:
Did I choose wrong option here?
Do I need to create a Web App?

We can deploy the console application into Azure app service using an Azure WebJob. To get complete idea on WebJob. But the performance of the application is not guaranteed. To deploy using Visual Studio. To deploy the application when the WebJob is already created use the link.
To schedule a WebJob
To schedule the WebJob refer the link.

Related

Azure WebApp WebJobs with Azure DevOps Build and Release Pipeline with via .zip

I have a files in azure repro and i need to zip after that i need to
updated into azure webapp to with new webjob with
manually/continuous.
2.I have created Build Pipeline and Release Pipeline. WebJobs are not created in the azure webapp
Kindly please help on this issues if any one knows.
The processes you have taken are just publishing the demo.zip file to the default production slot in your Web App. It is not creating a WebJobs in the Web App.
I am afraid that you have misunderstanding on WebJobs of Web App. It is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app, API app, or mobile app. There is no additional cost to use WebJobs.
To create a WebJob in your Web App, normally, you need to manually add the WebJob in the web UI of your Web App.

Publish single project from Azure Dev Ops to Azure App Service Environment

We have a App Service Enviroment https://learn.microsoft.com/en-us/azure/app-service/environment/intro I have set up an App in but I am struggling to either publish from my machine (I've added the URLs to my HOSTS file and I can see it in a browser) and cant see a clear way to publish it from Azure Dev Ops (my preferred option).
I'd be happy to be pointed to TFM but everything I find is out of date / not near the options I can see in Dev Ios or Visual Studio (2019 / 2019 Preview).
EDIT: Also note this is a multi project solution (various console apps, an API and a website it is the API / Website I want to publish)
EDIT 2: So "its always DNS" it was a DNS issue in trying to publish from Visual Studio
You can check these two links:
https://learn.microsoft.com/en-us/visualstudio/deployment/quickstart-deploy-to-azure?view=vs-2019
https://learn.microsoft.com/en-us/azure/app-service/deploy-continuous-deployment?tabs=github
If you use Visual Studio, see: Deploy an ASP.NET Web App in Azure App Service.
If you use Azure pipeline, this doc: Deploy an Azure Web App provides a tutorial to build web app and then deploy to an Azure Web App. Also see this video for detailed guidance: Build and deploy to an Azure Web App using VSTS (Quick Starts).
BTW, there are a few useful tools: Azure DevOps Labs, Azure DevOps Services Demo Generator, and DevOps Starter which will help you to get started with Azure DevOps services to automate software delivery and meet business needs.

Azure function app deploy and release pipeline error

I pushed my .net core function application using visual studio and now setting up release pipeline. I can publish and execute the application just fine and it works great on the Azure portal. However when I see the builds for releases in azure-devOps that slot fails with the following error.
2019-06-19T23:21:33.3543380Z ##[error]Error: Deployment of msBuild generated package is not supported. Change package format or use Azure App Service Deploy task. D:\a\r1\a\_...AVFunctionCore.zip
I am not sure where I need to check in my setup to even start diagnosing the issue.
Here are the pipeline steps.
I create a new stage and then select a template of type (Azure app service deployment)
Under tasks
App type is Function App on Windows
Give the app name, resource group , give the slot and
package folder as
$(System.DefaultWorkingDirectory)/**/AVFunctionCore.zip
Everything else on this is left as default.
Azure function app deploy and release pipeline error
According to the error message:
Deployment of msBuild generated package is not supported. Change
package format or use Azure App Service Deploy task.
It seems you are not using the correct task to publish the generated package. Since the generated package is .zip, you can try the suggestion as error message said use Azure App Service Deploy task.
Azure App Service Deploy task:
Use this task in a build or release pipeline to deploy to a range of
App Services on Azure. The task works on cross-platform agents running
Windows, Linux, or Mac and uses several different underlying
deployment technologies.
The task works for ASP.NET, ASP.NET Core, PHP, Java, Python, Go, and
Node.js based web applications.
The task can be used to deploy to a range of Azure App Services such
as:
Web Apps on both Windows and Linux
Web Apps for Containers Function
Apps on both Windows and Linux
Function Apps for Containers
WebJobs
Apps configured under Azure App Service Environments
Check this blog Visual Studio 2017 Tools for Azure Functions and Continuous Integration with VSTS for some more details.
Hope this helps.
I get predefined pipeline from VS integration. So for those you have the same case:
In GUI/Classic mode Release page -> edit pipeline
Edit task in stage section (this is responsible for deploying)
Replace Azure Web App task with Azure App Service deploy
I have more than one project (web api + azure function) in my solution. For the web app I used the zip file, but for the azure function to work I needed to publish the whole folder.
Azure Function
Package or folder:
$(System.DefaultWorkingDirectory)/_Backend/drop
Web Api
Package or folder:
$(System.DefaultWorkingDirectory)/_Backend/drop/ClientAPI.zip

Deploy and schedule console application in Azure

I got a web scraping tool developed using C# console application and Selenium Chrome driver.
Is there an option to deploy and schedule to run daily in Azure platform?
Is there an option to deploy and schedule to run daily in Azure
platform?
Yes. You can deploy your console application project to a web App service as an Azure Webjob.If you're unfamiliar with Azure Webjob, you can see details in this wiki. But I'm not sure whether your application can still work well, because it depends on your application itself and running environment sometimes.
You can use Visual Studio to deploy it. You can follow this tutorial to achieve that.
If you have already created a Webjob and want deploy it to Azure, you can refer to this blog.
Schedule the Webjob:
When you deploy the Webjob, you can use CRON to schedule your Webjob.

Continuous deployment from Visual Studio Team Services to Azure App Service

I'm trying to automatically deploy from Team Services (was Visual Studio Online) after a successful build a C# program to an azure app service without success.
I can only do it to a cloud service (classic) rather app service.
I've seen that I could plug Team Services directly to the app service with "deployment source" (I did tried so far because both tenant, Team Services & Azure one are different and requires some effort)
but wouldn't it break the normal release / test process from Team Services?
I can only find little information over internet regarding these topics ...
Any help would be appreciated.
You can also add a FTP Upload task in your build definition to publish the output to Azure App Service via FTP Method.
To publish to an Azure App Service, you need to use either of the following Agent tasks:
Here is a walkthrough: https://www.visualstudio.com/en-us/docs/build/apps/aspnet/aspnet4-to-azure
When making a new build definition, it is easiest to choose the Deployment -> Azure WebApp option.

Resources