CreateIfnotExists抛出连接错误

时间:2016-12-20 13:11:08

标签: azure iis azure-storage

CreateIfNotExists方法抛出错误:

  

无法建立连接,因为目标计算机主动拒绝了它52.140.168.120:443

使用应用程序池标识时。

// Parse the connection string and return a reference to the storage account.
            CloudStorageAccount storageAccount = CloudStorageAccount.Parse(connectionString);

            // Create the blob client.
            CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();

            CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");

            if (container.CreateIfNotExists())
            {
                BlobContainerPermissions containerPermissions = new BlobContainerPermissions() { PublicAccess = BlobContainerPublicAccessType.Blob };
                container.SetPermissions(containerPermissions);
                container.CreateIfNotExists();
            }

但这适用于使用自定义用户帐户和密码。 有没有办法使用应用程序池标识来实现这一点。

0 个答案:

没有答案
相关问题