Tag:

Azure blob授权标头

我正在尝试从Xamarin iOS应用程序使用refit上传到azure blob存储。 这是我用于改装的接口configuration: [Headers("x-ms-blob-type: BlockBlob")] [Put("/{fileName}")] Task<bool> UploadAsync([Body]byte[] content, string sasTokenKey, [Header("Content-Type")] string contentType); 其中sasTokenKey参数如下所示: "/content-default/1635839001660743375-66f93195-e923-4c8b-a3f1-5f3f9ba9dd32.jpeg?sv=2015-04-05&sr=b&sig=Up26vDxQikFqo%2FDQjRB08YtmK418rZfKx1IHbYKAjIE%3D&se=2015-11-23T18:59:26Z&sp=w" 这是我如何使用重新调用azure blob服务器: var myRefitApi = RestService.For<IMyRefitAPI>("https://myaccount.blob.core.windows.net"); myRefitApi.UploadAsync(photoBytes, sasTokenKey, "image/jpeg" 但是我得到以下错误: Response status code does not indicate success: 403 (Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.) 如果我直接调用它,SASurl工作正常 […]

Azure移动服务自定义API多次调用SQL SP

我有一个自定义API的Azure移动服务,它似乎在进行多个SQL调用。 当我查看日志时,我看到从SP返回的多个响应。 其中一些是空的返回(没有logging集),而其中一个是正确的与SP进行通信,并返回一个logging集。 我知道我的iOS应用程序只调用一次自定义API。 这是自定义API: exports.post = function(request, response) { var mssql = request.service.mssql; var params = [request.query.FirstName , request.query.LastName , request.query.DOB , request.query.EmailAddress , request.query.PhoneNumber , request.query.FacilityID , request.query.DiagnosisID, request.query.GeneratedBy , request.query.UserTypeID]; console.log("processregistration params = '%j'", params); var sql = "exec MyStoredProcName ?, ?, ?, ?, ?, ?, ?, ?, ?"; mssql.query(sql, params, { […]