in Windows Azure

Windows Azure Tables : Going ‘cloud’ from local storage

image

If you want to take your applications to the ‘cloud’ from the local storage, that is, from http://127.0.0.1:10002 to http://{application-name}.table.core.windows.net/ , all you need to do is edit your ServiceConfiguration.csfg file of your Web Role with the proper values!

<?xml version="1.0"?>
<ServiceConfiguration serviceName="RdChat" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
  <Role name="WebRole">
    <Instances count="1"/>
    <ConfigurationSettings>
      <Setting name="AccountName" value="<account-name>"/>
      <Setting name="AccountSharedKey" value="<primary-key>"/>
      <Setting name="UsePathStyleUris" value="false" />
      <Setting name="TableStorageEndpoint" value="http://table.core.windows.net"/>
    </ConfigurationSettings>
  </Role>
</ServiceConfiguration>

 

Hit F5, Tables will be created for you in the ‘cloud’ 🙂

The things to keep in mind here are:

  1. The <account-name> must be in lowercase
  2. UsePathStyleUris should be set to false when you point to the ‘cloud’

Write a Comment

Comment

Time limit is exhausted. Please reload the CAPTCHA.

  1. FYI, if you leave UsePathStyleUris out entirely, it will "do the right thing" and use path-style URIs when pointing to 127.0.0.1 and non-path-style URIs when pointing to something else.

    (The heuristic it uses is "Is this an IP address or a host name?")

  2. However, if you leave UsePathStyleUris out of the config, you get a RoleManager exception every time as it tries to look it up – so might be more efficient if you put it in and set it to the right value.