Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Azure 如何将参数传递到存储Uri?_Azure_C# 4.0 - Fatal编程技术网

Azure 如何将参数传递到存储Uri?

Azure 如何将参数传递到存储Uri?,azure,c#-4.0,Azure,C# 4.0,我正在azure上工作,请您帮助我如何将参数传递到azure中的storageUri 这里有5个参数credientials,blob,queue,table,file 如何传递参数storageuri?请检查下面的代码 enter code here Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount = null; string AccountName = RoleEnvironm

我正在azure上工作,请您帮助我如何将参数传递到azure中的storageUri

这里有5个参数credientials,blob,queue,table,file 如何传递参数storageuri?请检查下面的代码

enter code here  
      Microsoft.WindowsAzure.Storage.CloudStorageAccount storageAccount = null;
        string AccountName = RoleEnvironment.GetConfigurationSettingValue("AccountName");
        string AccountKey = RoleEnvironment.GetConfigurationSettingValue("AccountKey");
        StorageCredentialsAccountAndKey credentials = new StorageCredentialsAccountAndKey(AccountName, AccountKey);
        storageAccount = new Microsoft.WindowsAzure.Storage.CloudStorageAccount(credentials,
                                                              new StorageUri(),
                                                              new StorageUri("https://{0}.queue.core.windows.net"),
                                                              new StorageUri("https://{0}.table.core.windows.net"),
                                                               new StorageUri("https://{0}.table.core.windows.net"));

请尝试以下操作:

        var credentials = new StorageCredentials(accountName, accountKey);
         CloudStorageAccount storageAccount = new CloudStorageAccount(credentials,
             new StorageUri(new Uri(string.Format("https://{0}.blob.core.windows.net", accountName))),
             new StorageUri(new Uri(string.Format("https://{0}.queue.core.windows.net", accountName))),
             new StorageUri(new Uri(string.Format("https://{0}.table.core.windows.net", accountName))),
             new StorageUri(new Uri(string.Format("https://{0}.file.core.windows.net", accountName)))
             );

您希望传递这些存储URI参数的原因是什么?从您的问题来看,您似乎正在连接到标准存储端点。是的,当我们传递“DefaultEndpointsProtocol=https”时,我们面临一些问题,因此我们正在传递StorageCredentialsAccountAndKey或StorageCredentials中的帐户名和密钥,因此对于其需要的端点,您可以帮助我如何传递storageuri参数吗