Skip to content

tuukkjs/fastapi-azure-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

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

Watchers

Forks

Releases

No releases published

Packages

No packages published