Does the MS Health API Support CORS? - microsoft-band

I'm working on a web app that connects to the MS Health API. I'm able to get my authorization code from the API but then when I execute the POST to get the authorization token I get a CORS error.
Does the service have CORS enabled? If not, what approach should I be taking to get this to work?

Yes.
After spending some time with the MS Health support team on email, they confirmed that the server is set-up to support CORS. The problem is that if you call the Summaries end-point (http://api.microsofthealth.net/v1/me/Summaries) without adding the time period to the end (.../Summaries/Daily) you'll get a CORS error. It would of course be more helpful to get a different, more obvious error.

Related

AppInsights see response to requests

Is there a way to see the response to a request in the logs generated through appinsights?
I’ve got several apis, and I can see the client making the calls when querying the requests table, I can see the status of the request but I can’t see what was sent back to the client.
Also when I click appinsights in my APIs it says
‘Set up app insights without changing code’
But above it, there’s a green tick saying ‘connected by Instrumentation code’
Does this mean it’s connected and working?
Does this mean it’s connected and working?
Yes, Application Insight connected to API.
Is there a way to see the response to a request in the logs generated through App insights?
If you want to see the response of your request/Custom Events or Custom Metrics, you need to use the Custom Telemetry in your API to get the response in Application insights.
Note: Make sure you can use it for testing purpose. In an application insight who ever have the access of your subscription of the specific resource they can view the telemetry data.
Reference
Custom Metrics in API

Application Insights shows GET calls while my code does not have any such calls being made

We have integrated Azure Application insights with our bot built using Azure bot framework using node.JS and typescript. Everything looks fine and we can see telemetry data flowing in.
In the failures section, we can see Operation name "GET /api/messages" showing repeated times - one failed call (405) and one success call (200).
But we have no GET operation being done on "/api/messages" in our code. We only have "POST" operations.
We are unable to understand why telemetry shows GET operation and one as failed and one as success.
Any help is appreciated.
The operation_SyntheticSource field of request telemetry is often used by microsoft / azure to indicate traffic that is generated by infrastructure or bots. Examples are health requests, keep alive traffic, spider bots.
There are options to filter out telemetry, so it is possible to filter out telemetry cause by synthetic traffic. See the docs.
Telemetry processors can be configured using DI.

How to troubleshoot failed requests to Azure web services

I have a ASP .NET Core MVC web service hosted in Azure to which I would like to POST data. I am able to post from Postman so I know the service is working and the required format of the request. I have another client sending what I believe to be the same post request but somewhere the request is failing. I would like to confirm the requests are reaching the service and if so see exactly what the request looks like when it gets there so I can compare to the working version. I have enabled web logs on the service but what info I can find as a result does not provide detail of the failed request. I also downloaded logs via the Cloud Explorer in Visual Studio but again I cannot see the content of the request to troubleshoot. I'm sure I'm not utilizing the logging fully but I'm not familiar enough with Azure web services to know what I'm missing and am having trouble finding guidance on the web. Perhaps it is not possible to capture the failed post data for security reasons? If so then presumably I need to hook up a debugger and see if I can step through the processing of the request.
What would be the most effective way to troubleshoot failed web service requests?
After further research I found an excellent reference on troubleshooting Azure Web Services at https://learn.microsoft.com/en-us/azure/app-service-web/web-sites-dotnet-troubleshoot-visual-studio. Using the information and tools covered there I was able to resolve my problem which ultimately proved to be a problem sending the request. Watching the web server logs it became clear the client's request was never reaching the server.

Why is Fiddler keep capturing sessions when I start web API service?

I'm a newbbie to Fiddler, and I really need it in my web debugging. I tried to search for how to use it, but there is no much useful topics on this, may be due to its easiness!
What I'm trying to do is to capture the session from my Web API service. However, as soon as I start the service in Fiddler, it starts to capture a lot of sessions, and keep adding to its list, none of them seems to be what I requested.
I'm following a tutorial on YouTube, where the tutor starts the service and issue a GET request and Fiddler stores just this session.
Is there any configuration I can do to get it working like that?
This is what Fiddler looks like when I start the Web API service:
EDIT
I used filters to block sessions from vshub, but still not getting any records for the service at all!

Cloud Vision Sample app failed to make API request

I am having trouble getting the Google Vision Sample App to have a successful API request.
I made sure the billing, API-key, were correct. I even tried using a browser key and service key, but had no luck.
The error coming back is:
failed to make API request because of other IOException Unable to
resolve host "vision.googleapis.com": No address associated with
hostname
If you have any ideas, I would surely appreciate it.
Solve:
Something was wrong with the Wifi on my phone. I think it was suffering from being off. I also changed the API-Key to Browser which is not the ideal solution, but will do for now.

Resources