https://github.com/bbkane/azfunc-tf
Azure Functions + TF - thanks for permission for this Tom
https://github.com/bbkane/azfunc-tf
Last synced: 6 months ago
JSON representation
Azure Functions + TF - thanks for permission for this Tom
- Host: GitHub
- URL: https://github.com/bbkane/azfunc-tf
- Owner: bbkane
- Created: 2021-09-16T21:26:03.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-09-16T21:26:22.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T19:49:30.054Z (over 1 year ago)
- Language: HCL
- Size: 8.79 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Generally to iterate, copy the function directory and rename it. For the README, I've renamed it to "function_app_name" here (which happens to be an illegal URL, but whatever).
```
function_app_hostname = "function_app_name.azurewebsites.net"
function_app_name = "function_app_name"
```
```
func azure functionapp publish function_app_name
```
```
Invoke url: https://function_app_name.azurewebsites.net/api/my_function
```
Can also start from scratch with something like:
```
# from ./06_more_auth_from_tf
func init fnhw06-01-fa-dev-bbk --python
cd fnhw06-01-fa-dev-bbk
python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt
pip freeze --requirement requirements.txt | sponge requirements.txt
func new --name fnhw06-01-fn-dev-bbk --template "HTTP trigger" --authlevel "anonymous"
func start # test locally
curl http://localhost:7071/api/fnhw06-01-fn-dev-bbk
```
```
func azure functionapp publish fnhw06-01-fa-dev-bbk
```
NOTE that the newlines will be `\r\n` instead of `\n` - see https://github.com/Azure/azure-functions-core-tools/issues/2673
That's probably enough for now...