Monday, January 3, 2022

Azure API

Azure API


Create Webapp using Flask

Azure App Service

Pre-Req

  • Make Sure u have setup account created for Azure
  • You have enabled Free Subscription
  • You have created a webapp instance manullay example "flaskserverpushparanimptest2"

Setup Env

$brew update && brew install azure-cli
$az upgrade
$az version
$az login

Code Flask Api

$git clone https://github.com/Azure-Samples/python-docs-hello-world
$cd python-docs-hello-world
$python3 -m venv .venv
$source .venv/bin/activate
$pip install -r requirements.txt
$flask run

Test locally

test localy in browser : http://localhost:5000/ ctrl+C to Quit

Deploy to Azure

$az webapp up --sku F1 --name flaskserverpushparanimptest2 #sku is pricing F1 is free

Test Azure Web

open http://flaskserverpushparanimptest2.azurewebsites.net

Add new enhancement for your file and run below code

    $az webapp up
view raw AzureFlask.md hosted with ❤ by GitHub

No comments:

Post a Comment