2

I've inherited an ASP.NET (4.7.2) app that successfully runs and starts on my machine. I'm now trying to deploy it to an Azure App Service via an Azure DevOps Pipeline. In an attempt to do this, I've created an Azure Build Pipeline that includes the following tasks:

NuGet

Restores the packages based on the .sln file

MSBuild

Builds the .csproj that defines my ASP.NET app.

Azure App Service Deploy

Attempts to deploy the ASP.NET app as a "Web App on Windows" to my deployment slot. The "Package or folder" is set to MyAspNetApp/bin.

I can successfully build this pipeline. However, when I visit the URL allocated to my Azure App Service Deployment Slot, the only thing I see is "Hey, App Service developers! Your app service is up and running. Time to take the next step and deploy your code."

So, what am I missing? I would think you should just have to select the .csproj, the app service and the deployment slot. But, it seems more is required. All of the documentation I've found is for ASP.NET Core apps. However, my app is a traditional ASP.NET app.

3
  • You can find the answer here. It's for an Umbraco application but it really makes no difference. stackoverflow.com/questions/55649182/… .Once you're done with the build pipeline you need a release pipeline to deploy your artifacts to IIS Commented May 20, 2019 at 12:33
  • # I have recently answer this question here check it out (stackoverflow.com/questions/56241490/…) Commented May 22, 2019 at 5:45
  • Does the behavior change if you use the publish on build option and assign that path to the Azure App Service Deploy task? I vaguely remember that publish is different from a straight build. Commented May 22, 2019 at 22:14

4 Answers 4

1
+50

You have done only the build step, now you need to deploy the code (artifcats) with the release step to the appservice.

Read the docs as mentioned here

Sign up to request clarification or add additional context in comments.

2 Comments

Doesn't the "Azure App Service Deploy" step deploy the artifacts?
Tecnically yes, but it's not a good pattern, the link proposed by @Sajeentharan have the process end-to-end
0

You need to go with the release steps to deploy the code. Just have a look at this.

Comments

0

The main thing you need to change is how you build your app so you can actually publish it. Publishing it via a separate release pipeline is a best practice which you should consider once your deployment is actually working.

To get a build result which can be uploaded to Azure App Service, you need to set a msbuild argument like this:

 /p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageLocation=$(build.artifactstagingdirectory)\Packages

Or like in this answer.

You can then take a look at the resulting build artifact to see if it worked. You can also do it locally. In my example you get a zip file which you can reference in the Azure App Service Deploy task. And since the zip file is already in the build artifacts, you can easily create a separate release pipeline which only contains the Azure App Service Deploy task once you are comfortable with it.

Comments

0

Yes, we can deploy the app to Azure App Service directly from the build pipeline. Ignoring the concern about best practice and focusing the question yes we can since long using "Azure App Service Deploy" task in the build pipeline.

There is official Microsoft example demonstrating this scenario in Task 4 on this URL

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.