[Redis] Configure Redis through code

Source: Internet
Author: User
Tags baseuri

Looking at the document https://azure.microsoft.com/en-us/documentation/articles/cache-how-to-scale/, I found that you could use code to configure Redis, so it was interesting to try it out.

Download the demo instance via Https://github.com/rustd/RedisSamples/tree/master/ManageCacheUsingMAML and refer to https:// Msdn.microsoft.com/en-us/library/azure/dn790557.aspx#bk_portal the ad-related configuration and discovers that it is connected to global Azure by default at the time of authentication:

Well, this is a common problem with the China Azure, only to find the local configuration, to see the redismanagementclient , found that includes the BaseURI constructor, it should be:

But do not know the Redis service in China Azure, its baseuri is how much, the official website also does not have the relevant description, how to do? Call the PowerShell command Get-azurerediscache and use the Fiddler capture package to view:

Yes, the baseuri of China Azure Redis should be https://management.chinacloudapi.cn/, so the authentication client should read:

Redismanagementclient client = new Redismanagementclient (creds, new Uri ("https://management.chinacloudapi.cn/")) ;

And the document is using the default AD account:

So I'm going to have a different account, create a new ad account and try it.

[Redis] Configure Redis through code

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.