Sie sind auf Seite 1von 8

Install Guide "Redis Cache"

For:

HSBC
Proyect:

Hsbc MVP1
By:
Charienne Campos Echeverría
Version:
1.0
In:
22 de Noviembre de 2018
Index

Content table
Index .................................................................................................................................................... 2
Prerequisites ....................................................................................................................................... 3
Create a Cache .................................................................................................................................... 3
Retrieve host name, ports, and access keys by using the Azure portal .............................................. 6
Configure the application from web config ........................................................................................ 7
Resource .............................................................................................................................................. 8
Prerequisites
Visual Studio (.Net Framework or plus)
StackExchange.Redis Client

Create a Cache
1. To create a cache, first sign in to the Azure portal. Then select Create a
resource > Databases > Redis Cache.
2. In New Redis Cache, configure the settings for your new cache.

 DNS name: The cache name. It must be a string between 1 and 63


characters and contain only numbers, letters, and the - character. The
cache name cannot start or end with the - character, and consecutive -
characters are not valid. For example: contoso, HsbcRedis, etc.
 Subscription: The subscription under which this new Azure Redis Cache
instance is created.
 Resource group : Name for the new resource group in which to create your
cache. By putting all the resources for an app in a group, you can manage
them together. For example, deleting the resource group deletes all
resources that are associated with the app.
 Location: Choose a region near to other services that will use your cache.
 Pricing tier: The pricing tier determines the size, performance, and
features that are available for the cache. For more information, see Azure
Redis Cache Overview.
 Pin to dashboard: Pin the new cache to your dashboard to make it easy
to find.

3.- After the new cache settings are configured, select Create.
It can take a few minutes for the cache to be created. To check the status, you can
monitor the progress on the dashboard. After the cache has been created, it shows
the status Running, and is ready for use.
Retrieve host name, ports, and access keys by using the Azure portal
When connecting to an Azure Redis Cache instance, cache clients need the host
name, ports, and a key for the cache. Some clients might refer to these items by
slightly different names. You can retrieve this information in the Azure portal.

1. To retrieve the access keys by using the Azure portal, browse to your cache
and select Access keys.

2. To retrieve the host name and ports, select Properties.


3. To retrieve the main and secondary connection string, browse to your cache
and select Access keys.

Configure the application from web config


In the web config of the application, within the app settings section, a key with the
primary connection string previously seen will be added, as in this example:
<appSettings>
<add key="CacheConnection" value="<cache-
name>.redis.cache.windows.net,abortConnect=false,ssl=true,password=<access-
key>"/>
</appSettings>
Resource
https://docs.microsoft.com/en-us/azure/redis-cache/cache-dotnet-how-to-use-
azure-redis-cache
https://docs.microsoft.com/en-us/azure/redis-cache/

Das könnte Ihnen auch gefallen