Azure Devops Release not update Azure WebApp - azure-devops

I did an initial deployment to an Azure WebApp on Linux via a direct publish from Visual Studio. The code just echoes out some text and the page comes up successfully. I can update the text in the code and re-publish. And the new text displays on the web.
Now I am trying to deploy it via Azure DevOps rather than a direct publish from Visual Studio. I created a rudimentary build and release pipeline in Azure DevOps.
I updated the text echoed out in the code then ran the build pipeline followed by the release pipeline. The Deployment status says that everything was successful. I went through the logs as well and there are no error messages. However, the website page text has not changed. Also restarted the App Service in Azure but the change is not reflected.
The release pipeline has one artifact which is linked to the latest build. And one stage which is "Azure App Service deployment" with the right subscription and the right App Service Name linked.
Release Pipeline
Any idea what I might be missing?
Here is the output from the deployment step -
Blockquote##[section]Starting: Deploy Azure App Service
==============================================================================
Task : Azure App Service deploy
Description : Deploy to Azure App Service a web, mobile, or API app using Docker, Java, .NET, .NET Core, Node.js, PHP, Python, or Ruby
Version : 4.163.9
Author : Microsoft Corporation
Help : https://aka.ms/azureappservicetroubleshooting
==============================================================================
Got service connection details for Azure App Service:'myAppName'
Package deployment using ZIP Deploy initiated.
Deploy logs can be viewed at https://myAppName.scm.azurewebsites.net/api/deployments/xxx/log
Successfully deployed web package to App Service.
Successfully updated deployment History at https://myAppName.scm.azurewebsites.net/api/deployments/xxx
App Service Application URL: https://myAppName.azurewebsites.net
##[section]Finishing: Deploy Azure App Service
Thanks in advance, Jake.

I was able to create an empty Azure Service directly within Azure. Then pushed the code to this new Azure Service via DevOps. Now it seems to be working as expected. Only other difference is that I had created this as an App for Windows rather than App for Linux. Anyway, the update is working now.

Related

Azure Devops App Service Deploy Task Not Work Suddenly

I use [Azure App Service deploy] task in Azure Devops pipeline to deploy the artifact to an Azure App service.
Everything worked well before but today it not work suddenly. It failed when i tried to deploy the artifact to the production slot (the slot marked production). But when i tested to deploy to deployment slots, it worked well.
I just got an error message that has no much detail in the log
Cleaning up temp folders from previous zip deployments and extracting pushed zip file C:\local\Temp\zipdeploy\534hsvxr.zip (80.94 MB) to C:\local\Temp\zipdeploy\extracted
[error]Failed to deploy web package to App Service.
[error]Error: Package deployment using ZIP Deploy failed. Refer logs for more details.
Anyone got the same issue before?
Thanks
It seems to be a source control issue. Just try going to the App Service Deployment Center blade and click "Disconnect" to disconnect your deployment. And then try to deploy it again.

After Azure DevOps release pipeline of a Java web app in App Service, URL still shows the default page

I am new to Azure DevOps. I am trying to perform small home lab projects. One of them is to deploy a "Greetings from Spring Boot!" web app in Azure Web App service with Azure DevOps pipelines, build and release.
I got the source code (Spring boot web app) from a YouTube tutorial and performed the tasks in the tutorial but using GitHub actions (Azure Portal/Home/Resources/select my App Service/Deployment Center/Settings/ configure as source a GitHub repository where my code is). This way was fine. The web page https://my-app-name-just-example.azurewebsites.net/ is showing the message in my source code, "Greetings from Spring Boot!".
But when I try to use Azure DevOps build and release pipelines on the same Azure Web App resource, accessing the URL shows the default web page "Hey, Java developers!". Both build and release pipelines show successfully completed.
https://imgur.com/a/thiMfBQ
From the Azure DevOps build release I downloaded the jar file (demo-0.0.1-SNAPSHOT) and ran it locally on my PC (java -jar \path\demo-0.0.1-SNAPSHOT) and http://localhost:8080/ displays the message in my source code. This means the build pipeline was correct. When I configure and run the release pipeline using as source the build from the build pipeline, the release pipeline shows successfully completed but the web app URL still shows the the default web page "Hey, Java developers!".
I checked https://my-app-name-just-example.scm.azurewebsites.net/wwwroot/ and the demo-0.0.1-SNAPSHOT.jar is there. I stopped and started the Azure Web App too.
Any suggestions? Thank you.
#Jason Pan, Thank you very much for the solution.
I used as a solution the startup command in a new Release pipeline configuration. In my case: "java -jar /home/site/wwwroot/demo-0.0.1-SNAPSHOT.jar --server.port=80". I noticed the name of the artifact in my case from the Build pipeline is artifactId+version from the pom.xml file, so demo-0.0.1-SNAPSHOT.jar .
Then I edited my release pipeline with this startup command, saved it, deploy it and I could see the in the Release pipeline /Initialize job logs the message "[PARAMETERS_STARTUPCOMMAND] --> [java -jar /home/site/wwwroot/demo-0.0.1-SNAPSHOT.jar --server.port=80]" . Deployment was successful. And now Web App URL shows the content of the source code, "Greetings from Spring Boot!". Previously it was showing the default content, the "Hey, Java developers!".
Thank you again.
You can add startup command on portal.
Like :
java -jar /home/site/wwwroot/app.jar --server.port=80
For more details, you can reader offical doc and related post.
1. Built-in images
2. Unable to start spring boot application deployed as a jar
3. Deploy a Spring Boot Gradle application to Azure App Service from an Azure Pipeline

Azure Function deployed successfully, but not working

I am facing a weird problem. I deployed my code using Azure DevOps Pipeline Release - it ran successfully, however, the code is not reflecting in Azure Function App.
Here is what I am doing:
Created a Release pipeline with a "Deploy Azure App Service" task. It picks up artifacts from a build pipeline and is configured to deploy to a Function App using Service Connection
When the Release pipeline is triggered it runs through all its steps, and I get a success (see logs below)
However, when I open up Azure portal and navigate to the Function App, it continues to say "Now it is time to add your code" on the Overview tab, and I am not able to hit my API on that Function App
Surprisingly, On the Deployment Center tab of the Function App, it does show the details of the deployment (See details below)
I can also find the deployed zip file under D:\home\site\wwwroot when I log on to the Kudu console
Deployment logs:
Got service connection details for Azure App Service:'myFuncApp'
Updating App Service Application settings. Data: {"WEBSITE_RUN_FROM_PACKAGE":"1"}
Updated App Service Application settings and Kudu Application settings.
Package deployment using ZIP Deploy initiated.
Successfully deployed web package to App Service.
App Service Application URL: http://myFuncApp.azurewebsites.net
View on Function App Deployment Center Tab:
Deployed Successfully to production
Source Version 6d9c8340ba Build 20190411.1 Release: 3
The Function App endpoint is working, (throwing a generic welcome page) confirming the Function App itself is healthy, but I am not able to access my API.
Additional updates
Here is the structure of the .zip file that is being uploaded to d:\home\data\SitePackages as a part of the zip deploy from Azure Pipelines:
/host.json
/package.json
/proxies.json
/package-lock.json
/func_name/index.js
/func_name/function.json
/node_modules/**
The same code is working locally.
Note: When I go to the Deployment Center tab, I do see this error message, but I think this is related to Continuous deployment through Function App
We were unable to connect to the Azure Pipeline that is connected to this Web App. This could mean it has been removed from the Azure Dev Ops Portal. If this has happened, you can disconnect this pipeline and set up a new deployment pipeline.
Please help me. What can be going wrong?
I was finally able to troubleshoot. #4c74356b41 pointed me in the right direction as the key issue was the package.
Below was the issue:
I had added an archive step in the build pipeline. This was causing the artifact to be zipped before publish
In the release pipeline I was using Azure App Service Deploy task. This internally uses Zip Deploy where App type is set to Azure Functions. Thus, it was zipping my zipped file.
When I remove the archive step, the double zipping was avoided, and it started working.

How do I deploy to an Azure Web App on Linux using Azure DevOps?

The docs have a link to Deployments > Azure Web App on Windows but no link to Azure Web App on Linux.
[Update]
Here is my latest attempt
It is not possible to data enter the app service name.
[Update]
It turns out that the order of filling things in matters.
Once I filled in the settings for the pipeline task then I could enter data in the Azure App Service Task.
The Azure App Service Deploy task supports Web App on Linux app service type, so you can directly deploy Azure Web App on Linux through this task. See Deploy: Azure App Service Deploy for details.
The Azure App Service Deploy task is used to deploy to a range of App
Services on Azure. The task works on cross-platform agents running
Windows, Linux, or Mac.
Reference this similar thread : VSTS Deploy to Azure WebApp For Linux
And you can also reference this article for the deployment: Docker Deployment to Azure App Service (Linux) using VSTS

AzureRM WebJobs Deployment with Release Management on Visual Studio Team Services

I'm trying to deploy AzureRM Webjobs with VSTS Release Management and haven't been able to find a good solution for it other than uploading it via FTP. This way works, but doesn't handle when the schedule of the job changes. Every solution that I've found so far refers to Classic Webjobs which won't work for jobs deployed to Resource Manager.
DavidDebbo created a sample for how to publish webjobs with ARM template here: ARMTemplates/WebAppWithWebJobs.json. You can refer to this for details.
Besides, you can simply add an AzureRM Web App Deployment task in your release definition to deploy your webjob via Azure Resource Manager if you can see this task in task list.
The AzureRM Web App Deployment task is used to deploy Web Apps and
WebJobs to Azure. The task works with the Azure Resource Manager APIs
only. The underlying technology used by the task is Web Deploy.
The task is under development and is available to a limited set of
accounts on Visual Studio Team Services (VSTS). The video describes
the features that are available in the task currently.