I am trying to deploy a .Net Core application that uses CEFSharp to a app service on azure.
When I publish from VS2019 using a publish profile targeting azure, all necessary files for CEF to work are copied over to the app service and the application works.
If I try to publish using Devops pipeline all the file for CEF are not copied over to the app service and the application does not work.
These are the basic steps I have on the Pipeline
This are the steps I have on the publish
Can anyone help me with ideas why this is happening?
Related
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.
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.
Ive built an app using this template.
This is the project structure:
The angular app is in the folder ClientApp
Id like help wioth a Azure Dev OPs pipeline for UAT and Production to:
build the angluar app and .net app,
run the tests for both angular and .net
deploy to azure
run db code first migrations
Any help or resources would be great, im surprised there not a template yaml file for this already tbh.
I thought this being the built in template shipped with visual studio there would be more resources for it but I cant really find anything useful
Ive already tried following this https://www.codeproject.com/Articles/5286555/Setting-Up-a-Build-and-Release-Pipeline-for-ASP-NE but kept having failures on the restore step and i dont think its very clear either
Thank you
Please make sure that your project can be built and tested fine locally, and then connect it to Azure DevOps service, so push this local repository to Azure Repos.
Following this doc: Continuous integration and deployment to configure the Azure pipeline. You need the npm task to install the dependencies before dotnet restore step.
See: ASP.NET Core 2 + Angular -> how set up VSTS? and Create a build pipeline for Angular and ASP.NET Core apps with Visual Studio Team Services for more guidance.
Try to verify my YAML file
https://github.com/felipementel/AzureDevOps-YAML/blob/main/src/dotnetCore_Angular-AppService.yaml
after configuring your Azure DevOps Pipeline with YAML file, you still need to change the Physical Path in your App Service.
Check the image bellow
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
I have 2 webAPI’s written in .net core 2.2.The 2 web api’s are triggered by web jobs which are console Apps in .netcore 2.2. They are all different projects and in different repositories in Azure DevOps.
I am trying to deploy the web Api's together with the webjob into 2 web app services(eg: WebApi1 + Web job1 into App service1 and WebApi2 + Web job2 into App service2) in Azure using the Azure DevOps build and release pipelines.
I am able to add the webjobs manually into App Service from Azure portal and it works fine.But I want to deploy it using Azure DevOps pipelines.
I tried different ways to publish the web jobs(console apps) with the web api in the app service, like trying to publish it to App_Data folder from Azure DevOps.
I mainly followed the blog below.
https://www.andrewhoefling.com/Blog/Post/deploying-dotnet-core-webjobs-to-azure-using-azure-pipelines
But when I try to publish the webjob it overwrites the web api code(all the 4 projects have seperate build/release pipelines). The webjob code gets deployed in the site/wwwroot folder rather than the site/job folder.
My Build steps:
My Release steps:
I am not sure what I am doing wrong.
Is there a way to copy the webjobs files into the same app service without overwritting the actual webapi code?
I asked this question a while on github repo azure-webjobs-sdk but the answer didn't help me as well...
i tried the following and it worked out for me:
In Azure Portal navigate to: App Service > Configuration > Path mappings > Virtual applications and directories
In DevOps configure your build pipeline like:
configure your release pipeline like:
configure the task:
I got it working by following below steps sequentially -
Deploy Webjob using App Service Deploy task which has below setting for deployment method -
Deploy API using App Service Deploy task which has below settings -
After these two steps, API and webjob work seamlessly in same app service.