지금까지 X-Api-Key 헤더로 메트릭을 가져 오기 위해 Application Insights REST API를 성공적으로 사용했습니다. https://api.applicationinsights.io/beta/apps/xxxxxxxxxx/metrics/customMetrics%2FmetricName?timespan=PT2H&interval=PT20M&aggregation=minApplication Insights에서 인증 AAD가 포함 된 REST API
그러나 우리의 새로운 대시 보드에서는 몇 가지 메트릭을 크롤링하여 1500 요청/api 키 제한을 엄호했습니다.
일부 API 키를 여러 개 사용하는 것이 좋지만이 접근 방식을 방지하고 싶습니다.
문서에 따르면, 일일 한도 (https://dev.applicationinsights.io/documentation/Authorization/Rate-limits)
을 제거 할 AAD 인증하지만 (nodejs에,하지만 난 그게 어떤 언어에서 같은 용의자) AAD 인증에 실패 내가 사용
간단한 앱 adal-node
, 나는 성공적으로 토큰을 얻을 그러나 나는 Request
var context = new AuthenticationContext(authorityUrl);
context.acquireTokenWithClientCredentials(resource, clientId, clientSecret, function(err, tokenResponse) {
if (err) {
console.log('well that didn\'t work: ' + err.stack);
} else {
console.log(tokenResponse);
request({'url' : 'https://api.applicationinsights.io/beta/apps/xxxxxxxxx/metrics/customMetrics%2Fmetrics?timespan=PT2H&interval=PT20M&aggregation=min',
headers: {
'Authorization': 'Bearer ' + tokenResponse.accessToken
}
}, function (error,response,body){
console.log(body);
});
}
});
에게 전달 할 수 아니에요 6,
내가 오류 메시지가 The provided authentication is not valid for this resource
The given API Key is not valid for the requested resource
다음 받고 있어요 나는 우리가 직접 우리의 REST API의 AAD를 지원하지 않습니다 :
안녕하세요.이 솔루션을 찾으셨습니까? –
현재로서는 아닙니다. 필자는 설명서에 설명 된 powershell 명령 (아래 답변 참조)을 사용하는 방법에 대해 다소 당황 스럽습니다. 당분간 나는 일련의 apikeys로 바람을 피고있다. ( – camous