Eksportuj (0) Drukuj
Rozwiń wszystko
EN
Ta zawartość nie jest dostępna w wymaganym języku. Wersja w języku angielskim znajduje się tutaj.
1 z 2 osób oceniło jako pomocne - Oceń ten temat

How to: Manage Service Configurations and Profiles

Updated: October 18, 2012

When you publish a cloud service, Visual Studio stores configuration information in two kinds of configuration files: service configurations and profiles. Service configurations (.cscfg files) store settings for the deployment environments for a Windows Azure cloud service. Windows Azure uses these configuration files when it manages your cloud services. On the other hand, profiles (.azurePubxml files) store publish settings for cloud services. These settings are a record of what you choose when you use the Publish Wizard, and are used locally by Visual Studio. This topic explains how to work with both types of configuration files.

Service Configurations

You can create multiple service configurations to use for each of your deployment environments. For example, you might create a service configuration for the local environment that you use to run and test a Windows Azure application and another service configuration for your production environment.

You can add, delete, rename, and modify these service configurations based on your requirements. You can manage these service configurations from Visual Studio, as shown in the following illustration.

Manage Service Configurations

You can also open the Manage Configurations dialog box from the role’s property pages. To open the properties for a role in your Windows Azure project, open the shortcut menu for that role, and then choose Properties. On the Settings tab, expand the Service Configuration list, and then choose Manage to open the Manage Configurations dialog box.

To add a service configuration

  1. In Solution Explorer open the shortcut menu for the Windows Azure project and then choose Manage Configurations.

    The Manage Service Configurations dialog box is displayed.

  2. To add a service configuration, you must create a copy of an existing configuration. To do this, choose the configuration that you want to copy from the Name list and then choose the Create copy button.

  3. (Optional) To give the service configuration a different name, choose the new service configuration from the Name list and then choose the Rename button. In the Name text box, type the name that you want to use for this service configuration and then choose the OK button.

    noteNote
    A new service configuration file that is named ServiceConfiguration.<New Name>.cscfg is added to a Windows Azure project in Solution Explorer.

  4. To close the Manage Service Configurations dialog box, choose the Close button.

To delete a service configuration

  1. In Solution Explorer open the shortcut menu for the Windows Azure project and then choose Manage Configurations.

    The Manage Service Configurations dialog box is displayed.

  2. To delete a service configuration, choose the configuration that you want to delete from the Name list and then choose the Remove button.

    A dialog box is displayed to verify that you want to delete this configuration.

  3. Choose the Delete button.

    noteNote
    The service configuration file is removed from a Windows Azure project in Solution Explorer.

  4. To close the Manage Service Configurations dialog box, choose the Close button.

To rename a service configuration

  1. In Solution Explorer open the shortcut menu for the Windows Azure project and then choose Manage Configurations.

    The Manage Service Configurations dialog box is displayed.

  2. To rename a service configuration, choose the new service configuration from the Name list and then choose the Rename button. In the Name text box, type the name that you want to use for this service configuration and then choose the OK button.

    noteNote
    The name of the service configuration file is changed in a Windows Azure project in Solution Explorer.

  3. To close the Manage Service Configurations dialog box, choose the Close button.

To modify a service configuration

Profiles

By creating profiles, you can automatically populate the Publish Wizard with different combinations of settings that you typically use for different purposes. For example, you might want to create one profile for debugging and one for release builds. In that case, your Debug profile would have IntelliTrace enabled and the Debug configuration selected, and your Release profile would have IntelliTrace disabled and the Release configuration selected. You could also use different profiles to deploy a service using a different storage account.

When you run the wizard for the first time, a default profile is created. Visual Studio stores the profile in a file that has an .azurePubXml extension, which is added to your Windows Azure project under the Profiles folder. If you manually specify different choices when you run the wizard later, the file is automatically updated. Before you run the following procedure, you should have already published your cloud service at least once.

To add a profile

  1. Open the shortcut menu for your Windows Azure project, and then choose Publish.

  2. In the Target profile list, choose Manage, as the following illustration shows.

    Target profile list

    The Manage Profiles dialog box appears, as the following illustration shows.

    Manage Profiles Dialog
  3. In the Target profile list, choose a profile, and then choose the Create Copy button.

  4. Choose the Close button.

    The new profile appears in the Target profile list.

  5. In the Target profile list, choose the profile that you just created.

    The Publish Wizard settings are populated with the choices from the profile you selected.

  6. Choose the Previous and Next buttons to display each page of the Publish Wizard, and then customize the settings for this profile.

    For information about these settings, see Publish Windows Azure Application Wizard.

  7. When you finish customizing the settings, choose the Next button to return to the Settings page.

    The profile is saved when you publish the service by using these settings or if you choose the Save button next to the list of profiles.

To delete a profile

  1. Open the shortcut menu for your Windows Azure project, and then choose Publish.

  2. In the Target profile list, choose Manage.

  3. In the Manage Profiles dialog box, choose the profile that you want to delete, and then choose the Remove button.

  4. In the confirmation dialog box that appears, choose the OK button.

  5. Choose the Close button.

To rename a profile

  1. Open the shortcut menu for your Windows Azure project, and then choose Publish.

  2. In the Target profile list, choose Manage.

  3. In the Manage Profiles dialog box, choose the profile that you want to rename, and then choose the Rename button.

  4. Enter the new name, and then choose the OK button.

  5. Choose the Close button.

To modify a profile

  1. Open the shortcut menu for your Windows Azure project, and then choose Publish.

  2. In the Target profile list, choose the profile that you want to modify.

  3. Choose the Previous and Next buttons to display each page of the Publish Wizard, and then modify the settings to better meet your needs.

    For information about these settings, see Publish Windows Azure Application Wizard.

  4. When you finish modifying settings, choose the Next button to return to the Settings page.

  5. (Optional) Choose the Publish button to publish the cloud service using the new settings.

    If you don’t want to publish your cloud service at this time, and you close the Publish Wizard, Visual Studio displays a dialog box asking you if you want to save the changes to the profile.

See Also

Czy oceniasz te materiały jako pomocne?
(Pozostało znaków: 1500)
Dziękujemy za opinię.

Zawartość społeczności

Dodaj
Pokaż:
© 2014 Microsoft. Wszelkie prawa zastrzeżone.