简体   繁体   English

在开发环境中获取Azure服务属性错误

[英]Getting the Azure service properties errors on dev environment

I would like to set the DefaultServiceVersion for my azure storage instance, so I wrote the following code: 我想为我的azure存储实例设置DefaultServiceVersion,所以我编写了以下代码:

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

CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
var serviceProperties = blobClient.GetServiceProperties();
if (serviceProperties.DefaultServiceVersion != "2011-08-18")
{
    serviceProperties.DefaultServiceVersion = "2011-08-18";
    blobClient.SetServiceProperties(serviceProperties);
}

I then tried to run it with the development storage server, and got an exception (erroring in the dev server by the looks) from blobClient.GetServiceProperties() 然后,我尝试使用开发存储服务器运行它,并从blobClient.GetServiceProperties()获得异常(外观服务器中的错误blobClient.GetServiceProperties()

Microsoft.WindowsAzure.StorageClient.StorageServerException was unhandled by user code
  HResult=-2146233088
  Message=Server encountered an internal error. Please try again after some time.
  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.CloudBlobClient.GetServiceProperties()
       at ConsoleApp.GetContainer() in c:\app\Program.cs:line 90
       at ConsoleApp.Main() in c:\app\Program.cs:line 47
       at lambda_method(Closure , ControllerBase , Object[] )
       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
       at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult _)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49()
  InnerException: System.Net.WebException
       HResult=-2146233079
       Message=The remote server returned an error: (500) Internal Server Error.
       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: 

Is it possible to set the DefualtServiceVersion with a dev server? 是否可以使用开发服务器设置DefualtServiceVersion? I haven't tried with the real thing as I really only want to test if this solves another issue I'm having. 我没有试过真实的东西,因为我真的只想测试这是否解决了我遇到的另一个问题。

Based on the documentation here: http://msdn.microsoft.com/en-us/library/windowsazure/microsoft.windowsazure.storage.blob.cloudblobclient.getserviceproperties.aspx (scroll down to "Remarks" section), this operation is not currently supported on local storage. 基于此处的文档: http//msdn.microsoft.com/en-us/library/windowsazure/microsoft.windowsazure.storage.blob.cloudblobclient.getserviceproperties.aspx (向下滚动到“备注”部分),此操作是当前存储当前不支持。 Also SetServiceProperties operation which enables/disables storage analytics is also not supported. 此外,还不支持启用/禁用存储分析的SetServiceProperties操作。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将单个项目从 Azure Dev Ops 发布到 Azure 应用服务环境 - Publish single project from Azure Dev Ops to Azure App Service Environment Azure VM中开发和沙箱环境的模板 - Template for dev and sandbox environment in Azure VM 在azure上设置sharepoint开发环境? - Setting up sharepoint dev environment on azure? 从 Prod 为 Azure SQL 创建开发环境 - Dev Environment creation from Prod for Azure SQL 在同一应用程序服务环境中进行开发/测试/生产? - Dev/Test/Prod in the Same Application Service Environment? Service Fabric Azure测试环境 - Service Fabric Azure test environment 为开发人员环境设置“应用程序服务环境”(ase)的最便宜方法? - cheapest way to set up an “app service environment” (ase) for a dev environment? Azure移动服务中的日志错误 - Log Errors in Azure Mobile Service 用于从设备孪生获取所需属性的 Azure 物联网集线器设备与服务 SDK? - Azure Iot hub Device vs. Service SDK for getting desired properties from Device twin? 尝试发送带有代理属性的Azure Service Bus消息时出现400错误 - Getting 400 error when trying to send an azure service bus message with broker properties
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM