Search code examples
azureazure-caching

Debugging Web application using Azure Caching


I would like to find a best practice to debug an existing ASP.NET MVC application. That's a Web Role already hosted into Azure. The application is using Windows Azure Caching. The configuration file has been defined with the settgins of an Azure Account ->

<dataCacheClient name="default">
   <hosts>
      <host name="xxxx.cache.windows.net" cachePort="22233" />
   </hosts>
</dataCacheClient>

I would like to debug the code. What's the best approach in this case ?

I have already made a test by changing the Host with localhost but it's not working.

Thank you,

PS: I have installed the new SDK 1.8


Solution

  • There is no locally-installed equivalent to Azure Shared Caching. Windows Server AppFabric Caching is somewhat close, but not exactly the same.

    You could try to get IT to unblock the ports so you can use Azure. Though if you have multiple developers on a project, each dev would need their own cache instance to avoid stepping on each other's data.

    Another option is to completely encapsulate your caching in interfaces. Then you can use something completely different to develop on. In the past I've used the MemoryCache in-memory store for development. You could also use AppFabric Caching, or memcached, or really anything else. You just need to be aware of the differences between your dev and production systems.

    Edit: Another option would be switching from Shared Caching to caching in your roles (I'm not sure what the official name for this is, these days). I believe this works locally too. The major drawback is that it's only visible within one Hosted Service. If you only have one Hosted Service anyway, that's no problem. If you have several Hosted Services that need to share data, then it could an issue.