https://github.com/anibulus/azure.function.net
Azure Function allows to trigger actions in many ways and this project is a sample in .Net 6/8
https://github.com/anibulus/azure.function.net
azure-functions csharp dotnet-core function
Last synced: about 1 month ago
JSON representation
Azure Function allows to trigger actions in many ways and this project is a sample in .Net 6/8
- Host: GitHub
- URL: https://github.com/anibulus/azure.function.net
- Owner: Anibulus
- Created: 2024-08-27T19:30:16.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-23T18:07:28.000Z (over 1 year ago)
- Last Synced: 2026-04-29T03:59:16.272Z (about 2 months ago)
- Topics: azure-functions, csharp, dotnet-core, function
- Language: C#
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Sample Azure Function
## Setup
### The simple way
To create the solution you first need to install this template
```bash
dotnet new install Microsoft.Azure.Functions.Templates
```
And now you can use create a new project with cli
```bash
dotnet new func
```
## The hard way
This way allows to create more complex functions with a kit of azure.
To excecute Azure Function Core Tools, for my case I had to download [Azure function core tools](https://github.com/Azure/azure-functions-core-tools?tab=readme-ov-file#other-linux-distributions)
If you want to add it to path, use commands bellow:
```bash
sudo mv azure-functions-cli /usr/azure/functions-cli
```
```bash
sudo nano ~/.bashrc
```
Then type the path of your tool kit
```bash
export PATH="$PATH:/usr/azure-functions-cli"
```
Then run the coniguration
```bash
source ~/.bashrc
```
Check func is added to PATH
```bash
which func
```
## Create a project
Now you can use this commands to create your own [Azure Function Project](https://learn.microsoft.com/en-us/azure/azure-functions/create-first-function-cli-csharp?tabs=linux%2Cazure-cli)
Create a project with default config:
```bash
func init MiNuevoProyecto --dotnet
```
Create a new project with target framework:
```bash
func init LocalFunctionProj --worker-runtime dotnet-isolated --target-framework net8.0
```
## Create functions
func new
```bash
func new --name MyHttpFunction --template "HttpTrigger"
```
The types you can create are:
- `HttpTrigger`
- `BlobTrigger`
- `QueueTrigger`
- `TimerTrigger`
- `EventGridTrigger`
- `EventHubTrigger`
- `CosmosDBTrigger`
- `ServiceBusQueueTrigger`
- `ServiceBusTopicTrigger`
- `DurableFunctionsActivity`
- `DurableFunctionsOrchestrator`
- `DurableFunctionsEntity`
- `IoTHubTrigger`
- `SignalRTrigger`
Also you can use `func new` to have a console wizzard
## Run Azure fucnton
To run locally, use:
```bash
func start
```