Windows Azure 系列-- Azure Redis Cache的配置和使用
来源:互联网 发布:莆田网络安全教育平台 编辑:程序博客网 时间:2024/04/29 09:55
如果还没有配置Azure Power shell 可以参照这里进行配置:
http://blog.csdn.net/lan_liang/article/details/46850221
(如果已经添加就不用了)
2. 运行
进到Azure Cache页面,可以看到Cache正在创建
3. 进入https://portal.azure.com/#create/Microsoft.Cache.1.0.4创建Cache
5. 安装nuget package
6. Console Application的代码:
PrimaryKey在这里看:
将代码中的"your_domain"替换为你的DNS,password替换为你的PrimaryKey
http://blog.csdn.net/lan_liang/article/details/46850221
打开Azure Power Shell
Add-AzureAccount
(如果已经添加就不用了)
2. 运行
New-AzureManagedCache -Name mycache -Location "South Central US" -Sku Basic -Memory 128MB
进到Azure Cache页面,可以看到Cache正在创建
3. 进入https://portal.azure.com/#create/Microsoft.Cache.1.0.4创建Cache
4. 点击菜单Redis Caches 可以看到redis已经创建好了:
5. 安装nuget package
6. Console Application的代码:
static void Main(string[] args) { ConnectionMultiplexer connection = ConnectionMultiplexer.Connect("your_domain.redis.cache.windows.net,ssl=true,password=YourPrimaryKey"); IDatabase cache = connection.GetDatabase(); // Perform cache operations using the cache object... // Simple put of integral data types into the cache cache.StringSet("key1", "value"); cache.StringSet("key2", 25); // Simple get of data types from the cache string key1 = cache.StringGet("key1"); Console.WriteLine(key1); int key2 = (int)cache.StringGet("key2"); Console.WriteLine(key2); Console.Read(); }
PrimaryKey在这里看:
将代码中的"your_domain"替换为你的DNS,password替换为你的PrimaryKey
0 0
- Windows Azure 系列-- Azure Redis Cache的配置和使用
- Windows Azure系列-- 配置Azure Power Shell
- Windows Azure 系列-- Azure Queue的操作
- Azure Redis Cache 简介
- [Windows Azure] 使用 Windows Azure 快速搭建 Redis 服务器
- 使用Windows Azure的场景和解决方案
- Windows Azure入门教学系列 (八):使用Windows Azure Drive
- Windows Azure 系列-- 使用Azure + Web API实现图片上传
- Azure Redis Cache (1) 入门
- Windows Azure系列-- Azure Table的CRUD操作
- 使用 Windows Azure 快速搭建 Redis 服务器
- Web Sites系列:使用Windows Azure的Web Sites和WebMatrix创建PHP和MySQL站点
- 使用 Azure PowerShell 管理 Azure 虚拟网络和 Windows 虚拟机
- Windows Azure订阅和服务的默认配置极限
- 1. 使用azure powershell 管理azure redis
- 配置 windows azure 项目
- [Azure]Azure虚拟机扩展的介绍和使用
- Windows Azure使用必读
- 光源
- OpenFileDialog的用法
- Remove Linked List Elements
- Delphi的in循环
- 根据汉语字符串获得对应的拼音字符串或者拼音首字母字符串等操作
- Windows Azure 系列-- Azure Redis Cache的配置和使用
- 深度学习之一:概述
- OPCACHE和APC相关问题
- Mongoose源码剖析:外篇之web服务器
- Android当中用到的Log和Toast
- 改变XCode的默认设置
- Linux多线程编程及线程同步方法总结
- Remove Nth Node From End of List
- ionic返回键双击退出