Azure QnA
- What are Webhooks?
- Webhooks are one of the ways, applications communicate with other applications or platforms. Webhooks uses HTTP requests to transfer data in the URLs from one point to another endpoint. Once a condition is met for a specified event, it triggers the message from one endpoint and binds the message in the URL. The message is then sent to the other endpoint using GET and POST methods. Webhooks are generally used to connect to different platforms.
- The format is usually JSON and the request is generally done as HTTP POST request.
- For more details visit Introduction to Webhooks.
- What are the Benefits of Using Microsoft Azure Webhooks?
- Microsoft Azure Webhooks allow companies to automate actions, monitor data using Azure alerts, and much more. A few more benefits of Microsoft Azure Webhooks are listed below-
- Microsoft Azure Webhooks allows developers to execute scripts automatically when specified condition fulfills using Azure Automation Runbooks.
- Microsoft Azure Webhooks help users trigger Logic Apps that build integration solutions delivering scalability and accessibility.
- Receive text messages via VOIP services like Twilio and notifications from Slack, HipChat, and Campfire.
- How do you authenticate Webhook notification?
- When the client (the originating website or application) makes a webhook call to the third-party user's server, the incoming POST request should be authenticated to avoid a spoofing attack and its timestamp verified to avoid a replay attack.[8] Different techniques to authenticate the client are used.
- HTTP basic authentication can be used to authenticate the client.
- The webhook can include information about what type of event it is, and a shared secret or digital signature to verify the webhook.
- An HMAC signature can be included as a HTTP header.
- Mutual TLS authentication can be used when the connection is established. The endpoint (the server) can then verify the client's certificate.
- The sender may choose to keep a constant list of IP addresses from which requests will be sent. This is not a sufficient security measure on its own, but it is useful for when the receiving endpoint is behind a firewall or NAT.
- What are Azure Functions?
- Azure functions is a serverless solution that allows you to
- write less code
- maintain less infrastructure
- save on costs
- The cloud infrastructure provides all the up-to-date resources needed to keep application running.
- Scenarios, where you can use Azure functions-
- If you want to - Build a Web API
- Then - Implement an endpoint for your web applications using the HTTP trigger
- If you want to - Process file uploads
- Then - Run code when a file is uploaded or changed in BLOB storage
- If you want to - Build a serverless workflow
- Then - Create an event-driven workflow from a series of functions using durable functions
- Durable Functions - It is an extension of Azure Functions that lets you to write stateful functions in a serverless compute environment. Behind the scenes, the extension manages state, checkpoints and restarts for you.
- Durable Entities / Entity Functions - Entity Functions define operations for reading and updating small pieces of state, known as Durable Entities.
- If you want to - Respond to database changes
- Then - Run custom logic when a document is created or updated in Azure Cosmos DB
- If you want to - Run scheduled tasks
- Then - Execute code on pre-defined timed intervals
- If you want to - Create reliable message queue systems
- Then - Process message queues using Queue Storage, Service Bus or Event Hubs
- If you want to - Analyze IoT data streams
- Then - Collect and process data from IoT devices
- If you want to - Process data in real time
- Then - Use Functions and SignalR to respond to data in the moment
- What are the pricing options in Azure Functions?
- There are 3 main options -
- Consumption Plan - Pay for the time that your code runs.
- Premium Plan - Pay for the dedicated pre-warmed instances running continuously. Additionally, you have to pay for any additional instances you use as Azure scales your app in and out.
- App Service Plan - Run your functions just like your web apps. If you use App Service for your other applications, your functions can run on the same plan with no additional cost.
- Apart from that two more options are there -
- App Service Environment (ASE) - Provides a fully isolated and dedicated environment for securely running the App service apps at high scale.
- Kubernetes (Direct or Azure Arc) - Provides a fully isolated and dedicated environment running on the top of the Kubernetes platform.
- More details are available on Azure Functions hosting options
- What are Pre-Warmed Instances?
- In Consumption plan, whenever apps are not in use, they resource allocation scale to zero. It means some request may have additional latency at startup. Whenever you use functions, that time instances got allocated. Once instances are allocated, it gets warmed up and start working. It causes little bit of delay in response. This is called Cold-Start behavior.
- In Premium plan, there are pre allocated instances assigned to the function which remains available to serve, the moment any request comes in. These readily available instances are called Pre-Warmed instances.