@sns , Thanks for the follow-up.
The doc outlines step by step instructions on deploying the Python WebApp (Django or Flask), in your case, instead of sample application, you could push the application code (that your dev team provides). I'm sharing below detailed steps:
1. Ensure that you have the latest Azure CLI installed on your machine.
2. Open a terminal or command prompt and navigate to the root directory of your Python app.
3. Create a new resource group for your app using the following command:
az group create --name <resource-group-name> --location <location>
Replace <resource-group-name> with the name you want to give your resource group, and <location> with the Azure region you want to deploy to.
4. Create a new Azure App Service plan using the following command:
az appservice plan create --name <app-service-plan-name> --resource-group <resource-group-name> --sku B1 --is-linux
Replace <app-service-plan-name> with the name you want to give your app service plan, and <resource-group-name> with the name of the resource group you created in step 3.
5. Create a new web app using the following command:
az webapp create --name <app-name> --resource-group <resource-group-name> --plan <app-service-plan-name> --runtime "PYTHON|3.9" --deployment-local-git
Replace <app-name> with the name you want to give your web app, <resource-group-name> with the name of the resource group you created in step 3, and <app-service-plan-name> with the name of the app service plan you created in step 4.
(Azure App service supports multiple methods to deploy your application code to Azure including support for GitHub Actions and all major CI/CD tools. Here, we are focuses on how to deploy your code from your local workstation to Azure/via Git)
6. Set the deployment credentials for your web app using the following command:
az webapp deployment user set --user-name <username> --password <password>
Replace <username> with the username you want to use for deployment, and <password> with the password you want to use for deployment.
- To deploy updates to your app, you can use Git deployment. First, run the following command to get the Git URL for your app:
az webapp deployment source config-local-git --name <app-name> --resource-group <resource-group-name>
8.Copy the Git URL that is returned by the command.
9.In your local app directory, initialize a new Git repository and add your code:
git init
git add .
git commit -m "Initial commit"
- Add the Azure remote repository as a Git remote:
git remote add azure <git-deployment-url>
(Deploy your Python code to the web app using Git. First, add the Azure App Service Git remote to your local Git repository)
Replace <git-deployment-url>
with the Git URL you copied in step 7.
11.Push your code to the Azure remote repository:
git push azure master
Additional resources:
Configure a Linux Python app for Azure App Service
Use CI/CD to deploy a Python web app to Azure App Service on Linux
This will deploy your code to Azure App Service.
I hope this helps! Let me know if you have any further questions.
If the answer helped (pointed you in the right direction) > please click Accept Answer