Site Feedback Post

Single Post Permalink

View Thread: Cannot get "Show Me The Cache" Azure Achievement to work
  • AceHack

    Still can't git it.  Please Help!!!

    <dataCacheClients>
        <dataCacheClient name="default">
          <hosts>
            <host name="xxx.cache.windows.net" cachePort="22233" />
          </hosts>
          <securityProperties mode="Message">
            <messageSecurity authorizationInfo="[xxx]"></messageSecurity>
          </securityProperties>
        </dataCacheClient>
        <dataCacheClient name="SslEndpoint">
          <hosts>
            <host name="xxx.cache.windows.net" cachePort="22243" />
          </hosts>
          <securityProperties mode="Message" sslEnabled="true">
            <messageSecurity authorizationInfo="[xxx]"></messageSecurity>
          </securityProperties>
        </dataCacheClient>
      </dataCacheClients>
    

    DataCacheFactoryConfiguration config = new DataCacheFactoryConfiguration("default");
    DataCacheFactory cacheFactory = new DataCacheFactory(config);
    DataCache defaultCache = cacheFactory.GetDefaultCache();
    
    defaultCache.Put("testkey", "testobject");
    string strObject = (string)defaultCache.Get("testkey");
    defaultCache.Remove("testkey");