static void

WindowsAzure.com

Portal logon (manage.windowsazure.com)

Websites are great, easy and quick for development/test sites; web roles give more options for production sites.

If you use both, you may run into problems with Microsoft.WindowsAzure.ServiceRuntime.dll which is part of the SDK (C:\Program Files\Microsoft SDKs\Azure\.NET SDK\v2.5\ref\) and NOT in NuGet. Just change the assembly reference to Copy Local.

Configuring with domain names for websites and for web roles. Use a CNAME to map http://mysite/ to http://mysite.cloudapp.net/. If you use A records (eg for wildcard domains) the IP address may change!

Storage Tips

DefaultConnectionLimit

Connections to a storage endpoint are throttled to default 2. This obviously affects concurrency and scaling! See Understanding MaxServicePointIdleTime and DefaultConnectionLimit

ServicePointManager.DefaultConnectionLimit = 10;

In config:

<system.net>
  <connectionManagement>
    <add address="*" maxconnection="10" />
  </connectionManagement>
</system.net>

Disable Nagling

The default Nagling algorithm delays sending TCP requests until enough data is available. Conversely, this is bad for small POSTs (<1kb). Disable it:

ServicePointManager.UseNagleAlgorithm = false;

Expect: 100-continue

By default, the webclient talking to storage endpoints sends an HTTP header "Expect: 100-continue" first, to check the POST will be accepted (e.g. authentication etc.); the server responds with 100, then the POST payload is sent. This behaviour is a problem with some non-azure endpoints (eg Twitter).

For lots of small posts, this is means more roundtrips. Remove it:

ServicePointManager.Expect100Continue = false;