1 – Introduction
When using Internet Information Services (IIS) Web Deployment Tool (Web Deploy) 2.0 or later, there are three main approaches to get packaged web applications onto a web server:
· Deploy the application from a remote location by targeting the Web Deployment Agent Service (also known as the "remote agent") on the destination server.
· Deploy the application from a remote location by targeting the IIS Web Deploy Handler on the destination server.
· Deploy the application from a remote location using Web Deploy On Demand (also known as the "temp agent").
First two methods are covered in the present document.
Web Deployment Tool (Web Deploy 3.0)
https://www.microsoft.com/en-in/download/details.aspx?id=30436
2 – Prerequisites
1. .NET Framework 2.0 SP1 or greater installed
2. IIS 7.x role installed on the target server with basic website/web application configured
3. Install Web Management Service (WMSVC) role on the Web server
Start Server Manager
Click on Add Role Services link
Click Next to continue
Click Install to proceed with the installation
Wait until the role gets installed and click Close button
4. Install the Web Deployment tool on the Web server
Locate and open the folder containing the installer file, right click on the installer and click on Install
Click Next
Accept the License Agreement terms and hit Next
Click on Complete
Click on Install button
Wait until the installation process completed
Click Finish button to complete the installation
3 – Enable IIS Remote Connections
Open IIS Manager snap-in
Select the Server node and in Features View of the Server double-click the Management Service icon in Management section
Select Enable remote connections checkbox is selected. If the not selected and greyed out, use the Actions pane to stop the WMSvc Service. This will let you select the checkbox. Click Start
Click Yes to save the setting
Make sure the service is Started
4 – Configure Web Deployment Agent Service
1. To use Web Deploy Remote Agent Service add Windows user’s account to Local Administrators group on the Web server
2. Permit a Windows user to manage a Web site or an application remotely
In IIS Manager expand sites, select Web site name, in Features View double-click the IIS Manager Permissions icon
On the IIS Manager Permissions page in the Actions pane, click Allow User
In the Allow User dialog box, select Windows as user type then click Select
On the Select User or Group dialog box, type a user name and then click OK
Click OK to dismiss the Allow User dialog box
Configure ACLs for the physical directory of a Web site with read, write, execute permissions for the Windows user ID. Add the user if needed
Select Security tab, click Edit and then Add on next window
Click Localtions button, on next window select domain and hit OK
Type in user ID in the dialog box and click OK
Select checkboxes needed to configure permissions for the Web site directory and click OK
3. Test the configuration in IIS Manager
Open IIS Manager snap-in and click File and then click Connect to a Site (or Connect to an Application)
On the Connect to Site or Connect to Application wizard type the server name and the site name to connect to. If connecting to an application, type the application name also. Click Next
Enter Windows user’s credentials and click Next
Provide Web site or application name and click Finish
Make sure the Web site name appeared in IIS Manager Connections pane
5 – Configure IIS Web Deploy Handler
1. To use the Web Deploy Handler create and configure IIS Manager user to connect to a site or an application
In IIS Manager select Server node and in Features View double-click the IIS Manager Users icon
On the IIS Manager Users page in the Actions pane click Add User
Choose and type a user name and password, and then click OK
To permit an IIS Manager user to connect to a site or an application select Web site name and in Features View double-click the IIS Manager Permissions icon
On the IIS Manager Permissions page in the Actions pane click Allow User
In the Allow User dialog box select IIS Manager as user type then click Select
In the Users dialog box select the user name created then click OK
Configure ACLs for the physical directory of a site or an application with read, write, and execute permissions for IIS users who need to connect to that site or application. Right click on Web site folder and select Properties
Select Security tab, click Edit and then Add on next window
Click on Locations button and on next choose local server name and click OK
Click on Advanced button and on next type in LOCAL SERVICE as u user name and click OK
Give the account under which WMSvc is running LOCAL SERVICE Full Control permissions to the users's directory. Click OK twice
2. Create Delegation Rules for Web Deploy functionality (providers)
The following rules must be created accordingly: Deploy Applications with Content Rule, Mark Folders as Applications Rule, Deploy Databases Rule, Set Permissions Rule
To allow a user to deploy applications and content to his or her Web site open IIS Manager, select the Server node and in Features View of the Server, double-click the Management Service Delegation icon.
If contentPath and iisApp providers do not exist in the list create the rule by clicking Add Rule in the right-hand Actions pane
Select the Deploy Applications with Content rule template. This template creates a rule that allows any WMSVC authorized user to use the Web Deploy contentPath and iisApp providers to deploy applications to user’s scope.
Click OK to open the template then click OK to create the rule as needed
In the Add User to Rule dialog box, type an asterisk (*). This will allow each user to deploy applications to his user scope
If the providers configured expand it and make sure the asterisk (*) is selected as the user name allowed to deploy
To allow each user to create an application within his Web site make sure if createApp rule set and (*) is selected as the user name allowed to create applications
3. Test the configuration in IIS Manager
Open IIS Manager snap-in and click File and then click Connect to a Site (or Connect to an Application)
On the Connect to Site or Connect to Application wizard type the server name and the site name to connect to. If connecting to an application, type the application name also. Click Next
Enter IIS Manager user’s credentials and click Next
Provide Web site or application name and click Finish
Make sure the Web site name appeared in IIS Manager Connections pane
Create a quick application package to verify that the authorization rules are working. Right click on Web site or application name, go to Deploy menu and select Export Application
In Export Application Package wizard click Next through all of the screens to accept the defaults
Click Finish to create a package
With the package created, verify that it is installable:
a. In the Actions pane, click Import Application
b. Click Next
c. On the Parameters page, change the application name to something that doesn’t already exist in the Web site to verify that the user can create applications
d. Complete the wizard
a. In the Actions pane, click Import Application
b. Click Next
c. On the Parameters page, change the application name to something that doesn’t already exist in the Web site to verify that the user can create applications
d. Complete the wizard
4. Test the configuration in Visual Studio
Open/create test web application in Visual Studio on local desktop or laptop. For example:
Publish the web application either using web server IP, hostname or FQDN
In the Publish Web dialog window enter Service URL as shown, select Allow untrusted certificate if no certificate installed on IIS server which issued by official CA, and enter IIS Manager user’s credentials, click Publish button
Deployment Output information should be similar to:
------ Build started: Project: WebApplication1, Configuration: Debug Any CPU ------
WebApplication1 -> C:\Documents and Settings\rrakhim\my documents\visual studio 2010\Projects\WebApplication1\WebApplication1\bin\WebApplication1.dll
------ Publish started: Project: WebApplication1, Configuration: Debug Any CPU ------
Transformed Web.config using Web.Debug.config into obj\Debug\TransformWebConfig\transformed\Web.config.
Auto ConnectionString Transformed Account\Web.config into obj\Debug\CSAutoParameterize\transformed\Account\Web.config.
Auto ConnectionString Transformed obj\Debug\TransformWebConfig\transformed\Web.config into obj\Debug\CSAutoParameterize\transformed\Web.config.
Copying all files to temporary location below for package/publish:
obj\Debug\Package\PackageTmp.
Start Web Deploy Publish the Application/package to https://10.193.57.93:8172/MsDeploy.axd?site=dailyliquiditytest ...
Adding child dirPath (dailyliquiditytest\Account).
Adding child dirPath (dailyliquiditytest\bin).
Adding child dirPath (dailyliquiditytest\Scripts).
Adding child dirPath (dailyliquiditytest\Styles).
Updating setAcl (dailyliquiditytest).
Updating setAcl (dailyliquiditytest).
Adding child filePath (dailyliquiditytest\About.aspx).
Adding child filePath (dailyliquiditytest\Account\ChangePassword.aspx).
Adding child filePath (dailyliquiditytest\Account\ChangePasswordSuccess.aspx).
Adding child filePath (dailyliquiditytest\Account\Login.aspx).
Adding child filePath (dailyliquiditytest\Account\Register.aspx).
Adding child filePath (dailyliquiditytest\Account\Web.config).
Adding child filePath (dailyliquiditytest\bin\WebApplication1.dll).
Adding child filePath (dailyliquiditytest\bin\WebApplication1.pdb).
Adding child filePath (dailyliquiditytest\Default.aspx).
Adding child filePath (dailyliquiditytest\Global.asax).
Adding child filePath (dailyliquiditytest\Scripts\jquery-1.4.1-vsdoc.js).
Adding child filePath (dailyliquiditytest\Scripts\jquery-1.4.1.js).
Adding child filePath (dailyliquiditytest\Scripts\jquery-1.4.1.min.js).
Adding child filePath (dailyliquiditytest\Site.Master).
Adding child filePath (dailyliquiditytest\Styles\Site.css).
Adding child filePath (dailyliquiditytest\Web.config).
Updating setAcl (dailyliquiditytest).
Updating setAcl (dailyliquiditytest).
Publish is successfully deployed.
========== Build: 1 succeeded or up-to-date, 0 failed, 0 skipped ==========
========== Publish: 1 succeeded, 0 failed, 0 skipped ==========