Category: azure

MVC Browser history provider for azure–trying an implementation for 3 hours

first, implement  IBrowserUserHistoryRepository  – that means implement:

public void Save(IEnumerable<BrowserUserHistoryData> history)


Azure have PartitionKey/RowKey – I have to add a new class.

Also or connectiing, I have to put


connectionString="UseDevelopmentStorage=true;" /


I tried to add a bulk history :
The result was:
Unexpected response code for operation : 0
<add key="TableStorageEndpoint" value=""/>
And one hour has been gone.
Run dsinit to have storage emulator:
No connection could be made because the target machine actively refused it

modified code to old Azure code:

now the answer was:

One of the request inputs is out of range. – All letters in a container name must be lowercase.

Tried that – same result:

One of the request inputs is out of range.

Maybe timestam is wrong? No…

Now debug with Fiddler :



Added to connection string:


 And see this in Fiddler :



: base(UserName, UserName)
So the problem is that RowKey does not support url values.
Now , after removing url from the RowKey  - and put username, the error was:

The specified entity already exists

Another hour passes


Now, that it works, thinking about rowkey and partitionkey : no username + url => put date.ToString("yyyyMMdd_HHmmss_tttt")

0:The specified entity already exists.

Oh no, not again?

Look tables =>20121220_064024_AM -  ok, it should be


0:The specified entity already exists

Again? debug, please

The real problem:

Forget about sending whole items history - not just not saved ones…
Now it works – kind of

Server Error in ‘/’ Application.

The method or operation is not implemented.

public IEnumerable<KeyValuePair<string, int>> MostUsed(int Count, DateTime? date)
Line 80:         {
Line 81:             throw new NotImplementedException();
Line 82:         }
Line 83: 
Implementing MostUsed(int Count, DateTime? date) 
Research about filter with data -
Research about GroupBY – not supported!
So now thinking about a way to STORE the data in a convenient format to can retrieve…
 It must take into consideration Count for a date and Count for all dates( date can be null) – AND BOTH THE FACT THAT THE OPERATION WILL BE DONE PER USER.
Time to think – because another hour has passed!

Azure tools

Azure storage Explorer :  – like in VS , but simpler and cleaner

Windows Azure ASP.NET Providers Sample : – utils for fast membership and roles. Small problem on local.

More samples here:

And that will be all , after reading the documentation and understanding the concepts ( for example,if you understand the session problem in azure, then you will find a Session provider in the samples and use it)


I am working at a new application ( Azure + MVC + logging) and I am having a good time  – when I know resources. This are the steps that works for me:

  1. Azure SDK ( it would be good if you have Sql Server). Now version 1.6, download from
      1. Optional : run DSInit , , to modify default SqlServer instance
  2. Windows Azure ASP.NET Providers Sample – good to fast use membership in Azure.
      1. for local , the .config keys are

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

      2. for azure, the .config keys are

           <add key="AccountName" value="…………………………" />
          <add key="AccountSharedKey" value="………………"></add>

          <add key="BlobStorageEndpoint" value="" />
          <add key="TableStorageEndpoint" value="" />

  3. Add Table Storage Provider- either from samples, either from here  ( read too)
      1. for local , the .config keys are
      2. <add key="BlobStorageEndpoint" value="" />
        <add key="TableStorageEndpoint" value="" />

      3. for azure, the .config keys are

<add key="BlobStorageEndpoint" value="" />
<add key="TableStorageEndpoint" value="" />

From now, you do have

a) An Membership Provider -  to create users

b) Azure Tables that can be searched with IQueryable .

This is all you need for now. Later you will enquire about caching / session / application. I would post them when I will be programming more. However , for caching I will be starting at and for session at

Andrei Ignat weekly software news(mostly .NET)

* indicates required

Please select all the ways you would like to hear from me:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices here.