Frank Thomas
Frank Thomas

Reputation: 2514

ADO Release IIS Web App Manage Task Physical Path as an expression

How do I specify the physical path as an expression with a variable like release-n when managing a virtual application in an ADO IIS Web App Manage task?

We're just getting started with ADO Releases to IIS servers. We have IIS Web App Manage and Deployment tasks working, but only to a static physical path on the server.

I would like to store the new releases in versioned directories, and have the virtual application updated to point to the version being deployed.

For example

  Default Web Site
       /card-poc     <-- web application stored outside of wwwroot
           /release-1
           /release-2
           ...
           /release-n   <-- IIS virtual application physical path is pointed to here

So in an ADO Release IIS Web App Manage task, how do I specify the physical path as an expression with a variable like release-n?

I've tried d:\IIS_VDs\CARD-poc\Release-$(rev:r)\ to get the release name, but I get the error

The given path's format is not supported.

The expected outcome is that the directory would be created, the virtual application would be altered to point to the new directory, and then the subsequent IIS Web App Deploy task would copy the files to the new dir. The goal is to allow a server operator to roll back an application to a prior version without knowledge of or access to to ADO, Version Control, or really anything except the IIS server.

Upvotes: 2

Views: 442

Answers (1)

Hugh Lin
Hugh Lin

Reputation: 19471

I tested $(rev:r) and got the same error as you. I think the problem is getting the value of the $(rev:r) variable. I try to Write-Host "$(rev:r)" in the powershell task, but the task cannot get the value of $(rev:r). According to this ticket , it seems $(rev:r) is a special variable format that only works in the Number field in the editor.

enter image description here

As workaround, you can try to use Release.ReleaseName predefined variable.

Release.ReleaseName : The name of the current release. Example: Release-47

enter image description here

enter image description here

Upvotes: 3

Related Questions