We have a LINQ query on the Partion and Rowkey against an Azure table storage instance that is generated differently when the web role is running in the dev fabric versus the Azure fabric. The query Uri (determined by calling ToString() on the IQueryable
that is generated from the LINQ query) is generated as a filter when the web role is running on a dev machine and not in the fabric.
Dev Fabric Uri:
https://foo.table.core.windows.net/Bars()?$filter=(RowKey eq 'a1@gmail.com') and (PartitionKey eq '41e0c1ae-e74d-458e-8a93-d2972d9ea53c')
Azure Fabric Uri:
https://foo.table.core.windows.net/Bars(RowKey='a1@gmail.com',PartitionKey='41e0c1ae-e74d-458e-8a93-d2972d9ea53c')
I believe this is causing the well known ResourceNotFound errors when methods like FirstOrDefault are called. We know the ways to handle this.
My question is why is the Uri generated differently when generated in a dev web role versus an Azure web role?
Here is some code that is similar to what was used to generate the Uri's in both cases.
TableServiceContext context = new TableServiceContext();
var qry = context.Somethings.Where(m => m.RowKey == Username && m.PartitionKey == ProjectID);
System.Diagnostics.Trace.TraceInformation(qry.ToString());
if (qry.FirstOrDefault() == null) {
// ^ This statement generates an error when the web role is running
// in the fabric
...
}