Los roles web están diseñados para el aprovisionamiento y desaprovisionamiento rápidos de sus aplicaciones en la nube. Tu puedes tener NCache se instala automáticamente con la implementación de un rol web. Para ello es necesario descargar el NCache Paquete NuGet que contiene todos los scripts de instalación que se necesitarán durante la implementación del rol web. Por favor haga clic aquí para obtener más información sobre cómo descargar el NCache Paquete NuGet.
Para la instalación de NCache en Azure durante la implementación del rol web, el primer script que se ejecuta es tarea de inicio.cmd que a su vez llama a otros scripts, realizando las siguientes tareas:
Hay algunas variables de entorno de inicio utilizadas en estos scripts que deben definirse primero. Para eso, se debe insertar el siguiente código en el Definición de servicio.csdef archivo de su rol web.
<Startup>
<Task commandLine="Azure_Install_Scripts\startuptask.cmd"
executionContext="elevated"
taskType="simple">
<Environment>
<!--Check whether Azure project is running in emulated environment or not.
If this role is running in emulated environment, then startup scripts will
be avoided-->
<Variable name="EMULATED">
<RoleInstanceValue xpath="/RoleEnvironment/Deployment/@emulated" />
</Variable>
<!--Specify path for NCache Azure Client Setup for installation on
client role-->
<Variable name="NCache.SetupPath"
value="" />
<!--Specify cache name to add current role as client node of specified
cluster cache-->
<Variable name="NCache.CacheName"
value="test" />
<!--Specify cache server IP for communication with cache.
For multiple servers, specify comma separated IPs as specified in example.
For public port, specify ports with server as "10.0.0.4:8270,10.0.0.5:8271"-->
<Variable name="NCache.CacheServers"
value="23.97.66.31:8250,23.97.66.31:8251" />
<!--Specify "true" if you want to create a client cache on this role
otherwise "false"-->
<Variable name="NCache.CreateClientCache"
value="true" />
<!--Specify client cache name if you want to configure client cache on
this role-->
<Variable name="NCache.ClientCacheName"
value="myclientcache" />
<!--Specify client cache size. (Compulsory option for configuring
client cache)-->
<Variable name="NCache.ClientCacheSize"
value="250" />
<!--Specify "true" if your client role is outside the virtual network of
your cache. Your public endpoints will be used for communication with the
server from current client role. If your client role is within the same virtual
network as your cache, then specify "false"-->
<Variable name="NCache.UseEndPoint"
value="true" />
<!--Specify startup task log path-->
<Variable name="NCache.LogPath"
value="" />
<!-- Specify if client cache is inproc or not-->
<Variable name="NCache.IsInproc"
value="false" />
</Environment>
</Task>
</Startup>
A Readme.txt El archivo se proporciona con el paquete NuGet que explica los cambios de web.config para el NCache en el proveedor del almacén de sesiones de Azure, y NCache en Azure client.ncconf cambia para conectarse a una memoria caché ya configurada en su entorno. Esta información se puede utilizar como referencia para cuando NCache en las configuraciones de Azure deben cambiarse.