Azure Functions: deployment from Git does not work with .NET 7 - azure

I have configured Deployment from Azure DevOps Git for my Azure Functions project (runtime: dotnet-isolated). It executes successfully, but no functions are created/visible in Azure portal. When I compare it to the production slot (deployed from VS Code) in service editor I see different project structure, see screenshots.
Deployed from Git:
Deployed from VS Code:
Git deployment output:
Is this a bug of Azure or do I do something wrong? All logs look fine, what else can I check?

Related

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 console webjob app to azure App service containing a webapi using azure devops pipelines

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.

How to deploy to azure app service from VSTS?

I have nodejs app. Can I deploy it to azure app service without VS or other big IDE?
So, I want an easy way to select branch what I need push it to azure and run default command for nodejs.
I'm stuck with it, because all of solution it is use VS.
You can deploy to azure app service by using Azure App Service Deployment step/task. For example:
Create a build definition
Add related step/task to build your project
Add Azure App Service Deployment step/task (Can publish using Web Deploy or upload files directly)
Select Triggers tab and enable Continuous Integration
Specify repository and branch filters
After that, the build will be triggered if you push changes to target branch.
Related article: Define a continuous integration build for your Node.js app
Regarding run command for nodejs, you can refer to this thread by using kudu API: Include node modules in azure deployment via VSTS.
This can be done. Take a look at the build and release functionality in Visual Studio Team Services.
With VSTS Build, you can trigger a build and push to an Azure Web App automatically on a Git check-in for a particular branch, or you can manually trigger the build and push.
Take a look at the Azure App Service Deploy task in VSTS build.
Note that since VSTS is pulling from your Git repo, it doesn't matter what IDE you use to actually develop your app with.
Also, VSTS is free for small teams and a single deployment pipeline.

How to deploy an angular2 application as a webapp in azure

Can someone help me deploy an angular2 application as a webapp in azure. I have a github enterprise setup. On my Jenkins server, I would like to do a no build. On successful completion of the build, I'd like to push it to a webapp.
Every deployment I attempted, failed on npm of one form or other. I don't want to create a VM and deploy a server.
I'd appreciate any help on this.
Deployment of all supported web applications to azure web app service ( PaaS and not IaaS VM as per your requirement) is possible by the following options
from git CLI you can publish the code from your local repository to azure.
linking an online repository like bitbucket, gitlabs to azure
Powershell - publish code from your local repository to azure
Azure CLI - publish code from your local repository to azure
FTP option is available as well.
Check out this post to see how you can publish using git commandline https://learn.microsoft.com/en-us/azure/app-service-web/app-service-deploy-local-git

Azure Continuous Integration for Web Apps Not Deploying to Deployment Slot

I am using the AzureContinuousDeployment.11.xaml template to build and deploy to a staging Deployment Slot. This is for an Azure Website. The build runs and executes successfully. However the code is not being deployed to the staging slot. I have included the Web Deploy Publish Profile in the configuration. I am not getting any errors and it said that it has completed. What am I doing wrong?
As info, I've been following this guide:
Azure Deployment Slots

Resources