0
votes

I am trying to call the REST API described here: http://msdn.microsoft.com/en-us/library/windowsazure/gg715318.aspx

My code looks like:

WebRequest req = WebRequest.Create("https://management.core.windows.net/subid/operations?StartTime=2013-08-20&EndTime=2013-08-21");
req.Headers["x-ms-version"] = "2012-03-01";
req.Method = "GET";
HttpWebResponse resp = req.GetResponse() as HttpWebResponse;

When that code executes I get a WebException with the error "The remote server returned an error: (403) Forbidden."

I am not that familiar with Azure but I have read that I "might" have to register a certificate or something in order to access? The REST API does not mention that though.

Any advice is appreciated.

Thanks, Andrew

2

2 Answers

1
votes

I have read that I "might" have to register a certificate or something in order to access

All Service Management operations must be authenticated. From the docs:

The Windows Azure Service Management API use mutual authentication of management certificates over SSL to ensure that a request made to the service is secure. No anonymous requests are allowed.

The documentation for this is here.

0
votes

You need to add authorization token to the request header that is to be set up in your AD.