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.
To run the application locally, follow these steps:
-
Clone this repository:
git clone https://github.com/som-d/Python-Flask-App-Deploying-on-Azure-Web-Apps.git
-
Navigate to the project directory:
cd <project_directory>
-
Install the required dependencies using pip:
pip install -r requirements.txt
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
.
Before deploying the application to Azure Web Apps, ensure you have the following:
- An Azure account
- Azure CLI installed on your machine (Install Azure CLI)
-
Login to your Azure account using Azure CLI:
az login
-
Create a resource group:
az group create --name <resource_group_name> --location <location>
-
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>
-
Deploy the application to Azure Web App:
git push azure master
Once deployed, you can access the application at the URL provided by Azure Web Apps.
app.py
: Contains the Flask/FastAPI application code.requirements.txt
: Lists the dependencies required by the application.
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.
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!