Unable to download artifact from Azure DevOps "IIS Web App Deploy" Task - iis

Suddenly my Release pipeline were taking so long to download artifact and never completes it so my option is to only cancel it. I'm using Deployment Group Agent to deploy my .Net Core web app to IIS. Does anyone encountered this issue and any fix to this? I can't see any status or logs on whether it is downloading artifacts, so I totally don't know what is happening. I tried to remove the vsts agent on services then redeploy again a new vsts agent but still unable to download the artifact.
OS: Windows Server 2016
.Net Core APP
IIS 10
IIS Result, I cancelled it because I'm not sure if it is downloading the artifact
Release Pipeline for IIS using Deployment Group Agent

Turns out this is a network issue. Opening firewall rule port 443 or 8080 for vstsagent might help fix the problem.

Related

Azure DevOps IIS Deployment failing

I have a release pipeline to deploy my ASP.NET MVC web app to Azure VM. I have configured the release pipeline and everything was working fine.
But all of a sudden, it started throwing the error shown here. I am using IIS Web App deployment tool for this in Azure DevOps:
Looks like it's been reported as an issue related to a new task versions for WebAppDeployment tasks. See here, you might find a workaround that will work for you: https://github.com/microsoft/azure-pipelines-tasks/issues/17634

How to deploy a desktop application to a physical server using Azure Pipelines?

what I did;
I have my c# windows form application on Azure Repo and I created a build.
I assigned my physical test server to Azure DevOps under the Deployment groups page. And it is online.
I defined a release, I added an artifact that refers to the build pipeline from the Azure repo.
Now I want to transfer my windows form app release files to my physical test server (windows) under the Desktop folder and run. (also stop and delete previous app if it is already running)
For that, I tried to add a stage. But for the stage templates, I don't know which one to choose. There are deployment options for IIS and Azure services.
Bufre, I published my ASP.NET app using IIS website deployment. Worked fine. But how to do it for a desktop application? How to transfer and run?
I see a as a similar issue here, But I am new to YAML files and I could not produce.
Where to mention target physical path, which template to choose? Could you please advise on the steps?
You must install the DevOps agent on this server, then add it to the agent pool and then use any task that allows to install your app (depends on what kind of app you have). All tasks will be executed on the server directly, so you can use PowerShell, cmd or what ever.
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/v2-windows?view=azure-devops
https://learn.microsoft.com/en-us/azure/devops/pipelines/agents/pools-queues?view=azure-devops&tabs=yaml%2Cbrowser

How to Start/Stop IIS on the target Windows server before deployment in Azure Devops Pipeline

I created the step in Azure Devops to Start and Stop IIS Website but it is failing with below error message:
**2020-05-23T10:28:04.7393424Z ##[section]Starting: Start
2020-05-23T10:28:04.7659676Z
2020-05-23T10:28:06.5436980Z ##[command]"C:\Windows\system32\inetsrv\appcmd.exe" start site /site.name:"taxrpt-deva"
2020-05-23T10:28:06.6132349Z ERROR ( message:The W3SVC service is not available - try starting the service first. )
2020-05-23T10:28:06.7434786Z ##[error]Process 'appcmd.exe' exited with code '50'.
2020-05-23T10:28:06.7680874Z ##[section]Finishing: Start
**
Azure IIS Web App Manage Screen Shot
How to Start/Stop IIS on the target Windows server before deployment in Azure Devops Pipeline
According to the image you provided, you are using the Deprecated task IIS Web App manage:
To resolve this issue, please try to use the task WinRM - IIS Web App Management.
Hope this helps.
As per the first line of question, you want to stop the IIS website infact rather than IIS.
The simplest way is to create a blank file 'App_Offline.htm' in the deployment directory. Official reference link.
I assume that as you want to stop the IIS/webapp you should have access of the deployment directory. This approach should work even if your azure devops Agent is running on other network machine. This file will shutdown your application and after deploying the build artifacts you may run powershell command task to delete that file from the shared directory like shown in the sample:

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

ERROR_DESTINATION_INVALID in windows Azure

I have created simple MVC4 website for windows Azure by following this tutorial: https://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/
At step-8, where I am supposed to "Validate Connection", I get an ERROR_DESTINATION_INVALID error.
Editor: Visual Studio 2012 (Winsows Azure tools SP1)
OS: Windows 7
Tried restarting Studio and restarting computer options. Also tried recreating website in manage.windowsazure.com
Logs:
Start Web Deploy Publish the Application/package to https://waws-prod-bay-001.publish.azurewebsites.windows.net/msdeploy.axd?site=trackme ...
2>Starting Web deployment task from source: manifest(C:\.SourceManifest.xml) to Destination: auto().
C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v11.0\Web\Microsoft.Web.Publishing.targets(4377,5): Error ERROR_DESTINATION_INVALID: Web deployment task failed. ( Could not connect to the remote computer ("waws-prod-bay-001.publish.azurewebsites.windows.net"). Make sure that the remote computer name is correct and that you are able to connect to that computer. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_DESTINATION_INVALID.)
As your publish from VS is not completed due to this error, there are couple of things which could go wrong.
Based on error info it seems the connection to Windows Azure Websites deployment server was unsuccessful. I just pinged the waws-prod-bay-001.publish.azurewebsites.windows.net deployment server and got the IP address so would you please check and verify if you get the same. Also you may need to verify that there are no networking issue which could cause this problem.
Also if you have SQL Database configured with your publish profile then there are two servers needs to be connected during deployment. So if this error occurred when you have had SQL Database configured or before that? Sometime this error is sporadic so you may have to consider as well.
If web deploy fails, publish using FTP. You can download publish settings for you site from Azure portal, under dashboard, click "Download the publish profile". In Visual Studio, when you publish, select Profile, and then Import. Import the settings file. Then unselect the Web Deploy and select the FTP deploy. This worked for me when Web Deploy refused to work (even with the downloaded web deploy settings).

Resources