安装Azure PowerShell SDK(> 2015.04)
获取并保存MoonCake的PublishSettingsFile:Get-AzurePublishSettingsFile-Environment azurechinacloud
导入publishfile到powershell:Import-AzurePublishSettingsFile–PublishSettingsFile “path”
切换resoucemanager:Switch-AzureMode -name AzureResourceManager
选择订阅:Select-AzureSubscription-name "订阅名称"(只有一个订阅时,可以省略)
创建resourcegroup:New-AzureResourceGroup -Name groupname -Location "ChinaEast/North" 注:选择东区或北区
创建redis:New-AzureRedisCache -ResourceGroupName groupname -Name rediesname-Location "China East/North"注:选择之前创建好的group和区域,需要一致
可以创建多个redies,可以东区和北区同时创建,重复以上命令即可
获取rediscache的信息:Get-AzureRedisCache
获取rediscache的访问密钥:Get-AzureRedisCacheKey-ResourceGroupName groupname -name rediesname
举例:
set-azurerediscache -ResourceGroupNamegroupname –name redisname -EnableNonSslPort $true
cmdletSet-AzureRedisCache at command pipeline position 1
Supplyvalues for the following parameters:
(Type!? for Help.)
MaxMemoryPolicy: AllKeysLRU
原文地址:http://neoni.blog.51cto.com/6022658/1727576