Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain.Learn More
Socket
Book a DemoInstallSign in
Socket

azure-serverless-openapi-boilerplate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

azure-serverless-openapi-boilerplate

Boilerplate project for a serverless API with automated OpenAPI specification on Azure Functions

latest
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

OpenAPI Azure Function Typescript Boilerplate

License

Boilerplate project for a serverless API with automated OpenAPI specification on Azure Functions

This project is currently just me figuring out the best ways to do Serverless APIs in Azure with nice tooling.

Features

  • Local development with Azure Functions Core Tools
  • Azure infra deployment with Terraform
    • Azure Function App with Linux Node.js runtime
    • Azure Database for PostgreSQL
    • Azure Redis Cache
  • Continuous deployment using ZIP deployment on Azure
  • Automated OpenAPI specification

Deploy

Requirements:

In Azure Portal, gather or create the following items:

  • Subscription
    • ID
  • Resource Group
    • Name
  • Storage Account
    • Name
    • Access Key
  • Blob Storage Container
    • Name

In your .env file, fill the missing environment variables.

# .env
export PROJECT_NAME=<unique name for your project>

export ARM_SUBSCRIPTION_ID=<Subscription ID>
export ARM_RESOURCE_GROUP=<Resource Group Name>
export ARM_ACCESS_KEY=<Storage Account Access Key>

Then source the file to load the environment variables.

source .env

If you wish, you can configure the terraform remote backend to a blob storage container.

See terraform-backend.tf.sample:

terraform {
  backend "azurerm" {
    storage_account_name = "<Storage Account Name>"
    container_name = "<Blob Storage Container Name>"
    key = "terraform.tfstate"
  }
}

Init Terraform and deploy!

terraform init
terraform apply

Publish

To publish your function in the deployed Azure function app:

func azure functionapp publish $PROJECT_NAME-<stage> --zip

Keywords

azure

FAQs

Package last updated on 24 Oct 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts