Error installing management certificate in Sitecore Azure when using the 2.0 format of the publish settings file

  • Description

    When using the Install management certificate dialog to install a management certificate using Microsoft Azure Publishing Settings (*.publishsettings file), the Sitecore Azure module may show the "Failed to find a certificate in the publishsettings file" error:

    Error

    An example of the related error in the Sitecore log files:

    ERROR Sitecore.Azure Failed to find certificate in publishsettings file.
    Exception: System.NullReferenceException
    Message: Object reference not set to an instance of an object.
    Source: Sitecore.Azure.UI
      at Sitecore.Azure.UI.Files.sitecore.shell.Applications.Azure.AzureControls.Dialogs.PublishSettingsUploader.Page_Load(Object sender, EventArgs e)

    This happens when you use the 2.0 format (SchemaVersion="2.0") of the *.publishsettings file, generated using the Microsoft Azure Management Portal.

  • Solution #1

    Perform the following steps to convert the *.publishsettings file from the 2.0 to 1.0 format, which is supported by the Sitecore Azure module:

    1. Open the *.publishsettings file in a text editor:
      <?xml version="1.0" encoding="utf-8"?>
      <PublishData>
        <PublishProfile
          SchemaVersion="2.0"
          PublishMethod="AzureServiceManagementAPI">
          <Subscription
            ServiceManagementUrl="https://management.core.windows.net"
            Id="3b1a61d3-4e39-4cd9-b415-d9bdb57d4497"
            Name="Sitecore US OBU"
            ManagementCertificate="..." />
        </PublishProfile>
      </PublishData>
    2. Modify the *.publishsettings file as shown below (remove the SchemaVersion node, add the Url node, move the ManagementCertificate node):
      <?xml version="1.0" encoding="utf-8"?>
      <PublishData>
      <PublishProfile
        PublishMethod="AzureServiceManagementAPI"
      Url="https://management.core.windows.net"
          ManagementCertificate="..."
      >
        <Subscription
         ServiceManagementUrl="https://management.core.windows.net"
         Id="3b1a61d3-4e39-4cd9-b415-d9bdb57d4497"
          Name="Sitecore US OBU" />
        </PublishProfile>
      </PublishData>
    3. In the Sitecore Azure application, install the modified *.publishsettings file. 
  • Solution #2

Applies to:

Azure 2 - 7

Azure 8.0

October 29, 2014
May 29, 2015

Reference number:

421465

Keywords: 

  • Azure