Skip to content

Commit f0c3839

Browse files
committed
Update azure-pipelines.yml for Azure Pipelines
1 parent 0ff1227 commit f0c3839

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎azure-pipelines.yml‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ variables:
88
pythonVersion: '3.10'
99
artifactName: 'python-app'
1010
zipName: 'release1.zip'
11-
appFolder: 'src' # FastAPI app entry is inside src/fastapi_app
11+
appFolder: 'src' # FastAPI app is inside src/fastapi_app
1212
appName: 'testpython123'
1313
resourceGroup: 'test-scolas-app'
1414

1515
stages:
1616

17+
# =============================
1718
# 🔨 BUILD STAGE
19+
# =============================
1820
- stage: Build
1921
jobs:
2022
- job: BuildJob
@@ -39,7 +41,7 @@ stages:
3941
4042
- script: |
4143
cd $(appFolder)
42-
pip install -r ../requirements.txt # Adjust path to main requirements.txt
44+
pip install -r ../requirements.txt
4345
pip install uvicorn gunicorn
4446
displayName: '⬇️ Install dependencies'
4547
@@ -55,7 +57,10 @@ stages:
5557
publishLocation: 'Container'
5658
displayName: '🚀 Publish ZIP artifact'
5759

60+
61+
# =============================
5862
# 🚀 DEPLOY STAGE
63+
# =============================
5964
- stage: Deploy
6065
dependsOn: Build
6166
jobs:
@@ -87,9 +92,9 @@ stages:
8792
azureSubscription: 'azure-arm-coonection'
8893
appName: '$(appName)'
8994
resourceGroupName: '$(resourceGroup)'
90-
configurationStrings: '-startupFile "python3 -m uvicorn models:app --host 0.0.0.0 --port 8000"'
95+
configurationStrings: >
96+
-startupFile "bash -c 'pip install -r /home/site/wwwroot/requirements.txt && python3 -m uvicorn fastapi_app.app:app --host 0.0.0.0 --port 8000'"
9197
appSettings: |
9298
{
9399
"WEBSITES_PORT": "8000"
94100
}
95-

0 commit comments

Comments
 (0)