Using the Sample Windows Azure ASP.NET Providers

Previously, the sample Windows Azure ASP.NET providers were included in the samples folder that was installed with the SDK.

As of the November 2009 release of the Windows Azure Tools & SDK, this is no longer the case.  The samples are available online at

To use these samples:

1. Download the samples and unzip (These are no longer included as part of the samples installed to the SDK folder)

2. Add the AspProviders/Lib/AspProviders.csproj project to the solution by right clicking on the solution and selecting Add | Existing Project… and navigating to the AspProviders.csproj file.

3. Add a reference from your ASP.NET MVC 2 Web role to the AspProviders sample library by right clicking on the “references” folder in the ASP.NET MVC project and selecting “Add Reference…”


and selecting the AspProviders assembly:


4. Open the web.config file and add/change the providers. 

You can set the applicationName appropriately for your application. 

These sections are added under the system.web element. Note that I'm still tracking down some issues I'm seeing with the profile provider, will update this post when I know more.

Membership Provider:

     <membership defaultProvider="TableStorageMembershipProvider" userIsOnlineTimeWindow = "20">

        <add name="TableStorageMembershipProvider"
             description="Membership provider using table storage"


Role Manager Provider:

   <roleManager enabled="true" defaultProvider="TableStorageRoleProvider" cacheRolesInCookie="true" cookieName=".ASPXROLES" cookieTimeout="30"
                 cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration = "true"
                 cookieProtection="All" >
        <add name="TableStorageRoleProvider"
             description="Role provider using table storage"

Session State Provider:

         <sessionState mode="Custom" customProvider="TableStorageSessionStateProvider">
                <clear />
                <add name="TableStorageSessionStateProvider"

Change the existing appSettings element and the folllowing provider configuration:

    <add key = "TableStorageEndpoint" value=""/>
    <add key = "BlobStorageEndpoint" value=""/>
    <add key = "AccountName" value="devstoreaccount1"/>
    <add key = "AccountSharedKey" value="Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw=="/>

    <!-- provider configuration -->
    <!-- When using the local development table storage service only the default values given
     below will work for the tables (Membership, Roles and Sessions) since these are the names
     of the properties on the DataServiceContext class -->
    <add key = "DefaultMembershipTableName" value="Membership"/>
    <add key = "DefaultRoleTableName" value="Roles"/>
    <add key = "DefaultSessionTableName" value="Sessions"/>
    <add key = "DefaultProviderApplicationName" value="ProviderTest"/>
    <add key = "DefaultProfileContainerName"/>
    <add key = "DefaultSessionContainerName"/>

You can now remove the “ApplicationServices” connection string as all of the providers that referenced it are gone.

6. Hit F5 to debug the application and your application is now using the sample ASP.NET providers that run against Windows Azure storage!

What’s next?  You can bet that we’ll put some more work into these providers to make them better and potentially even provide them as a real library. 

Stay tuned.