{"id":16158364,"url":"https://github.com/ajaymahadeven/Azure-Python-Serverless-Demo","last_synced_at":"2025-03-31T19:32:20.314Z","repository":{"id":249821005,"uuid":"829665704","full_name":"ajaymahadeven/Azure-Python-Serverless-Demo","owner":"ajaymahadeven","description":"This repository contains a project that integrates Azure Functions with a PostgreSQL database using Python. It provides a set of API endpoints for managing a list of people, demonstrating how to deploy and run serverless functions with database connectivity on Azure.","archived":false,"fork":false,"pushed_at":"2024-07-27T20:54:56.000Z","size":55,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T08:51:21.696Z","etag":null,"topics":["azure","azure-functions","containers","docker","docker-compose","learn","postgres","postgresql","python3","serverless"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ajaymahadeven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-07-16T22:09:57.000Z","updated_at":"2024-11-19T23:52:00.000Z","dependencies_parsed_at":"2024-07-27T21:47:26.793Z","dependency_job_id":"3c9bcd4a-eb9d-4ee5-866e-3abc093b9fd2","html_url":"https://github.com/ajaymahadeven/Azure-Python-Serverless-Demo","commit_stats":null,"previous_names":["thenameisajay/azure-python-serverless-demo","ajaymahadeven/azure-python-serverless-demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FAzure-Python-Serverless-Demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FAzure-Python-Serverless-Demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FAzure-Python-Serverless-Demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ajaymahadeven%2FAzure-Python-Serverless-Demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ajaymahadeven","download_url":"https://codeload.github.com/ajaymahadeven/Azure-Python-Serverless-Demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246395595,"owners_count":20770243,"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":["azure","azure-functions","containers","docker","docker-compose","learn","postgres","postgresql","python3","serverless"],"created_at":"2024-10-10T01:53:59.824Z","updated_at":"2025-03-31T19:32:19.577Z","avatar_url":"https://github.com/ajaymahadeven.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure Functions with PostgreSQL (Python)\n\n## Repository Overview\n\nThis repository showcases a project integrating Azure Functions with a PostgreSQL database using Python. It provides a suite of API endpoints to manage a list of people, demonstrating the deployment and execution of serverless functions with database connectivity on Azure.\n\n## Prerequisites\n\nTo successfully run this project, ensure you have the following:\n\n- Knowledge of basic API concepts\n- An active Azure subscription\n- Azure CLI version 2.4 or later\n- Docker\n- Azure Functions Core Tools\n- Azure Functions extension for VS Code\n- Python 3 (preferably 3.11.xx)\n\n## Environment Configuration\n\nYou will need the following configuration files:\n\n- `.env` in the project root for Docker\n- `.env` in the `frontend` folder\n- `local.settings.json` in the `api` folder for Azure Functions\n\nSample configuration files are included in the repository.\n\n## Setup Instructions\n\nFollow these steps to set up and run the project:\n\n1. **Clone the Repository**\n\n   ```bash\n   git clone \u003crepository_url\u003e\n   cd \u003crepository_folder\u003e\n   ```\n\n2. **Start the PostgreSQL Database**\n\n   In the project root, execute:\n\n   ```bash\n   docker-compose up\n   ```\n\n   Customize the database credentials in the `docker-compose.yml` file or directly via the `.env` file.\n\n   For Linux users:\n\n   Create a `pgdata` directory in the project root:\n\n   ```bash\n   mkdir pgdata\n   ```\n\n   Change the permissions and set the user and group of the `pgdata` directory to 1001:\n\n   ```bash\n   sudo chown -R 1001:1001 pgdata\n   ```\n\n3. **Set Up Azure Functions**\n\n   Create a Python virtual environment in the project root and activate it:\n\n   ```bash\n   python3 -m venv ./venv\n   source ./venv/bin/activate\n   ```\n\n4. **Install Python Dependencies**\n\n   From the project root, run:\n\n   ```bash\n   python3 -m pip install -r requirements.txt\n   ```\n\n5. **Deploy and Run Azure Functions**\n\n   For the initial setup, deploy the functions to Azure by following these steps:\n\n   - Press `Fn + F5` to deploy the functions, or run the following command in the terminal:\n\n     ```bash\n     func start\n     ```\n\n   - Follow the prompts to configure and debug the functions locally.\n\n6. **Access the Application**\n\n   Open a browser and navigate to `http://localhost:7071/api/hello` to see the message \"Hello, World!\".\n\n## API Endpoints\n\nThe following API endpoints are available:\n\n- **add_people:** [GET] `http://localhost:7071/api/add_people`\n- **add_test_user:** [GET] `http://localhost:7071/api/add_test_user`\n- **delete_people:** [DELETE] `http://localhost:7071/api/drop_people`\n- **get_people:** [GET] `http://localhost:7071/api/people`\n- **hello:** [GET, POST] `http://localhost:7071/api/hello`\n- **validate_user:** [POST] `http://localhost:7071/api/validate_user`\n- **add_user:** [POST] `http://localhost:7071/api/add_user`\n\n## Testing and Usage\n\n- Use Postman or another API testing tool to test the endpoints.\n- Send a [POST] request with your name to the `/api/hello` endpoint to verify functionality.\n- Use the \"Populate Data\" button to insert five people's sample data into the database.\n- Use the \"Delete Data\" button to remove the data.\n- Use the \"View Data\" button to view the data.\n\n## Testing with Postman\n\nA Postman collection is available for testing the API endpoints:\n\n[Postman Collection](https://elements.getpostman.com/redirect?entityId=27211746-2b090b22-f910-4ec4-8b28-3e5648894f6a\u0026entityType=collection)\n\nThis guide outlines the steps to clone the repository, set up the PostgreSQL database, configure Azure Functions, and access the API endpoints for testing and usage.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaymahadeven%2FAzure-Python-Serverless-Demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fajaymahadeven%2FAzure-Python-Serverless-Demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fajaymahadeven%2FAzure-Python-Serverless-Demo/lists"}