locked
Azure Cache RRS feed

  • Question

  • I am trying to use

    Windows Azure Caching on my role instance. I am using Co-located Role. I configured a Co-located Role cache cluster. The cache name is globalhealthcache. Role name is WebRole1. I used the NuGet package to install Azure caching. It generated:


    <

    sectionname="dataCacheClients"type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core"allowLocation="true"allowDefinition="Everywhere"/><sectionname="cacheDiagnostics"type="Microsoft.ApplicationServer.Caching.AzureCommon.DiagnosticsConfigurationSection, Microsoft.ApplicationServer.Caching.AzureCommon"allowLocation="true"allowDefinition="Everywhere"/></configSections>

     


    *****And this


    <

    dataCacheClients><dataCacheClientname="globalhealthcache"><hosts><hostname="[Insert Cache EndPoint]"cachePort="22233"/>

    </

    hosts><securityPropertiesmode="Message"><messageSecurityauthorizationInfo="[Encrypted ACS token goes here]">

     

    </

    messageSecurity></securityProperties><autoDiscoverisEnabled="true"identifier="WebRole1"/>

    <!--

    <localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />-->

    </

    dataCacheClient><dataCacheClientname="SslEndpoint"><hosts><hostname="[Insert Cache EndPoint]"cachePort="22243"/>

    </

    hosts><securityPropertiesmode="Message"sslEnabled="true"><messageSecurityauthorizationInfo="[Encrypted ACS token goes here]">

     

    </

    messageSecurity></securityProperties></dataCacheClient></dataCacheClients><cacheDiagnostics><crashDumpdumpLevel="Off"dumpStorageQuotaInMB="100"/>

    </

    cacheDiagnostics></configuration>


    I am not sure what to use for the endpoint host name="[Cache endpoint]"

    I am getting this error. What am I doing wrong?


    Microsoft.ApplicationServer.Caching.DataCacheException: ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty.   at Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor(DataCacheFactoryConfiguration configuration)   at Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor()   at Microsoft.ApplicationServer.Caching.DataCacheFactory.InitializeOrFetchSingletonFactoryInstance(String clientConfigurationName)   at Microsoft.ApplicationServer.Caching.DataCache..ctor(String cacheName, String clientConfigurationName)   at Microsoft.ApplicationServer.Caching.DataCache..ctor(String cacheName)   at WebRole1.login.clicktologin_Click(Object sender, EventArgs e) in I:\inetpub\wwwroot\MyGlobalhealthClient\WebRole1\login.aspx.vb:line 462


    Problem occurs when I execute:


    Dim

    cacheFactory AsNewDataCacheFactory()


    Dim

    cache AsDataCache= cacheFactory.GetDefaultCache()


    Thursday, May 16, 2013 2:53 PM

Answers

  • Found a solution using these 2 articles.

    Migrate from Windows Azure Shared Caching to Caching on Roles I was using a previous version of shared caching that had to be removed.

    How to: Add Items to the Cache 

    shows how to add items

    Hope this help someone

    • Marked as answer by Mike Bullen Sunday, May 19, 2013 3:36 PM
    Sunday, May 19, 2013 3:36 PM

All replies

  • Hi Mike,

    [insert cache endpoint] should be replaced with the name of the role on which you enabled Caching. So, in your case, replace it with WebRole1


    Saad Nawaz
    SDET
    Windows Azure Tools for Microsoft Visual Studio

    This posting is provided "AS IS" with no warranties, and confers no rights.

    Thursday, May 16, 2013 6:19 PM
  • I am getting a different error. This is my first time using the role cache. Need help!!!

    System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)   at Microsoft.ApplicationServer.Caching.DataCacheFactory.AutoDiscoverServers()   at Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor(DataCacheFactoryConfiguration configuration)   at Microsoft.ApplicationServer.Caching.DataCacheFactory..ctor()   at Microsoft.ApplicationServer.Caching.DataCacheFactory.InitializeOrFetchSingletonFactoryInstance(String clientConfigurationName)   at Microsoft.ApplicationServer.Caching.DataCache..ctor(String cacheName, String clientConfigurationName)   at Microsoft.ApplicationServer.Caching.DataCache..ctor(String cacheName)   at WebRole1.login.clicktologin_Click(Object sender, EventArgs e) in I:\inetpub\wwwroot\MyGlobalhealthClient\WebRole1\login.aspx.vb:line 462

    462

       Dimcache AsNewDataCache("default")


    My config


    <

    dataCacheClients>

      <

    dataCacheClientname="default">

        <

    autoDiscoverisEnabled="true"identifier="WebRole1"/>

        <!--

    <localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />-->

      </

    dataCacheClient>

    </

    dataCacheClients>

    <

    cacheDiagnostics>

      <

    crashDumpdumpLevel="Off"dumpStorageQuotaInMB="100"/>

    </

    cacheDiagnostics>

    </

    configuration>

    Thursday, May 16, 2013 7:47 PM
  • Hi Mike,

    I'll recommend you to go through the steps mentioned at http://www.windowsazure.com/en-us/develop/net/how-to-guides/cache/ . Just instead of using 1.8 Cache NuGet package, use 2.0 Cache NuGet package.

    Let me know if you still hit issues.


    Saad Nawaz
    SDET
    Windows Azure Tools for Microsoft Visual Studio

    This posting is provided "AS IS" with no warranties, and confers no rights.


    • Edited by Saad Nawaz Thursday, May 16, 2013 8:30 PM
    Thursday, May 16, 2013 8:29 PM
  • Found a solution using these 2 articles.

    Migrate from Windows Azure Shared Caching to Caching on Roles I was using a previous version of shared caching that had to be removed.

    How to: Add Items to the Cache 

    shows how to add items

    Hope this help someone

    • Marked as answer by Mike Bullen Sunday, May 19, 2013 3:36 PM
    Sunday, May 19, 2013 3:36 PM