Tôi muốn sử dụng api phân tích google trong trang web MVC của mình, im xác thực bằng tài khoản dịch vụ api và oauth2 không có vấn đề trên localhost của tôi nhưng ngay sau khi tôi triển khai Azure tôi gặp lỗi 502 :Api Google Analytics trên 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."
heres mã của tôi:
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);
tôi không thể tìm hiểu Hãy làm cho nó? Am im thiếu cái gì đó trong Azure?
Cảm ơn bạn đã được trợ giúp.
Tuyệt vời làm việc hoàn hảo! Cảm ơn rất nhiều, tôi sẽ không bao giờ có mà không có sự giúp đỡ của bạn. –
Goodone Martyn Ở đây trong triển khai google analytics api, chúng tôi không có nhiều trợ giúp và cuối cùng phải giải quyết vấn đề chính mình –