I have problem downloading files from this blob storage on our custom domain with HTTPS.
I can download it through the browser if I make anonymous access on the custom domain.
I can download it through the Nuget package called Azure.Storage.Blobs with this connection string.
DefaultEndpointsProtocol=https;AccountName=websocketechoblobdev;AccountKey=xxxx;EndpointSuffix=core.windows.net
If I try to download it through the Nuget package called Azure.Storage.Blobs with this connection string.
DefaultEndpointsProtocol=https;AccountName=websocketechoblobdev;AccountKey=xxxx;BlobEndpoint=https://websocketechotest.opnbibliotheca.com
I get this error:
Response x-ms-client-request-id 'e0e7c66d-0629-43f3-85a7-79034ae77d03' does not match the original expected request id, 'e18050d9-6057-43fe-aaa0-5e41e9aa410c'.
Status: 200 (OK)
Headers:
Content-MD5: /iAiKhL83XuGqgNErvqdpg==
X-Cache: REDACTED
x-ms-request-id: 89bbe80a-101e-002f-048f-3e59dc000000
x-ms-client-request-id: e0e7c66d-0629-43f3-85a7-79034ae77d03
x-ms-version: 2021-04-10
x-ms-creation-time: Mon, 14 Mar 2022 12:29:32 GMT
x-ms-lease-status: unlocked
x-ms-lease-state: available
x-ms-blob-type: BlockBlob
x-ms-server-encrypted: true
X-Azure-Ref-OriginShield: REDACTED
X-Azure-Ref: REDACTED
Accept-Ranges: bytes
Content-Length: 3459
Content-Type: application/x-pkcs12
Date: Wed, 23 Mar 2022 10:28:19 GMT
ETag: '0x8DA05B64AED6E28'
Last-Modified: Mon, 14 Mar 2022 12:29:32 GMT
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
I found out that it works the first time I download the file but it fails with the exception above after that, it doesn't help to restart the program.
It has something to do with it being HTTPS, if I set it up to HTTP it works.
Thanks
• Kindly please check the CNAME records created for the custom domain link used for blob storage in the second connection string as it should point to the hostname of your blob storage endpoint. Thus, creating the appropriate DNS records required for redirecting the access requests to the blob storage endpoint will ensure that the communication is successful, validated, and authentic.
For more information on the above to map the custom domain correctly to the Azure blob storage, please refer to the documentation link below: -
https://learn.microsoft.com/en-us/azure/storage/blobs/storage-custom-domain-name?tabs=azure-portal#map-a-custom-domain-with-zero-downtime
• Secondly, would request you to please ‘Empty the cache and hard refresh’ the browser from where you are trying to access the Azure blob storage. Also, even though you might be trying to download the files from the blob storage through a program code using the connection string, please ensure that the code editor has been cleared of all the cache and temporary files and then the files from the blob storage are downloaded. This might negate the issue of the ‘x-ms-client-request-id’ header attribute being altered before leaving the ‘Azure.Storage.Blobs’ SDK.
• Finally, please take note that the custom domain name for any component of Azure storage only works for HTTP and not for HTTPS while the anonymous access enabled for the Azure blob containers from which files are to be downloaded are made publicly accessible as they are only supported for custom domain name access.
Related
I am going to develop a C# application using web service but the service is developed by Apache Axis2 and I can not handle the service to integrate adding service reference in C#. I get no response and only format exception.
I don't have service code, it's like ready-to-use web service, just give service reference and get started to use it.
The web service wsdl address is:
https://pttws.ptt.gov.tr/PttBilgi/services/Sorgu?wsdl
I also tried to run the service with SOAP UI but the XML response I get is like below:
<faultstring>The endpoint reference (EPR) for the Operation not found is /PttBilgi/services/Sorgu.SorguHttpSoap11Endpoint/ and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>
The raw response is like below, too which is but with some technical detail:
HTTP/1.1 500 Internal Server Error
Date: Fri, 14 Apr 2017 07:20:28 GMT
Server: gizli gizli gizli gizli
X-OPNET-Transaction-Trace: a2_5cc44d1b-0e0c-48a5-a44f-942377e9ab70
X-Powered-By: Servlet/2.5 JSP/2.1
Vary: Accept-Encoding,User-Agent
Connection: close
Transfer-Encoding: chunked
Content-Type: application/xml; charset=UTF-8
<faultstring>The endpoint reference (EPR) for the Operation not found is /PttBilgi/services/Sorgu.SorguHttpSoap11Endpoint/ and the WSA Action = null. If this EPR was previously reachable, please contact the server administrator.</faultstring>
It seems that content type has to be text/html to use it in C# apps but being of the service's content type is application/xml, so it can not convert to read and process the result.
How can I use the service with success, what do I have to do?
Thanks guys!
As described in this article at http://wso2.com/library/176/
If Axis2 engine cannot find a service and an operation for a message, it immediately fails, sending a fault to the sender.
If service not found - "Service Not found EPR is "
If service found but not an operation- "Operation Not found EPR is and WSA Action = "
I've search here and in Google but I can't find a solution.
With my C# code I want to read a file from Azure Storage Blob.
The code (only 6 line) works very well in another project (Windows 8.1 Universal App) but not in my new Windows 10 UWP App.
This is my code:
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(azureConnectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("container-name");
CloudBlob b1 = container.GetBlobReference("27.76914.json");
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("stefano1.json", CreationCollisionOption.ReplaceExisting);
await b1.DownloadToFileAsync(file);
The Exception:
Server failed to authenticate the request. Make sure the value of
Authorization header is formed correctly including the signature.
Using Fiddler4 I found this error on message 403:
The MAC signature found in the HTTP request 'R2t9hKsyXf470HF2LNP8T+M2nci0ddE/ojQ0r4UVjJQ=' is not the same as any computed signature
My attempts:
The application works the first time (file downloaded). The second time I get the Exception.
If I change the requested file name: the application works the first time (file downloaded). The second time I get the Exception.
The next day I get immediately the same exception (at first run)
Also if I delete bin and obj folders I get the error
If I create another application and try to download the same file (same as point 1), it works the first time, but not the second.
In a Console Application all works well.
This is the Fiddler4 Raw Request (where ***** is my Azure Storage Account Name):
GET https://*****.blob.core.windows.net/container-name/27.76914.json HTTP/1.1
x-ms-client-request-id: accee7e7-646d-417a-b734-1591cbc16a8d
x-ms-date: Thu, 03 Sep 2015 06:31:37 GMT
x-ms-version: 2015-02-21
User-Agent: WA-Storage/5.0.2 (Windows Runtime)
Authorization: SharedKey *****:R2t9hKsyXf470HF2LNP8T+M2nci0ddE/ojQ0r4UVjJQ=
Host: *****.blob.core.windows.net
If-Modified-Since: Sun, 30 Aug 2015 18:52:41 GMT
If-None-Match: "0x8D2B16C2ED82C4A"
Connection: Keep-Alive
Thank you!
This was also reported on our GitHub page here: https://github.com/Azure/azure-storage-net/issues/171
Our leading theory is that a caching proxy might be in between the client and the server affecting your requests.
We're still investigating and will let you know.
I've had a similar issue (in Java) trying to access blobs from local machine.
Trying to download a blob would work one out of two times, trying to get an InputStream never worked. In both cases the error was the same as yours.
My code always worked from a VM in the cloud.
The issue was fixed when I've changed the default protocol from HTTP to HTTPS.
When constructing your CloudStorageAccount, there is a constructor that allows you to specify the default protocol. It's also available for C# (here)
Also for the record, AZCopy will fail for a source with HTTP, with similar error.
You might give it a try.
I've search here and in Google but I can't find a solution.
With my C# code I want to read a file from Azure Storage Blob.
The code (only 6 line) works very well in another project (Windows 8.1 Universal App) but not in my new Windows 10 UWP App.
This is my code:
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(azureConnectionString);
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer container = blobClient.GetContainerReference("container-name");
CloudBlob b1 = container.GetBlobReference("27.76914.json");
StorageFile file = await ApplicationData.Current.LocalFolder.CreateFileAsync("stefano1.json", CreationCollisionOption.ReplaceExisting);
await b1.DownloadToFileAsync(file);
The Exception:
Server failed to authenticate the request. Make sure the value of
Authorization header is formed correctly including the signature.
Using Fiddler4 I found this error on message 403:
The MAC signature found in the HTTP request 'R2t9hKsyXf470HF2LNP8T+M2nci0ddE/ojQ0r4UVjJQ=' is not the same as any computed signature
My attempts:
The application works the first time (file downloaded). The second time I get the Exception.
If I change the requested file name: the application works the first time (file downloaded). The second time I get the Exception.
The next day I get immediately the same exception (at first run)
Also if I delete bin and obj folders I get the error
If I create another application and try to download the same file (same as point 1), it works the first time, but not the second.
In a Console Application all works well.
This is the Fiddler4 Raw Request (where ***** is my Azure Storage Account Name):
GET https://*****.blob.core.windows.net/container-name/27.76914.json HTTP/1.1
x-ms-client-request-id: accee7e7-646d-417a-b734-1591cbc16a8d
x-ms-date: Thu, 03 Sep 2015 06:31:37 GMT
x-ms-version: 2015-02-21
User-Agent: WA-Storage/5.0.2 (Windows Runtime)
Authorization: SharedKey *****:R2t9hKsyXf470HF2LNP8T+M2nci0ddE/ojQ0r4UVjJQ=
Host: *****.blob.core.windows.net
If-Modified-Since: Sun, 30 Aug 2015 18:52:41 GMT
If-None-Match: "0x8D2B16C2ED82C4A"
Connection: Keep-Alive
Thank you!
This was also reported on our GitHub page here: https://github.com/Azure/azure-storage-net/issues/171
Our leading theory is that a caching proxy might be in between the client and the server affecting your requests.
We're still investigating and will let you know.
I've had a similar issue (in Java) trying to access blobs from local machine.
Trying to download a blob would work one out of two times, trying to get an InputStream never worked. In both cases the error was the same as yours.
My code always worked from a VM in the cloud.
The issue was fixed when I've changed the default protocol from HTTP to HTTPS.
When constructing your CloudStorageAccount, there is a constructor that allows you to specify the default protocol. It's also available for C# (here)
Also for the record, AZCopy will fail for a source with HTTP, with similar error.
You might give it a try.
I was hoping one of you could help me with the use of AWS Kinesis. I have been pouring over the documentation and I am still unable to post a "blob" of data to a Kinesis stream.
In the API the standard POST request is as follows.
POST / HTTP/1.1
Host: kinesis.<region>.<domain>
x-amz-Date: <Date>
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=contenttype;
date;host;user-agent;x-amz-date;x-amz-target;x-amzn-requestid, Signature=<Signature>
User-Agent: <UserAgentString>
Content-Type: application/x-amz-json-1.1
Content-Length: <PayloadSizeBytes>
Connection: Keep-Alive
X-Amz-Target: Kinesis_20131202.PutRecord
{
"StreamName": "exampleStreamName",
"Data": "XzxkYXRhPl8x",
"PartitionKey": "partitionKey"
}
Using "Postman" a google chrome app to make Http requests and filling in the appropriate information for the above fields I cannot for the life of me figure out how to make a successful data post to a stream. I was unable to do this successfully so i went on to do use the .NET SDK for visual studio.
I made a quick command line c# console application I am still having some issues.
My code:
http://pastebin.com/cyJeC0vU
The error message, System.Xml.XmlException was unhandled, appears on line 61 of the code: http://pastebin.com/HEG7DmMw
Has anyone had a successful experience using AWS Kinesis. I would love to pick your brain / repay you somehow for a bit of tutoring.
Thanks again for all of your help!
The error you're getting indicates that the response from the service was not able to be parsed. There is a clue in that the SDK switched from the JSON parser to the XML parser because the response looked like XML. This usually indicates that you are behind a proxy which requires authentication, and the proxy is giving you an HTML error message.
You can verify this by firing up a protocol analyzer like Fiddler and watching the request traffic. If your proxy requires credentials, here is some documentation about using the AWS SDK for .NET with proxies:
Configuring Credentials for Your AWS SDK for .NET Application
I'm developing a game on Facebook and having a problem to update the scores of the players.
The application receives HTTP ERROR 403 from Facebook as a response to the update score Graph API call. When I replay the same HTTP post request from other machines it passes without any error.
More information:
Players are requested for publish_actions during registration
The application is registered as a game
The admins of the application don't get the error from FB
The servers which run the applications are behind a load balance
This can't be networking issue since some update requests pass, this can't also be permission issue since the request is passed when executed from other machines.
Does anyone have an idea how to solve the problem or give me a direction to keep on investigating?
HTTP session as recorded by fiddler( XXX is replacing the application access token):
POST /100000868887295/scores/?score=1&access_token=XXX HTTP/1.1
User-Agent: Fiddler
Host: graph.facebook.com
HTTP/1.1 403 Forbidden
Access-Control-Allow-Origin: *
Cache-Control: no-store
Content-Type: text/javascript; charset=UTF-8
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Pragma: no-cache
WWW-Authenticate: OAuth "Facebook Platform" "insufficient_scope" "(#200) User cannot access this application"
X-FB-Rev: 677653
X-FB-Debug: gxaao2ZoKOtcQNpLCO4Wh9kXigIhnGByugWQOlg0Y3Y=
Date: Sat, 24 Nov 2012 15:16:03 GMT
Connection: keep-alive
Content-Length: 101
{"error":{"message":"(#200) User cannot access this application","type":"OAuthException","code":200}}
Problem solved.
We had country restrictions defined in the Facebook application back office.
Since our server is not located in one of the allowed countries the requests sent from that server where rejected by Facebook.
Once we removed the country restrictions everything started to work.
The score api requires that you use an application access token to post the scores.