Delen via


Import and Export an Application in AppFabric

Microsoft AppFabric 1.1 for Windows Server leverages the existing IIS capabilities for importing or exporting applications by using MSDeploy (also called the Web Deployment Tool, or Web Deploy) technology for moving entities in and out of the Web server. MSDeploy allows seamless deployment of applications from IIS Manager, Visual Studio 2010, and by using Windows PowerShell scripts. MSDeploy allows you to control with fine-grained specificity what the deployment operations entail, as well as to execute troubleshooting operations when deployment does not go as planned.

You import and export deployment entities in AppFabric by using commands in IIS Manager that are built on Web Deploy. You can import or export entities for an entire computer, an entire Web site, or individual applications within a site. For the sake of simplicity, in this document we will refer to exporting or importing an entity at any scope as an “application package”. However, realize that an imported or exported application package can contain an individual application, all the applications under a Web site, or all the Web sites under one computer.

There are many ways to leverage deployment functionality within AppFabric:

  • Exporting an application - To package and move an existing application from one AppFabric server to another AppFabric installation, you can export a package through the Deploy -> Export Application command in IIS Manager. This creates an application package containing configuration data including registry settings, Web content, and SQL Server database information and scripts. All of these are necessary to successfully import this package onto another AppFabric server and re-create the configuration necessary for it to work correctly. On a server farm you can export a single application and then import it onto many servers to re-create the same settings for the service to run in a load-balanced environment.

  • Importing an application - You can import a new entity into AppFabric by selecting a package that was previously exported from another AppFabric server. Alternatively, you can select a new deployment package created by Visual Studio 2010 that has not previously been imported to an AppFabric server.

    Important

    Always back up your system and configuration before changing your Web server configuration. Deploying and undeploying applications are examples of operations that require backup prior to their execution.

    Important

    Always test and document deployment-related operations for each server component before putting a server into production.

  • Deploying by using scripts - You can perform application deployment operations in AppFabric by using command-line scripts. Just like the operations that you perform in IIS Manager, these scripts leverage MSDeploy technology to accomplish this task. For more information, see Lesson 2: Deploying the Order Service Application with Windows PowerShell.

Prerequisites

To import or export a Web application, you need to download the Web Deploy tool. For more information about the tool, see Web Deployment Tool (https://go.microsoft.com/fwlink/?LinkId=188372). For a download site, see Installing Web Deploy (https://go.microsoft.com/fwlink/?LinkId=188373).

Creating an Application Package in Visual Studio 2010

Visual Studio 2010 installs Web Deploy and uses it to export a Web application into a package (.zip file). After the package is created, it can be imported directly into AppFabric at the application scope level. Using Visual Studio 2010 to create a new application package for AppFabric involves the following process:

  1. In Visual Studio 2010, right-click the project in Solution Explorer, and then click Properties.

  2. Click the Package/Publish Web tab, and then select the Create deployment package as a zip file check box to create a Web Deploy package as a .zip file. In the Location where package will be created text box, enter or browse to a path, and then accept the .zip file name or enter a new one.

  3. Right-click the project in Solution Explorer, and then click Build Deployment Package to output the .zip package file to the package location.

Importing and Exporting an Application in AppFabric

You can import and export a Web application from within IIS Manager.

To import an application into AppFabric

  1. Open IIS Manager by clicking Start, clicking All Programs, clicking Windows Server AppFabric, and then clicking Internet Information Services (IIS) Manager.

  2. In the Connections pane, select an entity at the level at which you want to import the application. For example, if you want to import the application at the site level, select the Default Web Site node.

  3. In the Actions pane, under Deploy, click Import Application to launch the Import Application Package Wizard.

    Note

    You can also right-click a folder entity in the left Connections pane, point to Deploy, and then select Import Application to launch the wizard.

    Note

    The Import Application command will not be present if the Web Deploy tool has not been downloaded to the computer. For more information, see the “Prerequisites” section above in this topic.

  4. On the Select the Package page of the Import Application Package Wizard, click Browse, and move to the folder that contains the application .zip file.

  5. On the Open page, select the .zip file, and then click Open.

  6. On the Select the Package page, click Next.

    Note

    This process uses the manifest to display the package contents. When you create an application package, the UI creates a manifest that contains a list of the contents of a package. The manifest is passed to the manifest provider that calls the IisApp, ContentPath, and SQLDB providers. The IisApp provider entry specifies IIS configuration information and content. This is how your application is imported into IIS. The ContentPath provider manages the folder path during the installation. The SQLDB provider manages the database configuration, enabling you to select what configuration data, content, and database information and scripts you want to import. For example, if you do not have SQL Server in your installation, you will not want to import the database content.

  7. On the Select the Contents of the Package page, expand the contents of the package, and select all items to import. Click Next.

  8. On the Enter Application Package Information page, enter the name of the Web application as you would like it to appear in the left Connections pane, or select the default. Click Next to install the package.

  9. On the Installation Progress page, verify that the package was successfully installed, and then click Finish.

Note

By default, the application will use the application pool that is running the site that it is deployed to. You can change the application pool used to be any application pool running under the .NET Framework 4.

Note

When you export an application by using MSDeploy, the binding protocols in the application's configuration will not be exported. As a result, if the application requires a protocol other than the default of HTTP, the protocol will not be configured after the application is imported. You will have to set the protocol to be enabled for the application after the application has been imported. This involves two steps: adding the binding for the Web site containing the application, and enabling the protocol for the application. For more information, see the following procedure.

Note

AppFabric tooling supports configuring .NET Framework 4.0 applications, but it does not explicitly provide tooling support for .NET Framework 2.0 applications. Therefore, mixing .NET Framework 2.0 and .NET Framework 4.0 applications within the same application pool may create issues such as mismatched configurations that could break your applications. It is recommended that you do not mix .NET Framework 2.0 and .NET Framework 4.0 applications, and instead put them in different application pools for purposes of management in AppFabric.

To export an application from AppFabric

  1. Open IIS Manager by clicking Start, clicking All Programs, clicking Windows Server AppFabric, and then clicking Internet Information Services (IIS) Manager.

  2. In the Connections pane, expand the server node, expand the Sites node, and then expand Default Web Site.

  3. Select the Web application that you would like to export.

  4. In the Actions pane, under Deploy, click Export Application to launch the Export Application Package Wizard.

    Note

    You can also right-click an application, point to Deploy, and then select Export Application to launch the wizard.

    Note

    If importing at the server level, in the Actions pane under Deploy, you will see Export Server Package and Import Server or Site Package.

  5. On the Select the Contents of the Package page of the Export Application Package Wizard, expand the contents of the package and then select the items to import.

  6. To set security, link extension, retry, trace level, and synchronization settings for the package, click Advanced Settings, enter the desired settings, and then click OK.

  7. To modify the default settings for the package, click Manage Components. Select the first open cell in the Provider Settings column, and then click the ellipsis button () to bring up the dialog box to enter configuration values specific to that provider. Enter values for the configuration settings, click Close, and then click OK. Click Next to move to the next page in the wizard.

    Note

    By default, the package will contain the application you have selected and its content folders.

  8. On the Select Parameters page, verify that the desired parameters are listed, and that they have the correct type, scope, and match. You can add a new parameter or modify the automatically generated parameters. Click Next to accept the parameter changes and move to the next page in the wizard.

  9. On the Save Package page, click Browse. In the Save As dialog box, move to the desired path, enter a file name, ensure that .zip is selected as the type, and then click Save. Click Next.

  10. On the Export Progress and Summary page, verify that the package was successfully created, and then click Finish.

  11. If a protocol other than HTTP was enabled for the application before you exported and then imported it, you must add the binding for the Web site containing the application, and enable the protocol for the application. To add the binding for the Web site, open IIS Manager, click the site, click Bindings in the Action pane, click Add, enter the protocol for Type and the binding information (“*” to make all host names valid), and then click Close. To enable the protocol for the application, open IIS Manager, click the application, click Advanced Settings in the Action pane, enter a comma and then the protocol to be enabled after “http” in the Enabled Protocols box, and then click OK.

  2012-09-12