1

Is there any way to fetch Subscription Keys for Microsoft Cognitive Services APIs through API call/CURL/HTTP request? Currently I have to hard code the keys in my Application to use the services.

asked Jun 28, 2017 at 18:37

1 Answer 1

1

Yes, you can do this. See the List Keys API at https://learn.microsoft.com/en-us/rest/api/cognitiveservices/cognitiveservicesaccounts#CognitiveServicesAccounts_ListKeys.

POST /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/listKeys?api-version=2016年02月01日-preview

Which returns JSON:

{ "key1": "xxxx", "key2": "xxxxx" }


You can also do this via Powershell using Get-AzureRmCognitiveServicesAccountKey


Both of these methods require you to authenticate with the Azure REST API which you can read more about at https://learn.microsoft.com/en-us/rest/api/.

answered Jun 29, 2017 at 22:00
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.