Skip to content

Latest commit

 

History

History
76 lines (63 loc) · 4.25 KB

4.5. Authoring Serverless Applications in Azure.md

File metadata and controls

76 lines (63 loc) · 4.25 KB

Authoring Serverless Applications in Azure

Azure Functions

  • Implemented using the existing code and base functionality for Azure WebJobs.
  • Created using one of two models:
    • App Service
      • Functions exist as a kind of app within an App Service Plan.
    • Consumption
      • Allows you to pay for Function Apps based on execution time as opposed to having a dedicated App Service Plan.
      • Billed at a rate specific to Gigabyte Seconds after a specific free monthly allocation threshold has been met.
  • Share a 3lot of functionality with other App types such as Web Apps.
    • E.g. • App Settings, • Connection Strings, • AlwaysOn • Continuos Deployment.
    • 💡 📝 Enable AlwaysOn for Function App to respond to requests as quickly as possible.

Authorization

  • Anonymous: No API key is required.
  • Function: A function-specific API key is required.
  • Admin: The master key is required.

Triggers

  • A Trigger is any event that invokes an Azure Function.
  • A function can have triggers for many different scenarios including: • Creation of Blobs • Changes to data in Cosmos DB • External File or Table changes • HTTP requests • OneDrive or Excel files • E-mail messages • Mobile Apps • SendGrid e-mails • Twilio Text Messages
  • A function can also be triggered by existing messaging services including: • Service Bus • Storage Queues • Logic Apps • Event Grid • Event Hubs • Webhooks

Integration

API Management

  • Provides developer engagement, business insights, analytics, security and protection.
  • Flow
    • Administrators create APIs.
      • Each API consists of one or more operations, and each API can be added to one or more products.
        • A product is segmentation/grouping of APIs.
          • Access policies can be enforced.
          • Defines APIs (endpoints)
    • Subscribers
      • Developers/B2B partners subscribe to a product that contains that API,
      • They call the APIs operation, subject to any usage policies that may be in effect.
  • Portals
    • Publisher portal: Admin portal.
      • Configures APIs & products & subscribers.
    • Developer portal: Partners can test the services.
  • Example
    API Products Subscribers
    DEVICEINFOBUILDINFOORDERSDELIVERYORDERSHIPMENTMILESTONESRETURNDEVICE • DCServicesExternal • DCServicesInternal • MakeInternal • MakeExternal • ReturnsInternal • ReturnsExternal • Arvato • Ups • Fedex • Walmart • Amazon

Logic Apps

  • Workflows that can connect various components of your application together using minimal or no-code.
  • Designed using JSON.
  • Logic Apps can integrate with
    • Existing services using built-in connectors such as SQL Server • OneDrive • Dropbox • Twilio • SendGrid • Cosmos DB • Event Grid • Event Hubs • Storage Blobs, Queues and Tables • Mobile Apps
    • custom APIs that are deployed as API Apps in your subscription.
  • The main components of a Logic App are as follows:
    • Workflow: The business process described as a series of steps, in an acyclic graph (loops are not supported).
    • Triggers: The step that starts a new workflow instance.
    • Actions: A step in a workflow, typically a Connector or a custom API App.
    • Connector: A special case of API App ready made to integrate a specific service (e.g., Twitter) or data source (e.g., SQL Server).
  • E.g. Azure Service Bus Connector to queue processing that you will run on HDInsight against some big data, and then send the result via an SMS message using the Twilio connector.

Traffic Manager

  • Automatically fails over if the primary region becomes unavailable.
    • Multi-region architecture / model
      • Provides a higher availability of your applications.
      • 💡📝 Have paired region as secondary region as paired regions are prioritized during outage.
  • Supports different routing algorithms
    • E.g. priority routing (formerly called failover routing)
      • All requests are sent to prioritized endpoint until it's unhealthy.
  • E.g. use SQL database geo-replication to the standby region.
    • Active region: Where application with SQL lies.
    • Standby region: Where application exists and SQL is replicated.