How do you overwrite the msdeploy parameter setParam:name='IIS Web Application Name',value when deploying from VSTS - azure-devops

I am able to deploy a website to a VM in AWS using VSTS. My code is hosted in git on VSTS. When I deploy using IIS Website. In the IIS Web App Deploy
In Additional Arguments I specified -setParam:name='IIS Web Application Name',value='Default Web Site\TestVSTS. But it still gets deploy to 'Default Web Site'
And on the log file on VSTS i can see the command not getting overwriten with my command. Any body having the same issue ?
Log File Command being executed by vsts :
C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" -verb:sync -source:package='C:\vstsagent\A2_work\r3\a\temp_web_package_2238626544802922.zip' -dest:auto -setParam:name='IIS Web Application Name',value='Default Web Site' -enableRule:AppOffline -enableRule:DoNotDeleteRule
Update : Set WebSite to "Default Web Site " and Virtual Application to "TestVSTS" Still did not work. Look Below to see what I did and it did work
Update this Work

The IIS Web App Deploy task has already included –setParam parameter.
Based on the parameter, you want to specify web application name, you just need to specify Website Name (Default Web Site) and Virtual Application (TestVSTS) in IIS Web App Deploy task.

Related

TFS-2017 web interface issues

I have created a release pipeline in TFS web interface. Instead of default website, I have created a new website in IIS in dev server.
How to configure this website in IIS WEB APP MANAGE and IIS Web App Deploy what is the path I have to give in Virtual Application in IIS WEB APP MANAGE and IIS Web App Deploy in TFS web interface.
IIS Web App Manage:
Creating an IIS Web Site and Application Pool. Typically this is only needed the first time deploying to a target machine.
Example: To create an application Site/Application enter /Application as the Virtual path . The parent website should be already existing.
IIS Web App Deploy:
If you have created the web site/application, then you just need to deploy it directly with IIS Web App Deployment task.
You can reference this thread : https://stackoverflow.com/a/45706103/7466674

Where is the documentation on how to deploy .Net Core apps to Azure Webapps thru VSC?

There is documentation on creating and deploying 'Hello World' in Node.Js and deploying it in an Azure Webapp.
https://code.visualstudio.com/tutorials/app-service-extension/create-app
But there isn't documentation on doing the same with .Net Core. I have the 'Hello World' console app as per this.
https://code.visualstudio.com/docs/other/dotnet
I also have the 'Azure App Service' extension installed. How do I deploy the 'Hello World' to Azure Webapp.
I tried Github also. But they closed issue without action.
https://github.com/MicrosoftDocs/azure-docs/issues/10044
How do I deploy the 'Hello World' to Azure Webapp.
We need to deploy the Web Application to Azure not console Application. I do a demo to deploy .net core webapp to Azure through VS code.
The following is detail steps.
1.Create a MVC web application with dotnet command.
dotnet new mvc
2.Publish the project to the local path.
dotnet publish webprojectName.csproj --output localpath
3.If Azure WebApp extension is installed, login with Azure account then you could create azure webapp and deploy the project to your Azure web
4.Select the created/existed Webapp and select the directory(published output local path) to deploy.
5.Check the output from VS code and browser the WebApp.

How deploy .NET Core web application via Visual Studio Team Services to hosting with IIS

I would like to deploy my .NET Core web application via Visual Studio Team Services to hosting with IIS.
I have tried to discover the possibility of deployment the final release but I don't know what type of task I can use.
I usually used the deploy via Visual Studio 2017 and using publish proccess with MSDeploy and setup profile like this:
<publishData>
<publishProfile
publishUrl="publishUrl"
msdeploySite="site"
destinationAppUrl="destinationAppUrl"
profileName="Default Settings"
publishMethod="MSDeploy" userName="login" />
</publishData>
This site is not running on azure but on shared asp.net hosting.
How can I setup the Visual Studio Team Services - Deploy release if I only know these information?
What type of task is necessary to use?
Since you can deploy it with publish profile, you can to do it in VSTS build/release too.
NuGet restore (2.*) or Dotnet restore task
Visual Studio Build task (MSBuild Arguments: /p:SkipInvalidConfigurations=true /p:DeployOnBuild=true /p:PublishProfile="[profile name]"
You can use IIS Web App Deployment Using WinRM tasks if you have admin account.
If the host supports FTP, you also can upload the published files through FTP task.

VSTS IIS Web App Deploy fails with return 2148734720

I configured releases same way for a couple of our servers but I have issue with one of them (others work perfectly):
[error]Failed to deploy web package to IIS website.
[error]Error: C:\vstsagent\A2_work_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.0.20\MSDeploy3.6\msdeploy.exe failed with return code: 2148734720
Unfortunately I can't find anything helpful related to this error Code.
My release configuration:
IIS Web App Deploy (Preview)
Deployment group with one specific staging server (I'm using on-premise agent)
Website name: correct name of my website in IIS
Virtual Application: empty field
Package of Folder: zip chosen from build drop artifacts
Selected "XML variable substitution"
Selected "Remove Additional Files at Destination"
What I've already tried with no luck:
manually turn of application
delete all files in application folder
changing user account to use for the service
Again - same configuration for other servers works fine.
Servers configuration: Windows Server 2012R2 Standard x64
Looks like I figured it out. .NET Framework 3.5 was missing on my server...
I was investigating logs and I found out that below line is causing failure.
"C:\vstsagent\A2\_work\_tasks\IISWebAppDeploymentOnMachineGroup_1b467810-6725-4b6d-accd-886174c09bba\0.0.20\MSDeploy3.6\msdeploy.exe" -verb:sync -source:package='C:\vstsagent\A2\_work\r2\a\temp_web_package_8269135298977384.zip' -dest:auto -setParam:name='IIS Web Application Name',value='httproot'
So I copied it to CMD and got proper Windows message when I tried to execute it.

Build and Publish ASP.NET Web Site Team Services

How do you go about setting up the build / publish for an ASP.NET web site (not a compiled application).
I have a classic simple site with primarily static assets. The only reason for the site is an aspx page that is used for a contact form email.
Simple steps:
Install IIS Web App Deployment Using WinRM extension if you want to deploy app to your web server
Create new build definition with Asp.Net Build (PREVIEW) template (select ASP.NET Build PREVIEW template when create build definition)
Add Windows Machine File Copy step to copy files to your web server
Add WinRM-IIS Web App Management step to create or update web site in IIS
Add WinRM-IIS Web App Deployment step to deploy app to web site (step 4)
You also can refer to this thread: Automated Deployement of ASP.Net MVC Website In IIS server with a Continuous Deployment
If you want to deploy app to azure, you can add Azure App Service Deploy step to deploy your app to azure (do not install previous extension and remove step 3, 4, 5)
You also can refer to this article: Deploy ASP.NET apps to Azure web apps
What I was looking for was publishing a ASP.NET 2.0 Web Site (not an application that requires a build).
It ended up being pretty easy. I have mostly static files, but there is one aspx page for that is used for a contact form. I followed this solution but tweaked it a bit.
All I needed to do was add the npm and gulp task. My gulp task does as the answer suggests - copies all of my pertinent files to a folder called dist. From there, I copy everything from the dist directory to the $(Build.ArtifactStagingDirectory).
Then it is just a matter of publishing the $(Build.ArtifactStagingDirectory) to the server (a drop directory similar to the examples of building an MVC app).
I wired in the release for CI / CD.