共用方式為


Key Concepts and Features

Applies To: Windows 7, Windows Server 2003, Windows Server 2003 R2, Windows Server 2008, Windows Server 2008 R2, Windows Vista, Windows XP

This topic presents some of the key concepts and features of the Web Deployment Tool. These include:

  • Sources and Destinations

  • Operations

  • Operation Settings

  • Providers

  • Provider Settings

  • Packages and Parameters

  • Link Extensions

  • Rules

  • Web Deployment Agent Service

  • The Deployment Handler

Sources and Destinations

Web Deploy can dump information from a source computer, or synchronize information from a source computer to a destination computer or computer location. On the Web Deploy command line, the source location is indicated by the -source argument, and the destination location is indicated by the -dest argument. Additional settings are added to these arguments to specify both the source and destination computer locations, and type of data that will be processed.

Operations

Operations follow the -verb switch at the command line. The most common are dump, sync, and delete.

Examples:

msdeploy -verb:dump -source:webServer

msdeploy -verb:sync -source:webServer -dest:webServer,computerName=Server2

msdeploy -verb:delete -source:package=c:\MySite.zip -dest:auto

dump returns information from a specified source, while sync synchronizes Web-related data between a source and a destination. delete removes the objects on the destination that have been specified by the source.

The remaining Web Deploy operations are getDependencies, getSystemInfo, and getParameters.

Examples:

msdeploy -verb:getDependencies -source:webServer

msdeploy -verb:getSystemInfo -source:webServer

msdeploy -verb:getparameters -source:package=C:\package.zip

GetDependencies gives a report on application dependencies that must be transferred manually, and is useful to run prior to a sync operation from an IIS 6.0 source to an IIS 7 destination. For more information about dependencies, see Viewing Dependencies. GetSystemInfo returns IIS-related system information. The first two examples return this information from an IIS 7 Web server. The getParameters operation returns the parameters that have been declared in a package file. For more information about package files and parameters, see the Packages and Parameters section later in this topic.

For more information about operations, see Web Deploy Operations.

Operation Settings

The action of operations can be modified by using operation settings. For example, the -whatif operation setting allows you to see the potential results of a command without actually making any changes, while the -xml operation setting specifies that the output of a command be returned in XML format.

For more information about operation settings, see Web Deploy Operation Settings.

Providers

Providers are Web Deploy components that supply data to Web Deploy operations like dump and sync. In the following examples, the providers are webServer, appHostConfig, and contentPath.

Examples:

msdeploy -verb:dump -source:webServer

msdeploy -verb:dump -source:appHostConfig="Default Web Site"

msdeploy -verb:sync -source:contentPath="Default Web Site" -dest:contentPath="MySite.com"

Web Deploy has about 30 providers. Some of the most common ones are appHostConfig, metakey, contentPath, webServer, and webServer60. Each provider is specialized to process a particular kind of data. For example, appHostConfig processes IIS 7 Applicationhost.config file configuration information, while metakey processes IIS 6.0 metakeys. contentPath processes Web site content. The webServer provider processes IIS 7 Web server-level data, while webServer60 processes IIS 6.0-related Web-server level data. A special manifest provider enables you to use more than one provider in an operation by allowing you to specify a manifest file that lists the providers that you want to use in the order that you want to use them.

To see a simple list of Web Deploy providers at the command prompt, type msdeploy without parameters and look under the "Supported provider-types" section of the help output. For in-depth help on providers, see Web Deploy Providers.

Provider Settings

The action of some providers can be modified by using provider settings. For example, in the following command, the computerName provider setting is added to the webServer provider to identify the location of the destination computer.

msdeploy -verb:sync -source:webServer -dest:webServer,computerName=Server2

For more information about provider settings, see Web Deploy Provider Settings.

Packages and Parameters

The package provider enables you to store the data from a provider into a compressed (zip) file called a package. For example, you can package the content and/or configuration of a Web server, site, or application. You can use packages for backup purposes, or as a way to import content or configuration data into another computer or location of your choosing.

For greater flexibility with packages, you can use the -declareParam operation setting when you create the package. This allows you to declare custom parameters for particular attributes such as a Web site name or binding. These parameters are saved in the package file. Then, at import time, you can specify new values for the parameters by using the -setParam operation setting. You can also specify default values for your custom parameters, or specify no defaults so that users will be forced to provide values for the parameters when they import the package. To discover the parameters that have been declared in an arbitrary package, you can use the getParameters operation.

For more information about packages and parameters, see Web Deploy package Provider and Using declareParam and setParam.

Link extensions are Web Deploy features that use providers to include data that would otherwise be omitted in an operation. Link extensions are executed for all Web Deploy verbs, including dump operations.

Web Deploy has five link extensions, each of which specializes in gathering particular kinds of data. For example, the ContentExtension includes the contents of a virtual directory in an operation whenever a virtualDirectory configuration element or VirtualDir metabase path is detected. Another example is the CertificateExtension, which includes certificates in an operation whenever SSLCertHash is seen in the configuration.

You can use the -disableLink operation setting to disable a link extension, and -enableLink to enable one. For example, by using -disableLink:ContentExtension, you can synchronize the configuration information between two servers without synchronizing their content. You cannot edit, modify, or add new Web Deploy link extensions.

For more information about link extensions, see Web Deploy Link Extensions.

Rules

Rules are logical conditions that apply only to sync operations. Web Deploy has 14 built-in rules, 13 of which are enabled by default. For example, the SkipUNC rule, which is enabled by default, prevents the content of UNC paths from being synchronized.

You can enable or disable Web Deploy rules by using the -enableRule and -disableRule operation settings. For example, the operation setting -disableRule:SkipUNC will enable UNC content to be included when performing a sync operation.

In addition to the built-in rules, you can also create your own custom rules by creating an Msdeploy.exe.configsettings file in the %program files%\IIS\Microsoft Web Deploy folder and editing it.

For more information about rules, including custom rules, see Web Deploy Rules.

Web Deployment Agent Service

The Web Deployment Agent Service (Web Deploy Remote Service) is a Windows service that enables administrators to connect and perform Web Deploy operations remotely over a network. The service listens for HTTP requests on a specified port and URL, and then parses the URL to determine the operations to perform. The service is not installed by default, but you can choose to do so when you install the Web Deployment Tool. During installation, you can choose the URL and the port on which the service will listen.

For more information about installing and using the remote service, see Web Deploy Remote Service.

The Deployment Handler

The IIS 7 Deployment Handler enables both non-administrators and administrators to perform Web Deploy operations remotely.

The Deployment Handler is useful in Web hosting and in enterprises where the users who publish to the Web are not server administrators. The handler enables such users to publish their applications to a remote server to which they have limited rights (for example, to only publish content). The Deployment Handler is not installed by default, but you can choose to do so when you install the Web Deployment Tool. The handler requires that both IIS 7 and the Web Management service (WMSVC) be installed.

For more information about installing the Web Deployment Tool, see Web Deployment Tool Installation. For more information about configuring the Web Deployment Handler, see Configuring the Web Deployment Handler.

See Also

Concepts

Requirements and Limitations
Web Deployment Tool Installation