diff --git a/requirements.txt b/requirements.txt index e635204..23c7d79 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,58 @@ -Flask -requests +azure-functions +requests# Project Name + +## Description +This project is designed to [provide a brief description of what your project does]. + +## Requirements +- Python 3.x +- `azure-functions` +- `requests` + +## Installation +1. Clone the repository: + ```sh + git clone https://github.com/yourusername/yourproject.git + cd yourproject + ``` + +2. Create a virtual environment: + ```sh + python3 -m venv venv + source venv/bin/activate + ``` + +3. Install the dependencies: + ```sh + pip install -r requirements.txt + ``` + +## Usage +1. To run the project locally, use the following command: + ```sh + func start + ``` + +2. Open your browser and navigate to `http://localhost:7071` to see the application in action. + +## Deployment +To deploy the project to Azure Functions, follow these steps: +1. Install the Azure Functions Core Tools: + ```sh + npm install -g azure-functions-core-tools@3 + ``` + +2. Deploy the function app: + ```sh + func azure functionapp publish + ``` + +## Contributing +1. Fork the repository. +2. Create a new branch (`git checkout -b feature-branch`). +3. Commit your changes (`git commit -am 'Add new feature'`). +4. Push to the branch (`git push origin feature-branch`). +5. Create a new Pull Request. + +## License +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. \ No newline at end of file diff --git a/spotbot.py b/spotbot.py index 7c1a5c8..238bc40 100644 --- a/spotbot.py +++ b/spotbot.py @@ -1,3 +1,4 @@ +''' import azure.functions as func import requests import os @@ -13,3 +14,18 @@ def main(req: func.HttpRequest) -> func.HttpResponse: return func.HttpResponse("Error: TARGET_URL environment variable is not set.", status_code=500) response = requests.post(target_url, json=content) return func.HttpResponse(response.text, status_code=response.status_code) +''' + +import azure.functions as func +import logging + +app = func.FunctionApp() + +@app.function_name(name="HttpTrigger1") +@app.route(route="hello", auth_level=func.AuthLevel.ANONYMOUS) +def test_function(req: func.HttpRequest) -> func.HttpResponse: + logging.info('Python HTTP trigger function processed a request.') + return func.HttpResponse( + "This HTTP triggered function executed successfully.", + status_code=200 + ) \ No newline at end of file