🔏
Azure Serverless Quickstart
  • Introduction
  • Initial Setup
    • Workstation Installs
    • Codebase
      • Directory Structure
      • User Interface Project
        • Configuring StoryBook
        • Configure Tailwind
        • Configure Craco
        • -Architectural Decision Log
      • Data Access Project
        • DDD
      • Untitled
      • Full Stack Debugging
      • Creating GitHub Project
    • Infrastructure
      • Configure Session Behavior
      • Create AAD Tenant
      • Resource Group
      • Create AAD B2C Instance
        • Identity Experience Framework
        • Configure Session Behavior
      • Storage Account & CDN
        • CDN Rules
        • Configure Azure BLOB Storage
      • App Insights
        • Create AppInsight Account
        • Apollo GraphQL App Insights Configuration
      • CosmosDB
      • Twilio SendGrid
      • KeyVault
      • Function
      • Function App Settings
      • Front Door
      • DevOps
      • Optional Items
        • Azure Data Factory
      • Azure Event Hub
    • CICD and Source Control
      • Azure DevOps
      • SonarCloud
        • Incorporate into Yaml
      • Chromatic
      • User Interface YAML
      • CICD for Data Access
        • Create Pipeline
        • Data Access YAML
  • Application Structure
    • Connect Apollo
      • Apollo Overview
      • Create Apollo Component
    • MongoDB Integration
      • Mappings
      • Directory Structure
      • Apollo Connection
      • Models
      • Queries Mutations and Subscriptions
      • Caching Reponses
    • Integrating GraphQL Tools
      • GraphQL Code Generator
    • Feature Flags
      • Flag Structure & Storage
      • Website Integration
      • Apollo Integration
      • Tips and Techniques
      • Alternative Approaches
    • React Router
    • Adding Authentication
      • Create AAD Applications
      • Configure AAD For External Identities
      • Adding MSAL And React
      • Add MSAL to the build
      • Add MSAL to ApolloClient
      • Add MSAL to ApolloServer
    • Ant Design
    • Jest Tests
  • Azure Active Directory Business-to-Consumer (AD B2C)
    • Introduction
    • How to navigate through AD B2C documentation
    • Localization
    • Abbreviations
    • Azure AD B2C Extension
  • Cognitive Search
  • Cost Analysis
  • Technical Architecture
    • Identity and Access Control
  • Adding Functionality
    • Google Analytics
      • Create Analytics
    • DAPR
      • DAPR setup
      • DAPR Services (ignore for now)
        • Identity
  • Patterns and Practices
    • Idempotent Messages
    • Pathways
    • DDD
      • Initial Setup
        • Aggregate Root
        • Entity
        • Value Object
      • Field Types
        • Primitive Types
        • Non-Primitive Types
          • Types.DocumentArray
          • PopulatedDoc
          • Custom Types
      • Example Walkthrough
  • Open Items
    • Issue Tracking
  • Helpful Resources
  • DDD
    • Page 1
  • Experimental
    • StaticWebApp
    • Azure Maps
Powered by GitBook
On this page
  • App Service Plans
  • East US 2 App Service Plan
  • West US 2 App Service Plan
  • US East 2 Function
  • US West 2 Function

Was this helpful?

  1. Initial Setup
  2. Infrastructure

Function

(~17 minutes)

PreviousKeyVaultNextFunction App Settings

Last updated 3 years ago

Was this helpful?

App Service Plans

East US 2 App Service Plan

  • App service plans (ASPs) allow the function to run for an extended period of time - and most times can be more affordable to run than the Consumption plan.

  • Navigate to the resource in the Azure Portal

  • Select the appropriate Subscription and the rg-sharethrift resource group

  • App Service Plan details

    • Name: service-east2-<<random-number>>

      • ** when creating for west 2 use service-west2-<<random-number>

    • Operating System: Linux

    • Region: East US 2

      • **when creating for west 2 use West US 2

  • Pricing Tier

    • Sku and size: B1 (located under category of Dev / Test) ~$12.41/mo

West US 2 App Service Plan

Repeat the same process above, but instead make the following changes

  • App Service Plan Name:

    • service-west2-<<random-number>

  • Select the Region:

    • US West 2

US East 2 Function

  • Start by creating an app service plan - we're selecting the minimal to get us going:

  • Select the appropriate Subscription and the rg-sharethrift resource group

  • Instance Details

    • Function App Name: data-access-east2-<<random-number>>

      • ** when creating for west 2 use data-access-west2<<random-number>>

    • Publish: code

    • Runtime Stack: Node.js

    • Version: 16 LTS (Preview)

    • Region: East US 2

      • ** when creating for west 2 use West US 2

    • Choose Next : Hosting >

  • Hosting Details:

    • Storage Account: (select the sharethrift<random number> storage account created earlier)

      • ** when creating for west 2 select the sharethriftwest<random number> account

    • Operating System: linux

    • Plan type: App service plan

    • Linux Plan: service-east2 (B1)

    • Choose Next: Networking (preview) > Monitoring

  • Application Insights:

    • Enable Application Insights: Yes

    • Application Insights: sharethrift (East US 2)

      • ** when creating for west 2 select sharethriftwest (West US 2)

    • Choose Review + Create

    • Choose Create (wait for it to complete)

    • Choose Go to resource

  • Add App Settings for improved performance

    • In the function app just created navigate to Configuration

    • Choose + New Application Setting for each of the following

        • Name: SCM_DO_BUILD_DURING_DEPLOYMENT

        • Value: true

        • Name: ENABLE_ORYX_BUILD

        • Value: true

      • Do not add the following - these no longer seem to work..

          • Name: WEBSITE_RUN_FROM_PACKAGE

          • Value: 1

          • Name: FUNCTIONS_WORKER_PROCESS_COUNT

          • Value: 10

    • Choose Save

    • Choose Continue (wait until completion)

  • Add CORS headers

    • In the function app just created navigate to CORS

    • Check the Enable Access-Control-Allow-Credentials

    • Add the URL of the website created in the CDN step

      • e.g. https://sharethrift<random number>.azureedge.net/

  • Add System Assigned Identity

    • In the function app just created navigate to Settings > Identity

    • Under System Assigned, Status : Select On

    • Choose Save - a dialog confirming your choice will appear, click Yes, wait for it complete.

    • Click the Azure Role Assignments button:

      • You will be taken to the Azure Role Assignments Blade

      • Click Add role assignment (preview)

      • In the Add Role Assignment blade

        • Scope: Key Vault

        • Subscription: (choose the appropriate subscription)

        • Resource: sharethrift

        • Role: Key Vault Secrets User (preview)

US West 2 Function

Repeat the same process above, but instead make the following changes

  • Name the function:

    • data-access-west2<<random-number>>

  • Select the Region:

    • US West 2

  • Select the storage account:

    • sharethriftwest<random number> storage account created earlier

  • Select the application insights:

    • sharethriftwest (West US 2)

Keyvault Settings

  • Need to add Get permissions on secret for the 2 identities you just created

Resources

  • Microsoft

Navigate to the resource in the Azure Portal

Ensure the that runs the function when deployed

Improve Cold Start performance ()

Improve Node performance ()

Create App Service Plan
Create Function App
Node App gets rebuilt on the Linux VM
details
details
Functions Reference for NodeJS