TFS 2018 Release Management to IIS - iis

I am setting up a release for the first time in 2018 Release Management. We have a website that we want deployed to IIS.
The build definition is setup and has created the artifacts. When I setup the release definition I select the IIS Website Deployment template which gives me two tasks.
IIS Web App Manage
IIS Web App Deploy
They seem to cover similar ground, but I cannot find documentation to tell me how they are different. Do I need both?
When I configure IIS Web App Deploy, the Website Name field is grayed out. The link icon tells me
This setting is linked to the 'Website name' (Parameters.WebsiteName)
process parameter.
So I created the process parameter in the release definition and the build definition with a different name. However the Website Name does not update. Is there a way to manually edit this field?

In short:
IIS Web App Manage
This task does provisioning, for example creating an IIS Web Site and Application Pool. Typically this is only needed the first time deploying to a target machine, but there is no harm in running it on every deploy, since it then just skips creating already existing items.
IIS Web App Deploy
This task deploys your code.

You need to create a Deployment Group before using the IIS Website Deployment template. Deployment groups in VSTS/TFS make it easier to organize the servers that you want to use to host your app. A deployment group is a collection of machines with a VSTS/TFS agent on each of them. Each machine interacts with VSTS/TFS to coordinate deployment of your app.
Useful link and blog for your reference:
https://learn.microsoft.com/en-us/vsts/build-release/archive/apps/aspnet/aspnet-from-vsts-to-windows-vm?view=vsts
https://abelsquidhead.com/index.php/2017/11/28/build-and-deploy-to-multiple-iis-servers-and-sql-server-using-vsts/
If you don't want to use this template, you could also try other extensions, such as IIS Web App Deployment Using WinRM.

Both tasks are needed. The website name is set on the Environment level then referenced in all of the tasks within.

Related

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

Octopus Deployment to IIS Pool

So I've got a scenario where numerous different teams are deploying with octopus to local team boxes. Octopus is used to make the deployment. However I'm facing a problem where octopus is deploying to a separate drive to our IIS pool for our web apps.
Is it possible to set IIS to be configured for the alternative path without disrupting the other applications in the pool. It's not an option to change the deployment location as it would disrupt other groups. Because at the moment we're forced to copy it to the correct location after it deploys to the wrong location.
If you are packaging for msdeploy zip file, you should use common msdeploy options. You should add your octopus project iisapplicationname parameter and give it the specificied pool name with environment names. it will be deployed to the correct folders.

How To Update a Web Application In Azure and Keep The App Up the whole time

I've a MVC Web Application (.NET) and from time to time I need to upgrade the deployment version on Azure, the problem is that I have customers that are using the Web-App and I cant take it down and make it unavailable.
There is a way to deploy a new version of my Web-App and still be up and running the all time? (during the deployment process)
One way that I could think of it to do it is by deploy the the Web-App to somewhere other than my current deployment and "play" with the DNS record on my external domain.
Use deployment slots.
Azure Web Apps let you create staging slots for your site. They're effectively independent sites that you can deploy your test/staging bits to.
Then when you have the staging site ready you can push a button and make it your public production site.
See here for more details: https://azure.microsoft.com/en-us/documentation/articles/web-sites-staged-publishing/

powershell website automatic deployment

We are using TeamCity for builds and Octopus for deployment. Octopus uses Deploy.ps1 powershell script for MVC website deployment to IIS.
I am looking for a powershell that can
check if website exists and if not create one
check if appPool exists and if not create one
check if webapplication exists and if not create one with appPool from step2.
Any useful links that show how this deployment can be automated?
Thanks
I think this information might be useful for you.
The IIS Website and Application Pool feature in Octopus allows for a large number of options to be configured during deployment.
..
Web Site
If enabled, Tentacle will use use the PowerShell Web Administration module to attempt to create or modify an IIS Web Site and Application Pool using the settings below.
http://docs.octopusdeploy.com/display/OD/IIS+Websites+and+Application+Pools

How can I use the TFS Online <--> Azure Website integration when there are two web apps in the solution

I am trying to get continuous integration configured using Azure. The process I have followed is exactly as detailed by Continuous delivery to Windows Azure using Visual Studio Online
This process works perfectly! I check-in, it builds, and deploys to the Azure website. However, as soon as I add a second web application to the solution, after the CI build kicks off and then completes, the only thing that gets published to the website is the bin directory of the second web application! (Updates to the first project are successful, though)
Given the scenario, I don't understand why the dll's of the second application are being published to the bin directory when the rest of the application(i.e. content files) are not. There is no reference from app1 to app2 so the dll's shouldn't be brought in by reference.
How can I configure this so that it will also publish the second web application?
You can tell Windows Azure Web Sites which project within a repository to deploy using a deployment file.
Add a file called .deployment to the root directory of your repository, with this content:
[config]
project = src/MyApp.Web
You can specify the folder containing the web application, or the actual .csproj or .vbproj file for the application.
If you have two sites in a single solution/repository and you want to publish them both, you will need to use two separate Web Sites, and use App Settings in the portal to specify the project instead. Create the sites, and for each, add a setting called Project in the Configure page, with the path to the directory or project as before.
More info: https://github.com/projectkudu/kudu/wiki/Customizing-deployments (Kudu is the system that actually handles deployments on Azure Web Sites)

Resources