Configuring WCF Client to use the Windows Azure Service Management Library

I’m using the NuGet package (Windows Azure Service Management Library Nuget Package) to communicate with the Azure Management REST API.

private IServiceManagement Channel
{
    get
    {
        return ServiceManagementHelper.CreateServiceManagementChannel("WindowsAzureEndPoint", ManagementCertificate.Certificate);
    }
}
  <system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="WindowsAzureServiceManagement_WebHttpBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00">
          <readerQuotas maxStringContentLength="1048576" maxBytesPerRead="131072"/>
          <security mode="Transport">
            <transport clientCredentialType="Certificate"/>
          </security>
        </binding>
      </webHttpBinding>
    </bindings>
    <client>
      <endpoint name="WindowsAzureEndPoint" address="https://management.core.windows.net" binding="webHttpBinding" bindingConfiguration="WindowsAzureServiceManagement_WebHttpBinding" contract="Microsoft.Samples.WindowsAzure.ServiceManagement.IServiceManagement" />
    </client>
  </system.serviceModel>

Note that you can read about the ManagementCertificateclass in another post of mine.

Advertisements

About Tamas Nemeth

Husband and proud father of two daughters in Nürnberg. I'm working as a Senior Software Developer and an enthusiastic Clean-Coder. I spend most of my free time with my family (playing, hiking, etc...). I also play table-tennis and badminton sometimes...
This entry was posted in Technical Interest and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s