Imagine, we have 2 Azure storage accounts, one of them is regular, other one - Government (or Germany, Chine etc.). Here is how we create CloudBlobClient:
private const string ConnectionStringTemplate = "DefaultEndpointsProtocol={0};AccountName={1};AccountKey={2};";
public static CloudBlobClient Create(string protocol, string accountName, string accountKey)
{
var connectionString = string.Format(CultureInfo.InvariantCulture, ConnectionStringTemplate, protocol, accountName, accountKey);
var account = CloudStorageAccount.Parse(connectionString);
return account.CreateCloudBlobClient();
}
This code works fine for regular account, but for Government one doesn't. We should specify EndpointSuffix (core.usgovcloudapi.net instead of core.windows.net which is default), and connection string should be like this:
"DefaultEndpointsProtocol={0};AccountName={1};AccountKey={2};EndpointSuffix={3}";
So, the question is, how can I know which account is if have only AccountName and AccountKey? Is there some API method to check account type or endpoint suffix for them?