Skip to content

Commit

Permalink
testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tblanarik committed Sep 9, 2024
1 parent d0e54f2 commit 294b2fd
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 2 deletions.
60 changes: 58 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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 <FunctionAppName>
```

## 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.
16 changes: 16 additions & 0 deletions spotbot.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'''
import azure.functions as func
import requests
import os
Expand All @@ -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
)

0 comments on commit 294b2fd

Please sign in to comment.