1

I'm trying to get some info about my DB from MS Azure via REST API (it's only testing my knowledge about REST). Using C#. But where I need to put login and password for DB? or needn't ? I have 403 http error every time.

WebRequest request = WebRequest.Create("https://management.core.windows.net:8443/{subscriptionId}/services/sqlservers/servers/{servername}/databases/testDB");
       request.Method = "GET";
       request.Headers.Add("x-ms-version", "2012-03-01");
       WebResponse response = request.GetResponse();
       Stream stream = response.GetResponseStream();
       StreamReader reader = new StreamReader(stream, Encoding.UTF8);
       String res = reader.ReadToEnd();
       Console.WriteLine(res);

1 Answer 1

1

The REST API operations you're trying to perform are part of Azure Service Management API and they work on a different authentication mechanism. You would either need to provide a X509 based Management Certificate or use Azure AD token for authentication purposes. For more details on authenticating these API requests, please see this link: https://msdn.microsoft.com/en-us/library/azure/ee460782.aspx.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.