Accessing Azure storage from Windows Phone with REST

I'm struggling in the attempt to establish a simple httpwebrequest to gather some metadata on a blob,
my code works perfectly fine on windows but
gives error 403 on windows phone 7.
The really strange thing is that as you can see from the HEAD requests
the same auth that is ok from windows is not ok on windows phone...
I use a standard httpwebrequest to establish the connection, the code is at the end of the post.
I lost already 10 hours attempting anything that made sense to me, but with no success at all:
i ended up establishing a Fiddler tunnel connection to compare the requests,
WORKING : Windows 8.1 desktop executable
HEAD https://{MYHOST}.blob.core.windows.net/add-saves/save{etc...} HTTP/1.1
ContentLength: 0
x-ms-date: Thu, 05 Feb 2015 00:50:00 GMT
x-ms-version: 2009-09-19
Authorization: SharedKey heartbit:YnZwcEoRunuuoK6PC+JRge{etc...}
Host: {MYHOST}.blob.core.windows.net
RETURNS
HTTP/1.1 200 OK
Content-Length: 21648
Content-Type: application/octet-stream
Last-Modified: Wed, 04 Feb 2015 21:19:07 GMT
ETag: 0x8D20ED7587824FE
Server: Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
x-ms-request-id: 767e3faa-0001-0016-1559-eb76ed000000
x-ms-version: 2009-09-19
x-ms-lease-status: unlocked
x-ms-blob-type: BlockBlob
Date: Thu, 05 Feb 2015 00:54:41 GMT
and my Windows Phone 7 app (throws with WebResponse 404 NotFound from webserver)
HEAD https://{MYHOST}.blob.core.windows.net/add-saves/save{etc...} HTTP/1.1
Accept: */*
Accept-Encoding: identity
ContentLength: 0
x-ms-date: Thu, 05 Feb 2015 00:50:00 GMT
x-ms-version: 2009-09-19
Authorization: SharedKey heartbit:YnZwcEoRunuuoK6PC+JRge{etc...}
Referer: file:///Applications/Install/5FEE5BAA-57A1-4451-B4A5-28E2E46C5598/Install/
User-Agent: NativeHost
Host: {MYHOST}.blob.core.windows.net
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
RETURNS
HTTP/1.1 403 Server failed to authenticate the request. Make sure the value of Authorization header is formed correctly including the signature.
Transfer-Encoding: chunked
Server: Microsoft-HTTPAPI/2.0
x-ms-request-id: b2654a03-0001-0038-1dd9-c4cb58000000
Date: Thu, 05 Feb 2015 00:55:00 GMT
byte[] byteArray = null;
// There is an error where on the android system the clock could be set ahead in time when the request is made to when it arrives to ms's servers
// Giving a minute of backlogging could be enough
DateTime now = DateTime.UtcNow - TimeSpan.FromMinutes(1);
string uri = Endpoint + resource;
HttpWebRequest request = CreateRequestBody(method, requestBody, headers, ref byteArray, now, uri);
string messageSign = MessageSignature(method, now, request, ifMatch, md5);
requestAuthAsync(messageSign, authKey =>
try
if (((string)authKey) == "Error")
throw new Exception("Auth failure");
String AuthorizationHeader = "SharedKey " + StorageAccount + ":" + authKey;
request.Headers.Add("Authorization", AuthorizationHeader);
if (!String.IsNullOrEmpty(requestBody))
request.GetRequestStream().Write(byteArray, 0, byteArray.Length);
request.BeginGetResponse((ar) =>
try
var r = request.EndGetResponse(ar);
onCompleted(r);
catch (WebException e)
onCompleted.Invoke("Error : " + (e.Response as HttpWebResponse).StatusDescription);
catch (Exception e)
onCompleted.Invoke("Error : " + e.Message);
}, null);
catch (Exception e)
onCompleted.Invoke("Error : " + e.Message);
catch(Exception ioe)
onCompleted.Invoke("Error : " + ioe.Message);
Heart Bit Interactive

It seems like thw windows phone version of HttpWebRequest automatically adds a "Content-Length" header that is different from the one given by me ("ContentLength"). Why is that?
The auth signing shouldnt depend on that right?
Since i cannot find a way to remove that header i tried removing the one i was manually adding, but without luck.
Are the other headers that are  automatically added on windows phone :
Accept: */*
Accept-Encoding: identity
Referer: file:///Applications/Install/5FEE5BAA-57A1-4451-B4A5-28E2E46C5598/Install/
User-Agent: NativeHost
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
Will they create issues with autorization? The auth string in WP is the same found on Windows so there must be something in the WP request to azure that doesn't match the auth string i generated early.
<a href="http://www.youtube.com/user/EversorITA" target="_new" title="My Games">Heart Bit Interactive</a>

Similar Messages

  • How to read azure storage data using JAVA with REST API

    Hi,
    We have a cloud service in our lab. We have enabled diagnostics
    in cloud services. So WADPerformanceCounterTable was created in storage account. Now , We want to read the WADPerformanceTable using
    JAVA with REST API. Is there any way to collect these details. please give me any
    sample code to connect azure storage using table service REST API.
    Thanks & Regards
    Rathidevi

    Hi,
    Please have a look at this article:
    https://convective.wordpress.com/2010/08/18/examples-of-the-windows-azure-storage-services-rest-api/, it demonstrate how to use table service Rest API, it also give us the code, hope this helps. Of course, the
    MSDN article could also help us coding.
    Best Regards,
    Jambor
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Does iTunes use Internet Explorer to access the internet from a PC with Windows Vista?

    Does iTunes use Internet Explorer to access the internet from a PC with Windows Vista?

    Are you using Windows XP or Windows Vista?
    Did you remove iTunes and the other Apple software also, and then reinstall iTunes.
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7
    Did you try to put the iPhone into recovery mode?

  • How to access Calendar Events in Windows Phone 8.1 SDK

    Hi,
    I have multiple email accounts setup on my Windows Phone 8.1.
    I have requirement to access appointments in calendar for specific email accounts and perform some operation. I found sample code on MSDN and all of the are examples of using Microsoft.Phone namespace. But as I am using Windows Phone 8.1 SDK and not Windows
    Phone 8.1 Silverlight SDK.
    Can someone guide me of an equivalent namespace/method of accessing calendar appointments using Windows Phone 8.1 SDK.
    Thanks,
    Nasir

    Hi nasir,
    If you would like to modify the server side appointments I believe you need to call server side api to manipulate them.
    For instance if we would like to modify the data into O365 server,
    Get started with the SharePoint 2013 REST service should be a good start. Also calling Exchange
    Web services is a good idea.
    --James  
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Why do I have to switch from Windows Phone to Andr...

    Why do I have to switch from Windows Phone to Android?
    [September 30, 2014]
    This year all my friends with Windows Phone (WP) had switched to Android. Why? The Apps. I continued with WP until now because the OS is very cool (particularly the 8.1 desktop) and because I love Nokia Phones. And the new 830 and 930 models look great.
    But I will buy a new Fuji X30 Camera, I need the Wifi remote app for some shoots,  I have no choice
    Now, I will give a list of reasons my friends left WP because lack or applications, maybe somebody at Microsoft is listening and can revert this tendency.
    1. Bank Applications (Bancolombia APP)
    2. Giro D’Italia app from La gazzetta dello sport.
    3. Stereopinic Concert app.
    4. General Motors - Chevrolet navigation/location app.
    Another annoying thing with Nokia phones in emerging markets is they don’t distribute all the accessories (headphones, wireless chargers, cases), so you have to buy them from another country make them expensive. I even met three months ago the commercial leader for Nokia here in Colombia, a group of people mentioned this, but nothing has changed since then. The updates came very late and right now I’m not able to use Cortana
    I hope Microsoft starts investing hard on apps and identify that little temporal applications for just one week or month (sport events/concerts) and start to create mechanisms to get things done. They just can’t waste the 6’000.000 consumers in US and the 10% share market in some countries in Europe and in emerging markets.

    I don't endorse any mobile phone brand nor receive any free stuff from them. Neither did I advertise anything. It was rather a recommendation if the starter of this thread would like ot purchase an Android phone. Censorship won't help to sell any more Lumia phones.
    I cannot blame anybody who's about to purchase an Android phone. Being a Windows Mobile & Phone user since 2006 I've seen those strategic mistakes Microsoft has made when the 1st and the 2nd generation of Windows Phones were released (the price of developer account etc. etc.). It's very hard to mend those things afterwards but I sincerely hope it won't be impossible.
    I'm blessed that I live in FInland because Nokia has always been considered as a Finnish mobile brand and therefore there are all those (well, almost all) necessary apps available for Windows Phone. IMO the best Nokia app has been Here Transit. I really don't need Here Drive+ because they don't bother to include speed cams and line assistance to their app. Just take a look at Navigation Europe and there you have the best possible navigation app for Windows Phone. Waze is also great and it's free. Hmm, I guess that sentence will be censored because I recommended something
    I've been quite pleased with the latest Windows Phones. They haven't crashed like my Dell Venue Pro did (first Windows Phone ever) or like my Android phone, tablet and TV box. But in order to increase the market share  of Windows Phones there are two ways:
    1) good (amount of) apps, great hardware and/or
    2) double booting phone where it's possible to choose whether to boot to Android or to Windows Phone. I'd love to have that kinda phone with the goods described in 1)
    Moderator's Note: Discussing or complaining about moderator actions on the forum is not allowed. If you feel that your posts have been moderated unfairly, please contact our Community Manager via private message.

  • TCP/IP communication from windows phone 8.1 to Power PC SBC

    Hi
    I need technical help in sending data (structure) from windows phone 8.1 to power pc Single board computer.
    Power pc side TCP server part is implemented.
    I have got TCP client code from microsoft website but its not working.later i came to know that its for windows8.
    please provide the correct link for TCP client software download.
    Regards,
    laxmi

    There is no way to know how to help you in this issue.  We have plenty of TCP code that works just fine, but you'll have to figure out how to send the packets in
    a way that your PowerPC understands.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • How to sync a Lumia Windows Phone with Outlook

    Hi
    Like all I see I also bought a windows 800 on the basis that all our team of 50 would change from Iphones to windows so we could sync with our outlook which is not server based but we each run our own outlook folders but no there is no outlook sync.   Yes you can copy to the live account and then use that as your main calendar but who wants to do that?
    I asked and was told specifically that it would sync with outlook so the Carephone Warehouse guy either lied or did not know his stuff ( I know what my guess is!)    Amazingly my wife's samsung galaxy using Android does sync.
    If you can tell me how I can synchronise my windows phone with my Outlook without exporting and importing CSV and ICS files then please do so.
    Moderators note: changed thread title to reflect subject. Moved from another thread.

    Hi wobblybob,
    Welcome to the forum and thanks for posting!
    When you are told you can sync a Windows Phone with Outlook that would be correct. What you are really asking is 'can I connect my Lumia to the PC with the USB cable and sync with Outlook offline'. The answer to that would be no.
    How you sync with Outlook can be answered in a short and long version. The long and extensive version can be found here. The short version is:
    For Outlook 2003 and 2007 install the Outlook Hotmail connector and setup an account for your  LiveID, for Outlook 2010 just setup the account and it will prompt you to install the connector. A step by step guide can be found here.
    Hope this helps, let us know how you get on!
    Kosh
    Press the 'Accept As Solution' icon if I have solved your problem, click on the Star Icon below if my advice has helped you!

  • Not able to successfully subscribe to and see the TargetApplicationChosen event fire from Windows Phone 8.1

    Matt,
    Thanks for the reply.
    In my current experience, I am not able to successfully subscribe to and see the TargetApplicationChosen event fire from Windows Phone 8.1.
    In Windows Store 8.1 (Tablet), it works fine.
    Questions
    Is this event expected to fire in Window Phone 8.1 (Universal Apps, Not Silverlight 8.1) ?
    Does this event depend on the target application to supply AppName?
    Thanks for your help. Much appreciated.
    Example Code Block
    //From Page Contstructor or OnNavigatedTo Handler
    _dataTransferManager = DataTransferManager.GetForCurrentView();
    _dataTransferManager.TargetApplicationChosen += DataTransferManagerOnTargetApplicationChosen;
    private void DataTransferManagerOnTargetApplicationChosen(DataTransferManager sender, TargetApplicationChosenEventArgs args)
    //fires in tablet but not phone

    This is not an answer, Mr. Wong.  The link you referenced refers to the DataTransferManager class being supported only in Native apps, which includes Windows Phone 8.1 RT apps.  All aspects of the DataTransferManager work except for the TargetApplicationChosen
    event under a WP8.1 universal app.  This event does NOT fire in the Windows Phone 8.1 RT API implementation of DataTransferManager.
    You need to reopen this thread and address the issue, please.  The lack of support for this event is problematic for some phone scenarios, most notably supporting NFC Tap and Share.
    Mark Jones, Owner MJ App Factory

  • How to print a grid from windows phone 8.1 application

    Hello ,
    I want to print a grid from a windows phone application.
    For tablet I can print using this namespace:
    using Windows.Graphics.Printing;
    using Windows.UI.Xaml.Printing;
    But they are only for Tablet.
    Please suggest a solution of printing from windows 8.1 phone application.
    Thanks

    Hi waqar.haider.confiz,
    >>How to print a grid from windows phone 8.1 application                                 
    As far as I known, in Windows Phone 8.1 app it does not have such API for us to print a grid. I will recommand you submit this feature request on this
    UserVoice forum.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I have installed iTunes Match on my iPhone & laptop. May I now safely delete the music files from my phone and still access my music from the phone? Thanks

    I have installed iTunes Match on my iPhone &amp; laptop. May I now safely delete the music files from my phone and still access my music from the phone? Thanks

    Read this
    http://support.apple.com/kb/PH12492

  • Powershell cmdlets to access Azure Storage Analytics

    Hi,
    Are there PowerShell cmdlets to access Azure Storage Analytics data (Capacity Metrics)?
    -Vatsalya
    Vatsalya - MSFT The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Microsoft.

    Hi Vatsalya,
    You could refer to this code sample about blob analytics metrics (https://gist.github.com/RichardSlater/4753866/raw/91a2bf45fb24dff4f770a1384c3e6578ecbd20d5/Get-CapacityMetrics.ps1
    ) about "StorageAnalyticsMetrics". In this sample, you didn't need to specify the container name.
    Please try it.
    Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • How to solve this error from window phone 80073cf9 lumia 630.

    any one know how to solve this error from window phone 80073cf9  lumia 630.

    Hello Muhammad,
    We appreciate the post, but this forum is for Windows Store and Phone Developer related questions. Your question can best be answered through the
    Windows Phone support page.
    Thanks!
    -Jonathan
    Windows Store Developer Support
    Office Store Developer Support

  • Why can I login to iTunes from my phone with no problem, but I can't login to iTunes from my desktop.

    Why can I login to iTunes from my phone with no problem, but I can't login to iTunes from my desktop using the same login credentials. I can use a different appleID and login to itunes with no problem.

    Thanks for your reply.  I mean that only when all of my music in the cloud is shown on my phone can I delete the music stored on my phone.  I should be able to delete music that is stored on my phone when I can view ONLY the music that is taking up the phone's memory.

  • Transfer file  from Windows PC with the Imac transfer programme . Do I need to activate bootcamp to view files on my new intelMac

    I want to transfer files and folders from Windows PC with the Imac transfer programme . Do I need to activate bootcamp to view files on my new intelMac.

    in my finder my windows partition show up under devices with the name given to the hd
    but because it's ntfs is read only

  • Accessing ext3 partitions from Windows with FS Driver

    Hi everyone,
    I have a slight probem. I'm dual-booting ArchLinux and Windows. Here is my partition scheme:
    /dev/sda1 (NTFS) Lenovo Recovery partition
    /dev/sda2 (NTFS) Windows
    /dev/sda3 (ext2) /boot
    /dev/sda5 (JFS) /
    /dev/sda6 (JFS) /home
    /dev/sda7 (ext3) [documents] partition mounted on /media/data
    /dev/sda8 (swap) swap
    Everything works fine on the Linux side (of course).
    The problem is that I use http://www.fs-driver.org/ to access my documents (/dev/sda7) from Windows.
    This worked fine (I was using Kubuntu) but now I had to format the disk in order to install ArchLinux and FS Driver would not recognize the "documents" partition.
    I think it might be because the partition is not PRIMARY but LOGICAL. Is there a way to fix this without reformatting everything (just formatting /dev/sda7 is fine with me) ?
    Thank you in advance
    Last edited by yms (2009-09-11 14:08:17)

    Hi, I just stumbled across this one and thought I'd throw in my two cents....
    Something I've found about windows is that it's -very- picky about partition sizes.
    For  instance, on a new system of mine, I did dual booting windows/Linux from partitions on the same hard drive.
    The windows partition was first.  After creating my Linux partitions, windows would no longer boot, said the partition table was corrupt.
    (All partitions were primary)
    The solution?  I created my Linux partitions using windows tools (which wasted around 10Gigs of hard drive space) and finished them off with linux tools.
    Everything worked fine then.
    Bottom line, Linux can use partition sizes that (some?) windows will refuse to use.
    You should be able to simply remove the last 2 partitions (sda7 and sda8).  Any partitioner should work (gparted, cfdisk, windows logical disk manager).  Don't forget to move your documents.  If you do this from your installed Linux system, don't forget to disable your swap space or you won't be able to remove that partition.
    ...might also need to unmount /dev/sda7 to use cfdisk... I think gparted does this automatically but don't quote me on that one...
    Then you can recreate the last two partitions using windows.  Then use Linux to set their types, format them, and restore your documents.
    Just to simplify things with the swap space, it's probably easier to use a live distro than your installed Linux.
    If your fstab uses UUID's, don't forget to update as formatting will assign new UUID's to the partitions.
    ... should solve at least half the problem.
    laters,
    b

Maybe you are looking for

  • My laptop no longer recognizes my iPhone but it appears in Microsoft. However my iPod is still recognized and syncs

    A couple of weeks ago my old 3s iPhone stopped automatically syncing with my microsoft laptop however it did appear in Explorer. My iPod synced no problem. I took no action because I thought the old phone may have had a problem and was about to buy a

  • Goods Receipt for Inbound HU - WS_DELIVERY_UPDATE

    Hi All, I have a requirement to automate transaction VL60p to do GR for an inbound delivery with HU. Since this is a SAP enjoy transaction I can't use BDC and there doesn't seem to be a BAPI for this. I plan to use WS_DELIVERY_UPDATE, filling tables

  • Problems in changing Thousand's separator appearance

    I am having problems in changing the thousands separator appearance. I am based out of India and here the thousands separator works in format - 1,00,00,000 (i.e. 2 digits after last 3 digits). I want to change this into standard 3 digit thousands sep

  • Battery drain 6.1.4

    After restoring my phone to factory last night and applying 6.1.4 I am down to 9% battery after less than 3 hours since last full charge. WiFi, Bluetooth, Hotspot OFF. Any other reason this could be besides the update?  Didn't have this problem until

  • Ordering prints

    If I were to order prints thru iphoto 4, what type of paper would my prints come out on? is it glossy or matte? also, is there a delivery charge, or a minimum amount to purchase in order to receive my prints?