Deploy: IIS Web App Manage

Create or update a Website, Web App, Virtual Directories, and Application Pool

YAML snippet

# IIS Web App Manage
# Create or update a Website, Web App, Virtual Directories, and Application Pool
- task: IISWebAppManagementOnMachineGroup@0
  inputs:
    #enableIIS: false # Optional
    #iISDeploymentType: 'IISWebsite' # Options: iISWebsite, iISWebApplication, iISVirtualDirectory, iISApplicationPool
    #actionIISWebsite: 'CreateOrUpdateWebsite' # Required when iISDeploymentType == IISWebsite# Options: createOrUpdateWebsite, startWebsite, stopWebsite
    #actionIISApplicationPool: 'CreateOrUpdateAppPool' # Required when iISDeploymentType == IISApplicationPool# Options: createOrUpdateAppPool, startAppPool, stopAppPool, recycleAppPool
    #startStopWebsiteName: # Required when actionIISWebsite == StartWebsite || ActionIISWebsite == StopWebsite
    websiteName: 
    #websitePhysicalPath: '%SystemDrive%\inetpub\wwwroot' 
    #websitePhysicalPathAuth: 'WebsiteUserPassThrough' # Options: websiteUserPassThrough, websiteWindowsAuth
    #websiteAuthUserName: # Required when websitePhysicalPathAuth == WebsiteWindowsAuth
    #websiteAuthUserPassword: # Optional
    #addBinding: false # Optional
    #protocol: 'http' # Required when iISDeploymentType == RandomDeployment# Options: https, http
    #iPAddress: 'All Unassigned' # Required when iISDeploymentType == RandomDeployment
    #port: '80' # Required when iISDeploymentType == RandomDeployment
    #serverNameIndication: false # Optional
    #hostNameWithOutSNI: # Optional
    #hostNameWithHttp: # Optional
    #hostNameWithSNI: # Required when iISDeploymentType == RandomDeployment
    #sSLCertThumbPrint: # Required when iISDeploymentType == RandomDeployment
    bindings: 
    #createOrUpdateAppPoolForWebsite: false # Optional
    #configureAuthenticationForWebsite: false # Optional
    appPoolNameForWebsite: 
    #dotNetVersionForWebsite: 'v4.0' # Options: v4.0, v2.0, no Managed Code
    #pipeLineModeForWebsite: 'Integrated' # Options: integrated, classic
    #appPoolIdentityForWebsite: 'ApplicationPoolIdentity' # Options: applicationPoolIdentity, localService, localSystem, networkService, specificUser
    #appPoolUsernameForWebsite: # Required when appPoolIdentityForWebsite == SpecificUser
    #appPoolPasswordForWebsite: # Optional
    #anonymousAuthenticationForWebsite: false # Optional
    #basicAuthenticationForWebsite: false # Optional
    #windowsAuthenticationForWebsite: true # Optional
    parentWebsiteNameForVD: 
    virtualPathForVD: 
    #physicalPathForVD: '%SystemDrive%\inetpub\wwwroot' 
    #vDPhysicalPathAuth: 'VDUserPassThrough' # Optional. Options: vDUserPassThrough, vDWindowsAuth
    #vDAuthUserName: # Required when vDPhysicalPathAuth == VDWindowsAuth
    #vDAuthUserPassword: # Optional
    parentWebsiteNameForApplication: 
    virtualPathForApplication: 
    #physicalPathForApplication: '%SystemDrive%\inetpub\wwwroot' 
    #applicationPhysicalPathAuth: 'ApplicationUserPassThrough' # Optional. Options: applicationUserPassThrough, applicationWindowsAuth
    #applicationAuthUserName: # Required when applicationPhysicalPathAuth == ApplicationWindowsAuth
    #applicationAuthUserPassword: # Optional
    #createOrUpdateAppPoolForApplication: false # Optional
    appPoolNameForApplication: 
    #dotNetVersionForApplication: 'v4.0' # Options: v4.0, v2.0, no Managed Code
    #pipeLineModeForApplication: 'Integrated' # Options: integrated, classic
    #appPoolIdentityForApplication: 'ApplicationPoolIdentity' # Options: applicationPoolIdentity, localService, localSystem, networkService, specificUser
    #appPoolUsernameForApplication: # Required when appPoolIdentityForApplication == SpecificUser
    #appPoolPasswordForApplication: # Optional
    appPoolName: 
    #dotNetVersion: 'v4.0' # Options: v4.0, v2.0, no Managed Code
    #pipeLineMode: 'Integrated' # Options: integrated, classic
    #appPoolIdentity: 'ApplicationPoolIdentity' # Options: applicationPoolIdentity, localService, localSystem, networkService, specificUser
    #appPoolUsername: # Required when appPoolIdentity == SpecificUser
    #appPoolPassword: # Optional
    #startStopRecycleAppPoolName: # Required when actionIISApplicationPool == StartAppPool || ActionIISApplicationPool == StopAppPool || ActionIISApplicationPool == RecycleAppPool
    #appCmdCommands: # Optional

Arguments

ArgumentDescription
Enable IIS(Optional) Check this if you want to install IIS on the machine.
Configuration type(Required) You can create or update sites, applications, virtual directories, and application pools.
Action(Required) Select the appropriate action that you want to perform on an IIS website. "Create Or Update" will create a website or update an existing website. Start, Stop will start or stop the website respectively.
Action(Required) Select the appropriate action that you want to perform on an IIS Application Pool. "Create Or Update" will create app-pool or update an existing one. Start, Stop, Recycle will start, stop or recycle the application pool respectively.
Website name(Required) Provide the name of the IIS website.
Website name(Required) Provide the name of the IIS website to create or update.
Physical path(Required) Provide the physical path where the website content will be stored. The content can reside on the local Computer, or in a remote directory, or on a network share, like C:\Fabrikam or \\ContentShare\Fabrikam.
Physical path authentication(Required) Select the authentication mechanism that will be used to access the physical path of the website.
Username(Required) Provide the user name that will be used to access the website's physical path.
Password(Optional) Provide the user's password that will be used to access the website's physical path.
The best practice is to create a variable in the Build or Release pipeline, and mark it as 'Secret' to secure it, and then use it here, like '$(userCredentials)'.
Note: Special characters in password are interpreted as per command-line arguments
Add binding(Optional) Select the option to add port binding for the website.
Protocol(Required) Select HTTP for the website to have an HTTP binding, or select HTTPS for the website to have a Secure Sockets Layer (SSL) binding.
IP address(Required) Provide an IP address that end-users can use to access this website.
If 'All Unassigned' is selected, then the website will respond to requests for all IP addresses on the port and for the host name, unless another website on the server has a binding on the same port but with a specific IP address.
Port(Required) Provide the port, where the Hypertext Transfer Protocol Stack (HTTP.sys) will listen to the website requests.
Server Name Indication required(Optional) Select the option to set the Server Name Indication (SNI) for the website.
SNI extends the SSL and TLS protocols to indicate the host name that the clients are attempting to connect to. It allows, multiple secure websites with different certificates, to use the same IP address.
Host name(Optional) Enter a host name (or domain name) for the website.
If a host name is specified, then the clients must use the host name instead of the IP address to access the website.
Host name(Optional) Enter a host name (or domain name) for the website.
If a host name is specified, then the clients must use the host name instead of the IP address to access the website.
Host name(Required) Enter a host name (or domain name) for the website.
If a host name is specified, then the clients must use the host name instead of the IP address to access the website.
SSL certificate thumbprint(Required) Provide the thumb-print of the Secure Socket Layer certificate that the website is going to use for the HTTPS communication as a 40 character long hexadecimal string. The SSL certificate should be already installed on the Computer, at Local Computer, Personal store.
Add bindings(Required) Click on the extension [...] button to add bindings for the website.
Create or update app pool(Optional) Select the option to create or update an application pool. If checked, the website will be created in the specified app pool.
Configure authentication(Optional) Select the option to configure authentication for website.
Name(Required) Provide the name of the IIS application pool to create or update.
.NET version(Required) Select the version of the .NET Framework that is loaded by the application pool.
If the applications assigned to this application pool do not contain managed code, then select the 'No Managed Code' option from the list.
Managed pipeline mode(Required) Select the managed pipeline mode that specifies how IIS processes requests for managed content. Use classic mode only when the applications in the application pool cannot run in the Integrated mode.
Identity(Required) Configure the account under which an application pool's worker process runs. Select one of the predefined security accounts or configure a custom account.
Username(Required) Provide the username of the custom account that you want to use.
Password(Optional) Provide the password for custom account.
The best practice is to create a variable in the Build or Release pipeline, and mark it as 'Secret' to secure it, and then use it here, like '$(userCredentials)'.
Note: Special characters in password are interpreted as per command-line arguments
Anonymous authentication(Optional) Select the option to enable anonymous authentication for website.
Basic authentication(Optional) Select the option to enable basic authentication for website.
Windows authentication(Optional) Select the option to enable windows authentication for website.
Parent website name(Required) Provide the name of the parent Website of the virtual directory.
Virtual path(Required) Provide the virtual path of the virtual directory. Example: To create a virtual directory Site/Application/VDir enter /Application/Vdir. The parent website and application should be already existing.
Physical path(Required) Provide the physical path where the virtual directory's content will be stored. The content can reside on the local Computer, or in a remote directory, or on a network share, like C:\Fabrikam or \\ContentShare\Fabrikam.
Physical path authentication(Optional) Select the authentication mechanism that will be used to access the physical path of the virtual directory.
Username(Required) Provide the user name that will be used to access the virtual directory's physical path.
Password(Optional) Provide the user's password that will be used to access the virtual directory's physical path.
The best practice is to create a variable in the Build or Release pipeline, and mark it as 'Secret' to secure it, and then use it here, like '$(userCredentials)'.
Note: Special characters in password are interpreted as per command-line arguments
Parent website name(Required) Provide the name of the parent Website under which the application will be created or updated.
Virtual path(Required) Provide the virtual path of the application. Example: To create an application Site/Application enter /Application. The parent website should be already existing.
Physical path(Required) Provide the physical path where the application's content will be stored. The content can reside on the local Computer, or in a remote directory, or on a network share, like C:\Fabrikam or \\ContentShare\Fabrikam.
Physical path authentication(Optional) Select the authentication mechanism that will be used to access the physical path of the application.
Username(Required) Provide the user name that will be used to access the application's physical path.
Password(Optional) Provide the user's password that will be used to access the application's physical path.
The best practice is to create a variable in the Build or Release pipeline, and mark it as 'Secret' to secure it, and then use it here, like '$(userCredentials)'.
Note: Special characters in password are interpreted as per command-line arguments
Create or update app pool(Optional) Select the option to create or update an application pool. If checked, the application will be created in the specified app pool.
Name(Required) Provide the name of the IIS application pool to create or update.
.NET version(Required) Select the version of the .NET Framework that is loaded by the application pool.
If the applications assigned to this application pool do not contain managed code, then select the 'No Managed Code' option from the list.
Managed pipeline mode(Required) Select the managed pipeline mode that specifies how IIS processes requests for managed content. Use classic mode only when the applications in the application pool cannot run in the Integrated mode.
Identity(Required) Configure the account under which an application pool's worker process runs. Select one of the predefined security accounts or configure a custom account.
Username(Required) Provide the username of the custom account that you want to use.
Password(Optional) Provide the password for custom account.
The best practice is to create a variable in the Build or Release pipeline, and mark it as 'Secret' to secure it, and then use it here, like '$(userCredentials)'.
Note: Special characters in password are interpreted as per command-line arguments
Name(Required) Provide the name of the IIS application pool to create or update.
.NET version(Required) Select the version of the .NET Framework that is loaded by the application pool.
If the applications assigned to this application pool do not contain managed code, then select the 'No Managed Code' option from the list.
Managed pipeline mode(Required) Select the managed pipeline mode that specifies how IIS processes requests for managed content. Use classic mode only when the applications in the application pool cannot run in the Integrated mode.
Identity(Required) Configure the account under which an application pool's worker process runs. Select one of the predefined security accounts or configure a custom account.
Username(Required) Provide the username of the custom account that you want to use.
Password(Optional) Provide the password for custom account.
The best practice is to create a variable in the Build or Release pipeline, and mark it as 'Secret' to secure it, and then use it here, like '$(userCredentials)'.
Note: Special characters in password are interpreted as per command-line arguments
Application pool name(Required) Provide the name of the IIS application pool.
Additional appcmd.exe commands(Optional) Enter additional AppCmd.exe commands. For more than one command use a line separator, like
list apppools
list sites
recycle apppool /apppool.name:ExampleAppPoolName
Control options

Open source

This task is open source on GitHub. Feedback and contributions are welcome.

Q & A