Interception of http/https requests in fiddler is not working from Azure Function? - asp.net-core

I have an azure function, running locally. it sends out a post request to a remote endpoint that looks something like https://organization-name.somesoftware.com/api/v1.3 it seem to be captured by fiddler but i can not look at the request header or the body payload. I am not sure whether the request is intercepted correctly by fiddler
here is the screenshot from fiddler

The issue is due to Azure Function Execution timeout, by the time fiddler receives and starts debugging the request the Azure Functions gets timeout. You can solve this by increasing the Azure Function time out.
You can check the following document for more information and to increase the timeout.
Azure Function Timeout.
Alternatively, you can try moving to different hosting plan for the Azure Function and also increase the time out at the same time.
Azure Function Premium Plan.
Azure Function Dedicated Plan.

Related

Why isn't Cloud Run sending cookies?

I have a fastify server that serves cookies to maintain the session.
When I test on localhost, it works as expected. I get a cookie on localhost:3000.
When I host my server as a container image through Cloud Run, however, I can not see any cookies inside the route. I can see the request has a cookie when it's sent to the server, but it's not being parsed. This is causing my session to create a new session and I can't get any context.
Are there any special considerations regarding Cloud Run and cookies?
Only If you are using Firebase Hosting + Cloud Run, __session is the only cookie you can store, by design.
This is necessary for Google to be able to efficiently cache content on the CDN -- Google strips all cookies from the request other than __session.
This is documented here.
If you are using Load Balancer, or other means like custom domains to connect to your Cloud Run service, there is no restriction on cookies, and you get all.

Is there a way to make APIs temporarily unavailable on Azure?

I'd like to implement a 503 feature for my APIs whenever system is in maintenance so that users get the appropriate HTTP response message. As of now, the way I'm doing this is to store a flag in the database and check it with every API request to see if I should be issuing a 503 error. However, I'm thinking there could be a different way to do this on Azure. Is there any setting I could turn on and off on the portal for this purpose so that I don't need to add another lookup trip to the database? I'm using Azure Functions for my services.
You can simply introduce an AppSetting that you check in your function. And then return a HTTP 503. Additionally you can add a timestamp when your API is back and return that in the HTTP header (Retry-After) with your 503.

Traffic all of restful api Process

I want to know if there's many people request URL on a port (exam. 7000) it will handle on a request in a order, right?
And connect to a database through my API server.
So the client post to my API server through URL: Port and then my API sever connect my database and then return data to client though API server by response JSON Format and next it gonna continue do the same right?
So if it’s in a process others request has to wait until it finish a process that I mention above, right?
Short Answer
No
Server will not wait for the database operation to complete and therefore keep accepting the other request.
The flow of execution will be as follow:
request ──> make database request
request ──> make database request
request ──> make database request
database request complete ──> send response
database request complete ──> send response
database request complete ──> send response
Read this answer for precise and simple explanation.
This is possible because of following concepts and I recommend you to read about it more to understand how Node.js works
Event Loop
Asynchronous Nature of Node.js
Node.js internally use libuv to handle I/O operation.

Google Cloud Messaging token

I'd like to know if each time my application runs I need to get the token and pass it to the server, or if it's only necessary once to register the application. Thanks a lot.
You need a token to register the GCM(push notification) to the Google Server. Then this token is passed and used in the server to send subsequent notification. This token should be persisted by the server so that it can be used to make API calls to the Google server. With this approach, your server and the Android device do not need to create a persistent connection and the responsibility of queuing and relaying messages is all handled by Google's servers.
For more information visit the Registering Client Apps and also check this documentation.

Azure REST API Certificate

I am making API calls to Azure REST to get some information about Azure resources to further on monitor Azure services.
I'm trying to make calls in the Postman, using JWT in the header, but some calls throws me errors like this:
ForbiddenError
The server failed to authenticate the request. Verify that the certificate is valid and is associated with this subscription.
Why some calls work but some of them throws an error like this.
According to error, I need to get a certificate, but I don't really know how to do it and what to do it...
So, anyone could help me to resolve this problem?