GithubHelp home page GithubHelp logo

kandance / simple-fastapi-azure-function Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pamelafox/simple-fastapi-azure-function

0.0 1.0 0.0 10 KB

Simple HTTP API using FastAPI framework, deployed to Azure Functions using Azure Developer CLI.

Python 6.47% Dockerfile 6.04% Bicep 87.49%

simple-fastapi-azure-function's Introduction

Open in GitHub Codespaces

This repository includes a very simple Python Flask HTTP API, made for demonstration purposes only.

Local development: FastAPI

  1. Open this repository in Github Codespaces or VS Code with Remote Devcontainers extension.
  2. Open the Terminal and navigate to the api directory.
cd api
  1. Use uvicorn to run the FastAPI app:
uvicorn main:app --reload
  1. Click 'http://127.0.0.1:8000' in the terminal, which should open the website in a new tab.
  2. Append /generate_name to the end of the URL.

Local development: Azure Functions

Since this project is designed to be deployed to Azure Functions, you can also use the local emulator from Azure Functions Core Tools to test the function locally.

  1. Open this repository in Github Codespaces or VS Code with Remote Devcontainers extension.
  2. Open the Terminal and make sure you're in the root folder (simple-fastapi-azure-function).
  3. Run func host start
  4. Click 'http://localhost:7071/{*route}' in the terminal, which should open the website in a new tab.
  5. Change the URL to navigate to either the API at /generate_name or the docs at /docs.

Deployment

Run azd up.

Navigate to the endpoint displayed in the terminal.

To try API v1, append /generate_name to the end of the URL.

simple-fastapi-azure-function's People

Contributors

pamelafox avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.