Skip to content

Latest commit

 

History

12 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

FastAPI as Azure function

Minimal example of FastAPI deployed as Azure function.

Project structure

fastapi-azure-function
├── function/                                       Azure function and FastAPI code
├── infra/                                          Terraform code
├── .gitignore
└── README.md

Prerequisites

  • Azure Credentials: You'll need an Azure account with the necessary permissions to create the resources for the Azure function.
  • Azure CLI: Install Azure CLI.
  • Terraform: Install Terraform.

Deploy to Azure

Login to Azure and change to infra-directory.

az login
cd infra

Initialize Terraform.

terraform init

Terraform plan.

terraform plan

Terraform apply.

terraform apply

Terraform apply will output the URL of your deployed function, for example https://function-app-5aia.azurewebsites.net. In browser navigate to FastAPI docs https://function-app-5aia.azurewebsites.net/docs. From there you can send test requests to each of the endpoints.

About

Minimal example of FastAPI deployed as Azure function.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages