som-d / Python-Flask-App-Deploying-on-Azure-Web-Apps

Deploying Flask Application on Azure Web Apps

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deploying Flask Application on Azure Web Apps

This repository contains a simple Flask application that can be deployed on Azure Web Apps. The application consists of a single endpoint that returns "Hello, Azure Web Apps!" when accessed.

Application Setup

Installation

To run the application locally, follow these steps:

  1. Clone this repository:

    git clone https://github.com/som-d/Python-Flask-App-Deploying-on-Azure-Web-Apps.git
  2. Navigate to the project directory:

    cd <project_directory>
  3. Install the required dependencies using pip:

    pip install -r requirements.txt

Running Locally

To run the application locally, execute the following command:

  • For Flask:

    python app.py

This will start a development server, and you can access the application at http://localhost:8000.

Azure Web App Deployment

Prerequisites

Before deploying the application to Azure Web Apps, ensure you have the following:

Deployment Steps

  1. Login to your Azure account using Azure CLI:

    az login
  2. Create a resource group:

    az group create --name <resource_group_name> --location <location>
  3. Create an Azure Web App:

    az webapp up --name <app_name> --resource-group <resource_group_name> --plan <app_service_plan_name> --sku <sku> --location <location>
  4. Deploy the application to Azure Web App:

    git push azure master

Accessing the Deployed Application

Once deployed, you can access the application at the URL provided by Azure Web Apps.

Repository Structure

  • app.py: Contains the Flask/FastAPI application code.
  • requirements.txt: Lists the dependencies required by the application.

Testing

To test the deployed application, simply access the URL of the Azure Web App in your web browser or use tools like cURL or Postman to make requests to the endpoint.

curl <azure_web_app_url>

You should receive a response "Hello, Azure Web Apps!" indicating that the application is running successfully.

Contributors

Feel free to contribute to this project by creating issues or submitting pull requests.

For any questions or issues, please contact sohamdeshmukh611@gmail.com

Happy coding!

About

Deploying Flask Application on Azure Web Apps


Languages

Language:Python 97.3%Language:CSS 1.7%Language:Jinja 0.3%Language:HTML 0.2%Language:C++ 0.2%Language:Cython 0.1%Language:PowerShell 0.1%Language:C 0.1%Language:JavaScript 0.0%Language:Roff 0.0%Language:Classic ASP 0.0%Language:XSLT 0.0%Language:Batchfile 0.0%Language:VBScript 0.0%Language:Makefile 0.0%Language:Shell 0.0%Language:Smarty 0.0%