gpt4 book ai didi

windows - Blob容器创建异常

转载 作者:可可西里 更新时间:2023-11-01 11:59:10 26 4
gpt4 key购买 nike

每次尝试为 blob 创建容器时都会出现异常

使用以下代码

<小时/>
CloudStorageAccount storageAccInfo;
CloudBlobClient blobStorageType;
CloudBlobContainer ContBlob;

blobStorageType = storageAccInfo.CreateCloudBlobClient();

//then I initialize storageAccInfo

ContBlob = blobStorageType.GetContainerReference(containerName);
//everything fine till here ; next line creates an exception

ContBlob.CreateIfNotExist();
<小时/>
Microsoft.WindowsAzure.StorageClient.StorageClientException was unhandled
Message="One of the request inputs is out of range."
Source="Microsoft.WindowsAzure.StorageClient"
StackTrace:
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.get_Result()
at Microsoft.WindowsAzure.StorageClient.Tasks.Task`1.ExecuteAndWait()
at Microsoft.WindowsAzure.StorageClient.TaskImplHelper.ExecuteImplWithRetry[T](Func`2 impl, RetryPolicy policy)
at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.CreateIfNotExist(BlobRequestOptions options)
at Microsoft.WindowsAzure.StorageClient.CloudBlobContainer.CreateIfNotExist()
at WebRole1.BlobFun..ctor() in C:\Users\cloud\Documents\Visual Studio 2008\Projects\CloudBlob\WebRole1\BlobFun.cs:line 58
at WebRole1.BlobFun.calling1() in C:\Users\cloud\Documents\Visual Studio 2008\Projects\CloudBlob\WebRole1\BlobFun.cs:line 29
at AzureBlobTester.Program.Main(String[] args) in C:\Users\cloud\Documents\Visual Studio 2008\Projects\CloudBlob\AzureBlobTester\Program.cs:line 19
at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: System.Net.WebException
Message="The remote server returned an error: (400) Bad Request."
Source="System"
StackTrace:
at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.StorageClient.EventHelper.ProcessWebResponse(WebRequest req, IAsyncResult asyncResult, EventHandler`1 handler, Object sender)
InnerException:
<小时/>

你们知道我做错了什么吗?

最佳答案

我的猜测是您使用的容器名称违反了命名规则。检查http://msdn.microsoft.com/en-us/library/dd135715.aspx .

关于windows - Blob容器创建异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2620521/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com