Troubleshooting REST API based connectivity issues with Windows Azure Management Portal

Recently I worked on an issue where the customer was trying to create a Service Bus using Python code, however the creation of Service Bus was failing with the following error.

 

                "The server encountered an internal error. Please retry the request"

 

Because Python was using REST API and the communication was encrypted so my troubleshooting guideline was as simple as described below:

 

  1. The first step was to eliminate Python or any 3rd party code dependency while connecting Azure Management Portal.

  2. Next I was able to create Service Bus from the Windows Azure Management Portal.

  3. Then I used Windows Azure PowerShell to create the Service Bus namespace as shown below:

    Get-AzurePublishSettingsFile -> Save the the PublishSettingsFile

    Import-AzurePublishSettingsfile "<Filename\Path>.publishsettings"

    NEW-AzureSBNameSpace testSB101

  4. While the above Powershell script was being executed, I then captured and decrypted the HTTPs traffic using Fiddler. As you may know fiddler need little extra configuration to decrypt the HTTPS traffic I used the blog here to set it up accordingly.

  5. Above steps provided me the correct way to use REST API from the decrypted fiddler traces as shows below:

PUT https://management.core.windows.net/<SubID>/services/servicebus/namespaces/testSB101 HTTP/1.1

Content-Type: application/xml

type: entry

charset: utf-8

x-ms-version: 2012-03-01

Host: management.core.windows.net

Expect: 100-continue

Content-Length: 373

 

 

<entry xmlns="https://www.w3.org/2005/Atom">

  <content type="application/xml">

    <NamespaceDescription xmlns="https://schemas.microsoft.com/netservices/2010/10/servicebus/connect" xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="https://www.w3.org/2001/XMLSchema">

      <Region>East US</Region>

    </NamespaceDescription>

  </content>

</entry>

6.Once I had the proper REST API information, I decided to give a quick try with 3rd party called Burp and tried to create the Service Bus using REST API calls. This blog describes how to configure BURP connecting Windows Azure Management Portal.

The above steps verified the correct way to use REST API, the information can be used with any REST support language. You can use above steps to troubleshoot any REST Api specific issues.

 

Note: Thanks to Avkash Chauhan for his input on this post.