经常碰到客户给我们上ticket,表示他们无法链接China Azure(Mooncake)的service endpoint。在这类问题中,我们看到最多的报错是:"Unresolved DNS name"。
造成这类错误的原因是,我们在创建client的时候,需要显式的指定链接service的endpoint suffix,因为by default 是链接global azure的。
拿Azure Storage 举例来说:
Global Azure的连接串如下:
public static final String storageConnectionString = "DefaultEndpointsProtocol=https;" + "AccountName=<account name>;" + "AccountKey=<account key>";
但在连接China Azure(Mooncake)则需要显示指定endpoint suffix:
public static final String storageConnectionString = "DefaultEndpointsProtocol=https;" + "AccountName=<account name>;" + "AccountKey=<account key>;" + "EndpointSuffix=core.chinacloudapi.cn";
因此强烈推荐China Azure新入门客户阅读下面两篇文档: