Azure QnA

  1. What are Webhooks?
    1. 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.
    2. The format is usually JSON and the request is generally done as HTTP POST request.
    3. For more details visit Introduction to Webhooks.
  2. What are the Benefits of Using Microsoft Azure Webhooks?
    1. 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-
      1. Microsoft Azure Webhooks allows developers to execute scripts automatically when specified condition fulfills using Azure Automation Runbooks.
      2. Microsoft Azure Webhooks help users trigger Logic Apps that build integration solutions delivering scalability and accessibility.
      3. Receive text messages via VOIP services like Twilio and notifications from Slack, HipChat, and Campfire.
  3. How do you authenticate Webhook notification?
    1. 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.
      1. HTTP basic authentication can be used to authenticate the client.
      2. The webhook can include information about what type of event it is, and a shared secret or digital signature to verify the webhook.
      3. An HMAC signature can be included as a HTTP header.
      4. Mutual TLS authentication can be used when the connection is established. The endpoint (the server) can then verify the client's certificate.
      5. 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.
  4. What are Azure Functions?
    1. Azure functions is a serverless solution that allows you to 
      1. write less code
      2. maintain less infrastructure
      3. save on costs
    2. The cloud infrastructure provides all the up-to-date resources needed to keep application running.
    3. Scenarios, where you can use Azure functions-
      1. If you want to - Build a Web API
        1. Then - Implement an endpoint for your web applications using the HTTP trigger
      2. If you want to - Process file uploads
        1. Then - Run code when a file is uploaded or changed in BLOB storage
      3. If you want to - Build a serverless workflow
        1. Then - Create an event-driven workflow from a series of functions using durable functions
        2. 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.
        3. Durable Entities / Entity Functions - Entity Functions define operations for reading and updating small pieces of state, known as Durable Entities.
      4. If you want to - Respond to database changes
        1. Then - Run custom logic when a document is created or updated in Azure Cosmos DB
      5. If you want to - Run scheduled tasks
        1. Then - Execute code on pre-defined timed intervals
      6. If you want to - Create reliable message queue systems
        1. Then - Process message queues using Queue Storage, Service Bus or Event Hubs
      7. If you want to - Analyze IoT data streams
        1. Then - Collect and process data from IoT devices
      8. If you want to - Process data in real time
        1. Then - Use Functions and SignalR to respond to data in the moment
  5. What are the pricing options in Azure Functions?
    1. There are 3 main options -
      1. Consumption Plan - Pay for the time that your code runs.
      2. 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.
      3. 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.
    2. Apart from that two more options are there - 
      1. App Service Environment (ASE) - Provides a fully isolated and dedicated environment for securely running the App service apps at high scale.
      2. Kubernetes (Direct or Azure Arc) - Provides a fully isolated and dedicated environment running on the top of the Kubernetes platform.
    3. More details are available on Azure Functions hosting options
  6. What are Pre-Warmed Instances?
    1. 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.
    2. 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.