5) The result of experiment is “Image Value” (“Scored Value” in terms of Azure ML)

6) Azure Function get “Image Value” in response from Azure ML Web Service

7) iAL Extension get “Image Value” in response from Azure Function

8) Developer get “Image Value” in VS Code editor

The whole process can take from 1 second to 20 seconds. Why there is so big difference in execution speed?

Because of Azure Functions.

Azure Functions

As you see we use Azure Functions here. Why? Because Azure ML WebService URL can be changed.

I found that when you change experiment workplace then url changes. Also, if I want to create new experiment (for better speed/accuracy) then this also will result in different url.

So, I don’t want Azure ML URL to be hardcoded in VS Code extension. I want to be sure that every user use one url to get correct result.

That is why I use Azure function which has static URL (which is hardcoded in VS Code extension).

And my Azure function has hardcoded URL to Azure ML web service, which I can change on the fly.

But what influence on Azure function execution time? This is “Always On” feature. When this feature is deactivated, then Azure functions app goes to sleep mode after some period of inactivity. And on free price tier“Always On” is turned off, and cannot be activated.

That is why, when developers use my extension rarely, then for every developer the process take about 20 sec. But if developers will use this app more often, then time for every developer will be reduced up to 1 sec (azure function will not go to sleep mode).

Yesterday I found Azure service “API management”. Did not tried it yet, may be it will solve this problem (//To Investigate).

The next Azure Function code interact with Azure Machine Learning web service

Go to D:\home\site\wwwroot, and then drag your package.json file to the wwwroot folder at the top half of the page.

After the package.json file is uploaded, run the npm install request command in the Kudu remote execution console. This action downloads the packages indicated in the package.json file and restarts the function app.