{"id":28965316,"url":"https://github.com/georges034302/az-app-service-workflow","last_synced_at":"2026-04-16T10:31:58.372Z","repository":{"id":294213811,"uuid":"986195998","full_name":"Georges034302/az-app-service-workflow","owner":"Georges034302","description":"Python-Flask API container deployment to Azure App Service using GitHub Actions workflows","archived":false,"fork":false,"pushed_at":"2025-06-04T05:13:13.000Z","size":64,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-24T06:11:33.386Z","etag":null,"topics":["appservice","azure","docker","github-actions","keyvault","python","pythonflask"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Georges034302.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-19T08:51:46.000Z","updated_at":"2025-06-04T05:13:15.000Z","dependencies_parsed_at":"2025-05-19T12:25:01.002Z","dependency_job_id":"d30ea592-e005-405b-b3be-52917a3642f4","html_url":"https://github.com/Georges034302/az-app-service-workflow","commit_stats":null,"previous_names":["georges034302/az-app-service-workflow"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Georges034302/az-app-service-workflow","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Georges034302%2Faz-app-service-workflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Georges034302%2Faz-app-service-workflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Georges034302%2Faz-app-service-workflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Georges034302%2Faz-app-service-workflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Georges034302","download_url":"https://codeload.github.com/Georges034302/az-app-service-workflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Georges034302%2Faz-app-service-workflow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265846885,"owners_count":23838160,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["appservice","azure","docker","github-actions","keyvault","python","pythonflask"],"created_at":"2025-06-24T06:10:49.574Z","updated_at":"2026-04-16T10:31:53.348Z","avatar_url":"https://github.com/Georges034302.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"## 🐍 Employee API (Containerized Python App on Azure App Service)\n\nThis project provides a minimal FastAPI-based backend API to simulate an employee directory. The API is packaged into a Docker container, pushed to Azure Container Registry (ACR), and deployed to Azure App Service for Linux using **GitHub Actions**.\n\n---\n\n### 📌 Features\n\n- ✅ Python + FastAPI-based backend API\n- 📦 Dockerized and deployed to **Azure App Service**\n- 🔁 CI/CD pipeline with **GitHub Actions**\n- 🔐 Secure credentials via **GitHub Secrets**\n- 🧪 Mock data served from a local JSON file\n\n---\n\n### 🧪 API Endpoints\n\n| Method | Endpoint                   | Description                        |\n|--------|----------------------------|------------------------------------|\n| GET    | `/users`                   | List all employees                 |\n| GET    | `/users/{id}`              | Get a single employee by ID        |\n\n**Full API URLs after deployment:**\n\n- **Get all users:**  \n  ```\n  https://\u003cAPP_NAME\u003e.azurewebsites.net/users\n  ```\n\n- **Get user by ID (example for user 2):**  \n  ```\n  https://\u003cAPP_NAME\u003e.azurewebsites.net/users/2\n  ```\n\nReplace `\u003cAPP_NAME\u003e` with your actual Azure App Service name.\n\nSample response from `/users`:\n```json\n[\n  {\"id\": 1, \"name\": \"Alice\", \"role\": \"Manager\", \"department\": \"HR\", \"city\": \"Sydney\"},\n  {\"id\": 2, \"name\": \"Bob\", \"role\": \"Developer\", \"department\": \"IT\", \"city\": \"Melbourne\"},\n  {\"id\": 3, \"name\": \"Eve\", \"role\": \"Analyst\", \"department\": \"Finance\", \"city\": \"Brisbane\"}\n]\n```\n\n---\n\n### ⚙️ Setup Instructions\n\n#### 1. 🔁 GitHub Actions Workflows\n\n**How these are used in the workflow:**\n\n- **setup-iac.yml**:  \n  *Run once to provision Azure resources and set up infrastructure-as-code (IAC) using the above secrets.*\n\n- **deploy.yml**:  \n  *Used for configuring and deploying the App Service container. This workflow expects all secrets to be present and resources to already exist (created by `setup-iac.yml`).*\n\n---\n\n#### 2. 📁 Project Structure\n\n```\naz-app-service-workflow/\n├── .github/\n│   ├── app/\n│   │   ├── __init__.py\n│   │   ├── main.py\n│   │   └── data.json\n│   ├── scripts/\n│   │   ├── acr_setup.sh\n│   │   ├── az_login.sh\n│   │   ├── az_setup.sh\n│   │   ├── configure_app_service.sh\n│   │   ├── deploy_app_service_container.sh\n│   │   ├── gh_setup.sh\n│   │   ├── output.sh\n│   │   ├── setup.sh\n│   │   └── tools_config.sh\n│   └── workflows/\n│       ├── deploy.yml\n│       └── setup-iac.yml\n├── Dockerfile\n├── requirements.txt\n└── README.md\n```\n\n---\n\n#### 3. ⚙️ Local Setup \u0026 Deployment\n\nI. **Authenticate and configure environment: (Run-Once)**  \n   ```bash\n   cd .github/scripts\n   bash setup.sh\n   ```\n\nII. **Deploy to Azure (manual run):**  \n   ```bash\n   cd .github/scripts\n   bash deploy.sh\n   ```\n\n---\n\n#### 4. 🚀 CI/CD with GitHub Actions\n\n- Triggered on push to `main` branch.\n- deploy.yaml workflow runs on push\n- Uses GitHub secrets and scripts to:\n  - Log in to Azure\n  - Build and push Docker image to ACR\n  - Configure App Service to use image\n  - Deploy container-app to App Service\n\n---\n\n#### 5. 🐳 Local Docker Run (for testing)\n\n```bash\ndocker build -t employee-api .\ndocker run -d -p 80:80 employee-api\n```\n\nAccess API at: [http://localhost](http://localhost)\n\n---\n\n#### 👨‍💻 Author: Georges Bou Ghantous\n*This repository demonstrates automated deployment of a Python FastAPI app to Azure App Service and Azure Container Registry (ACR) using GitHub Actions. 💙*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorges034302%2Faz-app-service-workflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorges034302%2Faz-app-service-workflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorges034302%2Faz-app-service-workflow/lists"}