Chcę używać api google analytics w mojej witrynie MVC, im uwierzytelniam za pomocą konta usługi APi i oauth2, nie mam problemów na moim hoście lokalnym, ale zaraz po wdrożeniu na Azure pojawia się błąd 502 :Google Analytics Api na platformie Azure
"502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server."
herezje mój kod:
const string ServiceAccountUser = "[email protected]count.com";
AssertionFlowClient client = new AssertionFlowClient(
GoogleAuthenticationServer.Description,
new X509Certificate2(System.Web.Hosting.HostingEnvironment.MapPath("/Areas/Admin/xxxxxxxxxxxxxxxxxx-privatekey.p12"),
"notasecret", X509KeyStorageFlags.Exportable))
{
Scope = AnalyticsService.Scopes.AnalyticsReadonly.GetStringValue(),
ServiceAccountId = ServiceAccountUser //Bug, why does ServiceAccountUser have to be assigned to ServiceAccountId
//,ServiceAccountUser = ServiceAccountUser
};
OAuth2Authenticator<AssertionFlowClient> authenticator = new OAuth2Authenticator<AssertionFlowClient>(client, AssertionFlowClient.GetState);
I cant dowiedzieć się, co jest przyczyną tego? Czy brakuje mi czegoś na Azure?
Dzięki za pomoc.
Niesamowite działa idealnie! Wielkie dzięki, nigdy bym tego nie zrobił bez twojej pomocy. –
Goodone Martyn W implementacji google analytics api nie mamy zbytniej pomocy i ostatecznie musimy rozwiązać problem samemu –