Not able to deploy in Azure Production Slot - azure

I have a Linux Virtual Machine, I am able to deploy the app in the cloud service staging slot but not able to deploy it in the production. I am deploying the app through Eclipse, getting the following error
Failed : BadRequest: This operation cannot be performed on a
deployment containing virtual machines.

You can turn on logging and troubleshoot it by getting details from FTP.
Also, if you are using slots, the native deployment procedure is just a swap between Stage slot and Production slot. It will be done very quickly.

Related

Azure release pipeline keeps adding ".scm" to the appservice's URL

I have an appservice called compspiadev, and I am using Azure's Pipelines to set-up CI/CD. Created the build pipeline and build the project into an artifact to use it in the build pipeline. When I try to deploy I get the following error:
Now my appService doesn't have the ".scm." part in it, and in my configuration I don't set the name to have the KUDU endpoint it adds it automatically:
How can I fix this issue for it to deploy correctly?
Your guess is correct. That is an network error which is because our Azure devops Hosted agent could not connect to the internal deployment endpoint of ILB ASE. (As I mentioned in this ticket, I checked your app from our backend and found it is connecting to ILB ASE.)
You can check this source code (actual working code snippet, I can not help you locate the exact code line since I don't know witch deploy method you used), and you will found that the process of Azure app deployment via Azure app service deploy task is actually the process of communicate with app files to Kudu service (xxx.scm.azurewebsite.net).
For example, if you are using Run from package type to deploy your web app, you can refer to this code snippet.
After you configured ILB ASE, per this doc, the scm site is only available at <appname>.scm.<asename>.appserviceenvironment.net. But you should have known that Hosted agent is a dynamic-distribution Azure VM that is neither in nor connected to the virtual network.
That is why you encountered the error like could not connect to the remote computer <appname>.scm.<asename>.appserviceenvironment.net.
To resolve this issue, you need use private agent to execute your deployment pipeline. For how to configure a valid self agent so that it can communicate with your private DNS, you can follow this reply or this blog.
As is visible in (the URL part of) the error message in your first image, you're deploying to an App Service Environment (which is something of a special cookie).
The Azure App Service Environment is an Azure App Service feature that provides a fully isolated and dedicated environment for securely running App Service apps at high scale.
As we can see in the second image, you don't have the checkbox "Deploy to Slot or App Service Environment" checked.
Check that checkbox, specify the Resource Group name, leave slot name set to production and you should be good to go.
If the deployment target is an Azure App Service environment, leave the slot name as production and specify just the Resource Group name.
Source: Azure App Service Deploy task - Prerequisites for the task

In Visual Studio 2019, how to force deploy Azure App Service even if the app service is still running

From Visual Studio 2019 I publish my ASP.NET Core 2.1 WebAPI to Azure.
The publish fails with this error message.
Web deployment task failed. (Web Deploy cannot modify the file 'xxxx.dll' on the destination because it is locked by an external process. In order to allow the publish operation to succeed, you may need to either restart your application to release the lock, or use the AppOffline rule handler for .Net applications on your next publish attempt. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_FILE_IN_USE.)
If I manual stop in the App Service in Azure and then publish, the error does not appear.
Problem happens intermittently.
As a common practice, you can a new task on Azure Devops pipeline to stop the WebApp and restart the WebApp when deployment is done.
If you don't have downtime You can configure the Azure Web App to have multiple slots. Slots allow you to safely deploy your app and test it before making it available to your customers.
Also check Blue-Green Deployment with AppService

Using azure app service with webpack+nodejs without long deployment outages

I'm trying to use webpack with my (fairly large) NodeJS app, deploying as a Windows Azure App Service using Git continuous deployment.
I customized my kudu deploy.sh script to run webpack, but it takes several minutes to webpack on Azure App Service, and the app is unavailable during that time. On my dev laptop, running webpack only takes about 30s (which I could accept as a deployment outage time), but I'm guessing the laptop using an SSD is making this run much faster?
If I was using a deploy script, I'd just run the webpack on my dev machine and push the results to the server, but I'm using git for continuous deployment, and I don't want to commit constantly-changing webpack-generated code to the Git repo.
Is there any way to run webpack-on-deploy with Azure App Service-base NodeJS apps without such a large outage time while deploying?
Instead of reducing deployment outage time try leveraging deployment slot to prevent the app unavailable during that time.
Per Azure's documentation,
Deploying a web app to a slot first and swapping it into production
ensures that all instances of the slot are warmed up before being
swapped into production. This eliminates downtime when you deploy your
web app. The traffic redirection is seamless, and no requests are
dropped as a result of swap operations. This entire workflow can be
automated by configuring Auto Swap when pre-swap validation is not
needed.
How to add a deployment slot to a web app, please refer https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-staged-publishing for details.

Azure Cloud Service (Classic) Staging slot fails to start, and gives no errors

I have inherited a project running on Azure's Cloud Service (Classic). I have a build of the app that, when pushing to the staging slot, will not launch the staging slot. I can find no errors anywhere in the table logs or activity log stating a failure of any kind. The activity log actually shows Write DeploymentSlots Accepted. The staging slot sits with blank information.
There is also a "test" environment set up for this app, and the same build pushed to that starts with no issue. As far as I can tell the two environments are identical.

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