Interview questions and answers on Azure Functions | Interview questions for azure function developers


This post intends to cover the answers to the questions which a Azure developer can face at an Interview i.e. Azure Developer Interview Questions and Answers on Azure Functions





1. How does ASE and App service plan differ?
-  The Azure App Service Environment (ASE) is a Premium feature offering of the Azure App Service. It gives a single-tenant instance of the Azure App Service that runs right in your own Azure virtual network (VNet), providing network isolation and improved scaling capabilities.

An App Service plan defines a set of compute resources for a web app to run. Same plan be used by One or more apps to run on the same computing resources .


App Service Environment (ASE) lets you fully isolate your functions and take advantage of higher numbers of instances than an App Service Plan.

An App Service Environment is a single-tenant deployment of Azure App Service that runs in your virtual network.

App Service plans are created in an App Service Environment, which actually hosts the applications.



2. I have a queue based function app, however even after publishing messages to queue - function does not get triggered?
- Azure function  expects queue messages to be base64 encoded to trigger it.

So if message pushed to queue is not base64 encoded then the function trigger ignores it.

3. Is it mandatory to create or associated azure function app with Storage account instance?
- Yes.

When you create a function app, it must be linked to a storage account. You can select an existing account or create a new one. The function app uses this storage account for internal operations such as logging function executions and managing execution triggers (except HTTP triggers) .

On the Consumption service plan, this is also where the function code and configuration file are stored.



4. How many trigger does Azure function support?
- Unlike Logic app, Azure function supports only one trigger.


5. What is common between Trigger and Bindings?
Bindings is creating connection for  input/output of data in function, which means you don't have to write code in your function to connect to data sources and manage connections. 


A trigger is a special type of input binding that has the additional capability of initiating execution.


6. Can I have a function app having multiple functions written in different languages?
- Yes and No. It depends on which version of Azure Function you are using.

Azure Function V1 supports multiple language functions in one app whereas v2 supports only same language.


7. Can we track Azure Function run history?

- Out of box, there is no such provision.

Azure Functions are stateless, if state is to be maintained then it can be done using some storage options.


8. I need to integrate Function app with organization's virtual network, but I don't see the option?

- If azure function app's hosting plan is Consumption then it can't be integrated as it does not support.

As in consumption plan, the underlying servers which is used to host and execute the functions in the function app, keeps changing as per the load.

Thus there is no fixed set of IP addresses - so can't be integrated with virtual network.


9. Why is Azure Function Apps referred as serverless?

- Azure function App with Consumption plan is referred to as Serverless offering.

In consumption plan, no infrastructure is reserved, rather it is added and removed on demand basis. (It is abstracted from users)

As there no fixed Servers, it is termed as Serverless and is charged on usage basis.


10. How does scaling happens in Azure Function App (Consumption Plan)?

- Scaling (In/Out) for Azure function happens at Azure Function App level.

Additional instances or reducing instances of the Functions host, are based on the number of incoming trigger events.

It is done by a component called the scale controller which monitors the rate of events and determine whether to scale out or scale in. The scale controller uses specific probing  for each trigger type.


11. What are the options available for Azure Functions development?

- Azure functions can be developed using Azure portal and also locally with the help of adding extensions in the supported IDE like Visual Studio, Visual Studio Code.

Read about Developing Azure Function using Portal

Read about Developing Azure Function using Visual Studio


12. How many versions of Azure runtime is available?

- By default, function apps are created in version 4.x of the runtime as it is the latest however there are four major versions: 4.x, 3.x, 2.x, and 1.x.

4.x - Supports all languages. Use to run C# functions on .NET 6.0 and .NET Framework 4.8. 3.x - Supports all languages. Use to run C# functions on .NET Core 3.1 and .NET 5.0. 2.x - Supports legacy version 2.x apps. 1.x - Recommended only for C# apps that must use .NET Framework and only supports development in the Azure portal, Azure Stack Hub portal, or locally on Windows computers.


13. What is Cold Start in cloud computing and does Azure Function has cold Start?
- Cold start is a term used in cloud computing to describe a scenario when a service takes time to get ready(spinning up an instance) to serve a request.

It is known issue of Azure functions running under consumption plan .

In consumption plan, the backend infrastructure gets added when load increases and infrastructure is removed when load decreases.

When load is zero, no infrastructure. So when new request comes in, the time taken to get the infrastructure ready to serve it is called cold start time.



14. Can we solve cold start issue in Azure function?
- It will be part of Azure function consumption plan by it's nature of handling resources.

However, we can Avoid cold starts with perpetually warm instances if chosen Premium Plan for hosting Azure Functions.

Another way is to choose Dedicated plan with the Always on setting enabled.


15. In which scenario, Azure function code is not visible in the portal?
- When you deploy/publish Azure function from Visual studio, it is the .dll file which is deployed in the Azure and thus you can't see the code in the Portal.


16. Can a azure function created in a Resource Group in a particular Subscription be moved to another resource group?
- Yes, there is a provision for moving Azure function from one Resource group to another.

Also Azure function can be moved from one subscription to another.


17. What is the purpose of function keys in Azure Function?
- Function keys can be thought as the first level of security, protect an Azure Function from unauthorized access.

Authorization level lets you choose whether you want a key to use to access function

Using Function Keys, three levels of authorization can be implemented:
  • anonymous: anyone can access, no key is required
  • function: a function-specific or a host key is required, these key apply only to the specific functions under which it is defined
  • admin: the master key is required, access to all functions within the function app and administrative access to the runtime REST APIs

18. Can we call logic app from azure function?
- Yes, logic app ,can be called from Azure function.

However, the logic app should be http triggered based, so that Azure function can be provided an endpoint to call.

19. For how long an Azure function can run?
- By default 5 mins is the execution time of Azure function in consumption plan, however it can be extended up to 10 mins (maximum).

If the need is for more execution time for Azure function, then either of the plan - Premium or Dedicated can be chosen.

Which comes with default 30 mins execution time and maximum is unlimited.

20. Is there is any exception in context to Azure function execution time?
- Yes there is.

Irrespective of which plan you use for Azure function, irrespective of whatever is the function app timeout is set to, 230 seconds is the maximum amount of time that an HTTP triggered function can take to respond to a request.

It is not Azure function runtime limitation rather it is because of default idle timeout of Azure Load Balancer.

21. Are there any restriction on name used for Azure function app?
- Yes, there is.

Valid characters are a-z, 0-9 and - for function App name.


22. Does the order of parameters in Azure function matters?
- The order of parameters in the function signature does not matter. For example, you can put trigger parameters before or after other bindings, and you can put the logger parameter before or after trigger or binding parameters.




If you have questions or suggestions, feel free to do in comments section below !!!


Do share if you find this helpful .......
 
                          Knowledge Sharing is Caring !!!!!!


Post a Comment

If you have any suggestions or questions or want to share something then please drop a comment

Previous Post Next Post