X Blogs

who you gonna call?

NTK 2011 - New in Microsoft Virtualization

clock May 27, 2011 01:03 by author joze

Novosti v Microsoftovi Virtualizaciji

Virtualizacija postaja del večine poslovnih okolij. Nekje samo na klientih, pri večini pa tudi že na strežnikih.
Tekom predavanja si bomo pogledali, kaj je Microsoft v zadnjem letu postavil na trg, kaj je spremenil in kaj posodobil. Pogledali si bomo tako Windows Virtual PC, kot tudi HyperV strežnik. Zraven pa še kak trik za upravljanje enega in drugega.

---

Last week I was presenting at Slovenian Microsoft’s conference – NTK or. NT konferenca.

Attached to this post you can find my presentation. You can also find it on the original NTK page.

Novosti v Microsoftovi Virtualizaciji



Azure AppFabric Cache HowTo

clock May 3, 2011 04:24 by author Rok Bermež
Well since we now have Azure AppFabric Cache available, let’s get a head start on how to use it in your Cloud ASP.NET (MVC) application. First, you need to have AppFabric 1.0 April Refresh SDK installed on your machine so grab it at here.
Next, go to Windows Azure Management portal. Log in, go to AppFabric/Cache and create new service namespace: wait for the service to be activated.

Then click 'View Client Configuration Button'

you will get a nice pre prepared configuration settings (with all those pesky security information included) for your app:
now we have all the pieces of the puzzle ready, all we have to do is to add references to caching dlls (located at C:\Program Files\Windows Azure AppFabric SDK\V1.0\Assemblies\NET4.0\Cache) to our application and change web.config with the settings given by previous step.

You would always need to put cache section in <configSections> node:
<section name="dataCacheClients" 
             type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection,
Microsoft.ApplicationServer.Caching.Core"
allowLocation="true" allowDefinition="Everywhere"/>
and configure your Cache EndPoints:
<dataCacheClients>
    <dataCacheClient name="default">
      <hosts>
        <host name="ntkonferenca.cache.windows.net" cachePort="22233" />
      </hosts>
      <securityProperties mode="Message">
        <messageSecurity
authorizationInfo="1AmN0tT371NgUtH@T">
        </messageSecurity>
      </securityProperties>
    </dataCacheClient>
    <dataCacheClient name="SslEndpoint">
      <hosts>
        <host name="ntkonferenca.cache.windows.net" cachePort="22243" />
      </hosts>
      <securityProperties mode="Message" sslEnabled="true">
        <messageSecurity
authorizationInfo="1AmN0tT371NgUtH@T">
        </messageSecurity>
      </securityProperties>
    </dataCacheClient>
  </dataCacheClients>
If your application uses Session State and you want it to use Azure AppFabric Cache (which you do) you change your <sessionState> node to:
    <sessionState mode="Custom" customProvider="AppFabricCacheSessionStoreProvider">
      <providers>
        <add name="AppFabricCacheSessionStoreProvider"
             type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, 
Microsoft.Web.DistributedCache"
cacheName="default" useBlobMode="true" dataCacheClientName="default" /> </providers> </sessionState>
and the same for OutputCache by changing <caching> note:
<caching>
    <outputCacheSettings enableFragmentCache="true" defaultProvider="DistributedCache">
      <outputCacheProfiles>
        <add name="default" duration="43000" />
        <add name="DistributedCache"
                       type="Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider, 
Microsoft.Web.DistributedCache"
cacheName="default" dataCacheClientName="default" /> </outputCacheProfiles> </outputCacheSettings> </caching>
That’s it, nothing needs to be changed in your code, your app is configured and ready to be published to the cloud. AppFabric Cache is not a free service even if you won’t be charged anything for its use prior to August 1, 2011. After that the prices are:
  • 128 MB cache for $45.00/month
  • 256 MB cache for $55.00/month
  • 512 MB cache for $75.00/month
  • 1 GB cache for $110.00/month
  • 2 GB cache for $180.00/month
  • 4 GB cache for $325.00/month
In my next post, Ill tackle with using AppFabric Cache without using prepared providers by simple GET and PUT statements (lets get rid of HttpRuntime.Cache as well).

 



About the author

Rok Bermež is Slovenian Windows Azure MVP, he works as a Software Engineer and Microsoft Certified Trainer at Kompas Xnet. His primary interests include cloud computing and web development. With extensive experience in development and architecture he participated in many projects and since the CTP release of Windows Azure much of those projects are based on Windows Azure platform. Rok has been delivering courses, writing code and speaking at conferences and community events on Microsoft technologies for the last couple of years. You can also find him on Twitter (@Rok_B).

Month List

Sign In