我是API管理的新手.我创建了一个Basic WEB API并托管到API APP(App服务).URL正在按预期工作,它正在返回数据.即http://xyz.azurewebsites.net/api/webapi
但是当我在API管理中添加API应用程序时,我正在添加带有Extra后缀的不同URL我正在添加,但是当我尝试在浏览器中打开链接时 - > https://abc.azure-api.net/God我收到以下错误
{ "statusCode": 401, "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API." }
如果它没有API APP的问题那么它不应该与API管理.如果我错过了什么,请指导我.
NB - >我尝试在fiddler中添加订阅密钥,它的不同问题即将到来.但要访问URL,它基本上不需要订阅密钥.
我正在尝试调用 bing 文本转语音 azure 服务,但在获取访问令牌时我不断收到此错误,尽管提供了订阅密钥
function requestAudio(text,lang)
{
nameLanguage = "Microsoft Server Speech Text to Speech Voice (en-GB, Susan, Apollo)";
language = lang;
textToSpeak = text;
$.ajax(
{
type: 'POST',
url: tokenURL,
data:
{
'Ocp-Apim-Subscription-Key': 'xxxxxxf8cc34d08b646de1bc54c950d'
}
}).done(function(data)
{
token = data.access_token;
sendAudioRequest();
});
}
Run Code Online (Sandbox Code Playgroud)
来自 fiddler 的错误是
{ "statusCode": 401, "message": "Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API." }
Run Code Online (Sandbox Code Playgroud)
我打电话的网址是
https://api.cognitive.microsoft.com/sts/v1.0/issueToken
Run Code Online (Sandbox Code Playgroud)