File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed
Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ name : Deploy Azure Function App
2+
3+ on :
4+ push :
5+ branches :
6+ - main # Trigger deployment on push to the main branch
7+ workflow_dispatch : # Allow manual trigger from the Actions tab
8+
9+ jobs :
10+ build-and-deploy :
11+ runs-on : ubuntu-latest
12+
13+ steps :
14+ - name : Checkout repository
15+ uses : actions/checkout@v2
16+
17+ - name : Set up Python
18+ uses : actions/setup-python@v4
19+ with :
20+ python-version : ' 3.9' # Specify the Python version
21+
22+ - name : Create virtual environment
23+ run : python3 -m venv .azure_function_fastapi_venv
24+
25+ - name : Activate virtual environment and install dependencies
26+ run : |
27+ source .azure_function_fastapi_venv/bin/activate
28+ python -m pip install --upgrade pip
29+ pip install -r requirements.txt
30+
31+ - name : Azure Login
32+ uses : azure/login@v1
33+ with :
34+ creds : ${{ secrets.AZURE_CREDENTIALS }}
35+
36+ - name : Deploy to Azure Function App
37+ uses : azure/functions-action@v1
38+ with :
39+ app-name : ${{ secrets.PROJECT_NAME }} # Replace with your Function App name
40+ package : ' .' # Specify the directory to deploy, usually the current directory
Original file line number Diff line number Diff line change 88@router .get ("/" )
99async def root_index (request : Request ):
1010 data = {
11- 'message' : 'azure function project is running'
11+ 'message' : 'azure function project is running. '
1212 }
1313 return JSONResponse (content = data , status_code = status .HTTP_200_OK )
1414
You can’t perform that action at this time.
0 commit comments