Welcome to new things

[Technical] [Electronic work] [Gadget] [Game] memo writing

Talk about Azure Functions starting up too slowly the first time.

There is a service called Azure Functions, which is like an Azure version of AWS Lambda.

I wanted to operate Azure from MS Flow, and since MS Flow has a connector for Azure Functions, I tried to write a Function to operate Azure with Azure Functions, thinking that it could be done serverless.

Unfortunately, the environment I had was not able to call Azure Functions directly from MS Flow due to the different tenants of Office365 and Azure. So instead, I decided to execute a Function by directly hitting the Function's URL.

Occurrence of a problem

The desired Function was completed and executed directly from the portal without any problems.

However, when I finally called it from MS Flow, I got a timeout error.

MS Flow's URL call action has a timeout of 2 minutes, but I looked at it and saw that there is no way that the initial startup (cold start) of a Function would take more than 2 minutes, and it really did...

dealing with a problem

Azure Functions runs on Windows Server, so I wondered if that was the reason it was slow.

Then, the following statement was made.

Currently, the pay-as-you-go plan does not support hosting Functions on Linux. You must host your Linux container app with a Linux App Service plan. A pay-as-you-go plan is a plan that charges only for the time a function is running, which is common in the market. A Linux App Service plan, on the other hand, is a plan in which a server is always set up and a fixed monthly fee is charged regardless of the time a Function is executed.

! Well....I wondered what it was....and decided to give Linux Function a miss.

How to deal with it

In the end, we dealt with this by periodically calling Function in Logic Apps so that Function would not go to sleep.

Every 10 minutes, I sometimes fell asleep, so I set it to every 8 minutes.

Now the Function is called every time, without waiting for the first startup, and it's solved!

................... The work that I really want Function to do occurs irregularly, about a few times a month, but there is something to be said for making a dummy call every 8 minutes just for that.... That's what I was talking about.

Finally.

Is it correct to use Azure Functions for processes that do not need to worry about response time? Even so, it seems to me that the majority of execution time is startup time.

I could create a function to manipulate Azure with AWS Lambda and call that Lambda function from MS Flow, but that seems like something.

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com

www.ekwbtblog.com