在Windows 10 IOT / UWP Azure存储库的客户端? [英] Azure Storage Library Client on Windows 10 Iot/UWP?
问题描述
看来,Azure存储客户端不支持Windows 10 IOT核心/ UWP(RPI)。不过,我使用它的斑点,它也用于工作的优良表。现在,更新到最新的稳定后(和 - pre,都试过)的访问表挂在
等待table.ExecuteQuerySegmentedAsync(查询,新TableContinuationToken());
我徒劳地寻找一种方法,使这个同步的,这会,至少,帮我调试。我也想知道别人的目前的成功和对使用物联网核心(RPI)的Azure存储客户端的瓢。
更新:
扩展RequestOptions下面我简单的调用也如下所示。我双重检查连接字符串,表的访问(从其他工具)和帐户。他们都来自其他地方的正常工作。我也贴我VStudio2015远程调试,以物联网核心树莓派最新版本得到例外。
//设置表容器
// connectString中看起来不错,其他地方正常工作:调试HTTP代替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);
//永远不会返回变种X =等待cloudTable.CreateIfNotExistsAsync(); //简单的查询,以现有的小桌子
变种p键=b8-27-EB-86-5d-4D
变种r键=0000000013505717;
VAR TSTOP = TableOperation.Retrieve(p键,r键);
VAR requestOptions =新TableRequestOptions
{
PayloadFormat = TablePayloadFormat.JsonFullMetadata,
LocationMode = LocationMode.PrimaryThenSecondary,
RetryPolicy =新ExponentialRetry()
ServerTimeout = TimeSpan.FromMinutes(2)
};
//抛出如下所示的异常。
VAR TST1 =等待table.ExecuteAsync(TSTOP,requestOptions,NULL);
例外:任何意见或修改我的测试code
?< XML版本= \\ {1.0 \\编码= \\UTF-16 \\> \\ r \\ n< - !发生了异常。欲了解更多信息,请反序列化通过RequestResult.TranslateFromExceptionMessage此消息.--> \\ r \\ n< RequestResult> \\ r \\ n<的HTTPStatus code取代; 403< /的HTTPStatus code> \\ r \\ n< HttpStatusMessage>服务器无法进行身份验证的要求确保授权头的值是正确形成,包括签名< / HttpStatusMessage> \\ r \\ n< TargetLocation>小学及LT; / TargetLocation> \\ r \\ n< ServiceRequestID> c4892c5a -0002-003a-4992-493991000000< / ServiceRequestID> \\ r \\ n< ContentMd5 /> \\ r \\ n< Etag的/> \\ r \\ n< RequestDate>周三,2016年1月6日22时三十分01秒GMT< / RequestDate> \\ r \\ n<开始时间>周三,01月06日21时29分55秒GMT&LT 2016年; /开始时间> \\ r \\ n<结束时间>周三,2016年1月6日21时32分12秒GMT< /结束时间&GT ; \\ r \\ n<错误> \\ r \\ n< code基AuthenticationFailed< / code> \\ r \\ n<消息>服务器无法验证请求。请正确地形成一定的Authorization头的价值,包括signature.\\r\
RequestId:c4892c5a-0002-003a-4992-493991000000\\r\
Time:2016-01-07T21:30:36.1204037Z</Message>\\r\
&LT; /错误&GT; \\ r \\ n&LT; ExceptionInfo&GT; \\ r \\ n&LT;类型&GT; StorageException&LT; /型号&GT; \\ r \\ n&LT; HResult的&GT; -2147467259&LT; / HResult的&GT; \\ r \\ n&LT;消息&GT;不能访问一个封闭的流&LT; /信息&GT; \\ r \\ n&lt;信源/&GT; \\ r \\ n&LT;堆栈跟踪/&GT; \\ r \\ n&LT; InnerExceptionInfo&GT; \\ r \\ n&LT; ExceptionInfo&GT; \\ r \\ n&LT ;类型&GT;的ObjectDisposedException&LT; /型号&GT; \\ r \\ n&LT; HResult的&GT; -2146232798&LT; / HResult的&GT; \\ r \\ n&LT;消息方式&gt;无法访问已关闭的流&LT; /信息&GT; \\ r \\ n&lt;信源&GT;的mscorlib&LT ; /来源&GT; \\ r \\ n&LT;&栈跟踪GT;在System.IO .__ Error.StreamIsClosed(个)\\ r \\ n在System.IO.BufferedStream.ReadAsync(字节[]缓冲区,偏移的Int32,算的Int32,的CancellationToken的CancellationToken)\\ r \\ n在System.Net.Http.DelegatingStream。 ReadAsync(字节[]缓冲区,偏移的Int32,算的Int32,的CancellationToken的CancellationToken)\\ r \\ n在Microsoft.WindowsAzure.Storage.Core.Util.StreamExtensions.<WriteToAsync>d__3`1.MoveNext()\\r\
---从previous位置堆栈跟踪,其中引发异常的结尾--- \\ r \\ n在System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(任务任务)\\ r \\ n在System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务task)\\ r \\ n在System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(任务任务)\\ r \\ n在Microsoft.WindowsAzure.Storage.Core.Executor.Executor.<ExecuteAsyncInternal>d__c`1.MoveNext()</StackTrace>\\r\
&LT; / ExceptionInfo&GT; \\ r \\ n&LT; / InnerExceptionInfo&GT; \\ r \\ n&LT; / ExceptionInfo&GT; \\ r \\ n&LT; / RequestResult&gt;中}
是的,不幸的是UWP的应用程序都还没有被存储的支持,因为有一个在UWP平台,导致问题验证的错误。我们正在等待从UWP团队修复。谢谢!
It appears that the Azure Storage Client is not supported on Windows 10 Iot-Core/UWP (RPi). However, I am using it for Blobs, and it also used to work fine for Tables. Now, after an update to the latest stable (and -pre, tried both) the access to Tables hangs at
await table.ExecuteQuerySegmentedAsync(query, new TableContinuationToken());
I searched in vain for a way to make this synchronous, which would, at the least, help me debug it. I also am wondering about the current success of others and the "scoop" on using the Azure Storage Client on IoT-Core (RPi).
UPDATE: Extended the RequestOptions as below and my simple call also shown below. I double checked the connection string, the table access (from other tools) and the account. All of them work fine from other places. I've also pasted the exceptions I get in VStudio2015 remote debugging to IoT-Core RaspberryPi latest version.
// 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);
Exceptions: Any ideas or modifications to my test code?
{"<?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.<WriteToAsync>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.<ExecuteAsyncInternal>d__c`1.MoveNext()</StackTrace>\r\n </ExceptionInfo>\r\n </InnerExceptionInfo>\r\n </ExceptionInfo>\r\n</RequestResult>"}
Yes, unfortunately UWP apps are not supported yet by Storage, as there's a bug in the UWP platform that causes problems with Auth. We are waiting on a fix from the UWP team. Thanks!
这篇关于在Windows 10 IOT / UWP Azure存储库的客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!