locked
Are there any code samples on how to call Microsoft's Azure Management REST API from Android? RRS feed

  • Question

  • As the title says, I'm simply trying to make a call to Azure Management API from Android. I know many may be thinking "oh, that's simple!". Actually, what is easy in C# in this case is not in Java.

    In C# you can do this

          X509Certificate2 mycert = new X509Certificate2(...)
                request.ClientCertificates.Add(mycert);


    That doesn't work in Java. In fact if you're inclined to assist me in figuring this out (and I appreciate so much if you would) here is an article that gets about 90% of the way there. Look at all that code required to simulate this! It's insane. I don't blame Google or Sun either, try doing this from iOS or Mac OS too. Hell, try Node.js or Python, pretty much Microsoft created the Azure Management REST API for client's built using Microsoft's development tools. I doubt they gave any consideration to other platforms at all when they architected these services to require the cert be added to the request in this way.

    http://blog.elastacloud.com/2012/09/29/a-windows-azure-service-management-client-in-java/

    Monday, August 19, 2013 5:08 AM

Answers

  • Hi,

    Thank you for your feedback.

    Looks like the main issue is how to use certificate authentication. I am not familiar with Android, but please try to use the sample on https://developer.android.com/reference/javax/net/ssl/HttpsURLConnection.html to see whether it helps.

    Best Regards,

    Ming Xu


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, August 19, 2013 2:43 PM