Windows 10 IoT / UWP上的Azure存储库客户端?

GGleGrand

Windows 10 Iot-Core / UWP(RPi)似乎不支持Azure存储客户端。但是,我将其用于Blob,并且它也用于表。现在,在更新到最新的稳定版(以及-pre,都尝试过)之后,对Tables的访问将挂起

await table.ExecuteQuerySegmentedAsync(query, new TableContinuationToken());

我徒劳地寻找一种使此同步的方法,这至少可以帮助我调试它。我还想知道其他人当前的成功以及在IoT-Core(RPi)上使用Azure存储客户端的“窥探”。

更新:如下扩展了RequestOptions,我的简单调用也如下所示。我仔细检查了连接字符串,表访问权限(通过其他工具)和帐户。他们在其他地方都能正常工作。我还将VStudio2015远程调试中获得的异常粘贴到了IoT-Core RaspberryPi最新版本中。

        // Setup the table container
        // connectString looks fine, works fine elsewhere: http for debug instead of https 
        var connectionString = @"DefaultEndpointsProtocol=http;AccountName=myaccount;AccountKey=EUybijab+WHATEVERDzYubKGADwjf/6k5IuoRVgPMMqMez0gb07/dfAv9Qj1/v7NkstGAygWNab07q6FhNBQ==";

        var cloudStorageAccount = CloudStorageAccount.Parse(connectionString);
        CloudTableClient cloudTableClient = cloudStorageAccount.CreateCloudTableClient();
        cloudTable = cloudTableClient.GetTableReference(appSettings.AzureStorageOeConfigTableName);
        //never returns var x = await cloudTable.CreateIfNotExistsAsync();

        // Simplest query to existing small table
        var pkey = "b8-27-eb-86-5d-4d";
        var rkey = "0000000013505717";
        var tstOp = TableOperation.Retrieve(pkey, rkey);
        var requestOptions = new TableRequestOptions
        {
            PayloadFormat = TablePayloadFormat.JsonFullMetadata,
            LocationMode = LocationMode.PrimaryThenSecondary,
            RetryPolicy = new ExponentialRetry(),
            ServerTimeout = TimeSpan.FromMinutes(2)
        };
        // Throws exceptions shown below.
        var tst1 = await table.ExecuteAsync(tstOp, requestOptions, null);

例外:对我的测试代码有任何想法或修改吗?

{"<?xml version=\"1.0\" encoding=\"utf-16\"?>\r\n<!--An exception has occurred. For more information please deserialize this message via RequestResult.TranslateFromExceptionMessage.-->\r\n<RequestResult>\r\n  <HTTPStatusCode>403</HTTPStatusCode>\r\n  <HttpStatusMessage>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.</HttpStatusMessage>\r\n  <TargetLocation>Primary</TargetLocation>\r\n  <ServiceRequestID>c4892c5a-0002-003a-4992-493991000000</ServiceRequestID>\r\n  <ContentMd5 />\r\n  <Etag />\r\n  <RequestDate>Wed, 06 Jan 2016 22:30:01 GMT</RequestDate>\r\n  <StartTime>Wed, 06 Jan 2016 21:29:55 GMT</StartTime>\r\n  <EndTime>Wed, 06 Jan 2016 21:32:12 GMT</EndTime>\r\n  <Error>\r\n    <Code>AuthenticationFailed</Code>\r\n    <Message>Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.\r\nRequestId:c4892c5a-0002-003a-4992-493991000000\r\nTime:2016-01-07T21:30:36.1204037Z</Message>\r\n  </Error>\r\n  <ExceptionInfo>\r\n    <Type>StorageException</Type>\r\n    <HResult>-2147467259</HResult>\r\n    <Message>Cannot access a closed Stream.</Message>\r\n    <Source />\r\n    <StackTrace />\r\n    <InnerExceptionInfo>\r\n      <ExceptionInfo>\r\n        <Type>ObjectDisposedException</Type>\r\n        <HResult>-2146232798</HResult>\r\n        <Message>Cannot access a closed Stream.</Message>\r\n        <Source>mscorlib</Source>\r\n        <StackTrace>   at System.IO.__Error.StreamIsClosed()\r\n   at System.IO.BufferedStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)\r\n   at System.Net.Http.DelegatingStream.ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken)\r\n   at Microsoft.WindowsAzure.Storage.Core.Util.StreamExtensions.&lt;WriteToAsync&gt;d__3`1.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)\r\n   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.&lt;ExecuteAsyncInternal&gt;d__c`1.MoveNext()</StackTrace>\r\n      </ExceptionInfo>\r\n    </InnerExceptionInfo>\r\n  </ExceptionInfo>\r\n</RequestResult>"}
彼得·马里诺(Peter Marino)-MSFT

是的,很遗憾,Storage还不支持UWP应用,因为UWP平台中存在一个错误,导致Auth问题。我们正在等待UWP团队的修复。谢谢!

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Windows 10 IoT上的UWP

来自分类Dev

Windows 10 IoT PI上的Redis

来自分类Dev

远程客户端访问 Windows 10 IoT Core 时发生的事件?

来自分类Dev

Windows IoT远程客户端滞后

来自分类Dev

Windows 10 IoT 中的 ConnectionRefused

来自分类Dev

Windows 10 IoT上的WinUSB驱动程序

来自分类Dev

Windows 10 IoT上的WinUSB驱动程序

来自分类Dev

Windows IoT核心版10上的R代码

来自分类Dev

Windows IOT UWP - 中继

来自分类Dev

Windows IoT远程客户端工具未连接

来自分类Dev

在 c# 中使用 windows 10 iot 在树莓派存储上创建 txt 文件

来自分类Dev

在Windows 10 IoT中安装商店应用

来自分类Dev

Windows 10 IoT-REST API部署

来自分类Dev

Windows 10 IOT核心虚拟键盘?

来自分类Dev

Windows 10 IoT GPIO中断频率

来自分类Dev

创建 Windows 10 IoT Enterprise LTSC 映像

来自分类Dev

Windows 10 IoT Core 更改 DPI 缩放

来自分类Dev

IRC客户端无法在Windows 10上连接

来自分类Dev

在Windows 10上安装RHC客户端工具(Openshift)

来自分类Dev

在模拟设备上安装Windows 10 IoT核心版(可能是Azure Hub)

来自分类Dev

Windows 10 IoT核心版和UWP中缺少或缺少AppDomain

来自分类Dev

UWP C# Windows 10 IoT datepicker & timepicker 更新系统日期和时间

来自分类Dev

UWP 控制台应用程序是否适用于 Windows 10 IoT

来自分类Dev

带有应用服务的 Windows 10 IoT Core UWP 后台应用程序

来自分类Dev

Windows 10 IoT Core / .NET Core 2.0 / 在哪里存储数据?

来自分类Dev

如何在Windows 10 IoT上的树莓派2上运行空白应用程序

来自分类Dev

Windows 10 IoT上的USB移动宽带调制解调器?

来自分类Dev

如何访问从树莓派Windows 10 IoT上的摄像头捕获的图像

来自分类Dev

Windows 10 IoT上的USB移动宽带调制解调器?

Related 相关文章

热门标签

归档