【问题标题】:The remote name could not be resolved when creating blob Container创建 blob 容器时无法解析远程名称
【发布时间】:2015-01-17 03:02:26
【问题描述】:

我正在尝试使用 azure 将屏幕截图存储到云中,但我不断收到此异常:
无法解析远程名称:'azuretest.blob.core.windows.net.blob.core.windows.net'

CloudStorageAccount storageAccount = CloudStorageAccount.Parse(CloudConfigurationManager.GetSetting("StorageConnectionString"));

CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

CloudBlobContainer container = blobClient.GetContainerReference("screenshots");
container.CreateIfNotExists();

有谁知道可能导致此异常的原因是什么?

【问题讨论】:

    标签: c# winforms azure blob


    【解决方案1】:

    您的连接字符串中似乎有错误的帐户名称,您应该有:

    AccountName=azuretest

    代替:

    AccountName=azuretest.blob.core.windows.net

    【讨论】:

      【解决方案2】:

      您已经设置了两次“blob.core.windows.net”。如果您使用“azuretest.blob.core.windows.net”,它应该可以正常工作。

      【讨论】:

        【解决方案3】:

        在应用设置部分中刚刚添加了以下设置,没有 http、https 和 azuresearch.search.azure.com 等扩展名...

         <appSettings>
            <add key="SearchServiceName" value="azuresearch" />
            <add key="SearchServiceApiKey" value="629B1FEC5627AC0D4546B64F1375A634322" />
          </appSettings
        

        这对我来说很好。

        【讨论】:

          【解决方案4】:

          我从连接字符串中删除了“EndpointSuffix”键来解决这个问题。

          来自

          DefaultEndpointsProtocol=https;AccountName=<account name>;AccountKey=<accoount key>;EndpointSuffix=core.windows.net​​
          

          DefaultEndpointsProtocol=https;AccountName=<account name>;AccountKey=<accoount key>
          

          【讨论】:

            【解决方案5】:

            我遇到了同样的问题。当 azure 找不到正确的互联网连接时也会引发此异常。因此,请检查您的互联网连接并重试。我希望这可以解决此问题。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 2021-09-08
              • 1970-01-01
              • 2016-05-31
              • 2013-05-13
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多