Created by Debaveye Elias
-
Python Fetches
PythonFetch.py
-
GET
GET/GET.cs
-
FunctionName("GET_NoParams")
Normal GET without parameters
Route can be changed however you want -
FunctionName("GET_Params")
Normal GET with parameters
Route can be changed however you wantNote: Don't forget to add your parameters to your function
-
FunctionName("GET_noParams_withDB")
GET without parameters with database
Route can be changed however you wantNote: Don't forget to add your ConnectionString to local.settings.json and include it in the code. (see comments)
-
FunctionName("GET_Params_withDB")
GET with parameters with database
Route can be changed however you wantNote: Don't forget to add your ConnectionString to local.settings.json and include it in the code. (see comments)
Don't forget to add your parameters to your function
-
-
POST
POST/POST.cs
-
FunctionName("POST_noDB")
Normal POSt Without database connection
Can be used for a simple calculation F.E. -
FunctionName("POSTWithDB")
Normal POST with database connection
Route can be changed however you wantNote: Don't forget to add your ConnectionString to your local.settings.json and include it in the code. (see comments)
Note: Don't forget to add your sql NuGet package
Don't forget to install the System.Data.SqlClient package
package
-
-
MQTT
3.1 MQTT Without Azure Functions
MQTT/MQTTNoFunctions.cs
MQTT/MQTT01.py
-
Example on adding MQTT
Example on how you would implement MQTT in a C# project
Covers sending and receiving messagesNote: Don't forget to add the M2MQTT NuGet package
Package -
Example on adding MQTT in PYTHON
Example on how you would implement MQTT in a Python project
Covers sending and receiving messagesNote: Don't forget to add the pip package
pip install paho-mqtt
3.2 MQTT With Azure Functions
MQTT/MQTTFunctions.cs
-
FunctionName("MQTTFunctionsWithResend")
MQTT function that will execute included code when message is received at broker to specific topic
This function will send his own message to the same or different topic. This can be changed in codeThe data can be used for all sorts of end results (Database, ...)(see variablenames)
Note: Don't forget to add the CaseOnline.Azure.WebJobs.Extensions.Mqtt package
package ❗❗VERSION 1.2.0❗❗ -
FunctionName("MQTTFunctionsWithoutResend")
MQTT function that will execute included code when message is received at broker to specific topic
This function will not send his own message towards the brokerThe data can be used for all sorts of end results (Database, ...)(see variablenames)
Note: Don't forget to add the CaseOnline.Azure.WebJobs.Extensions.Mqtt package
package ❗❗VERSION 1.2.0❗❗
-
-
Azure Storage
4.1 Table Storage
Storage/CloudTables.cs
Both Functions need a TableEntity class to send data to the cloud storage
-
FunctionName("POSTWithAzureStorage")
Azure POST function that will create an instance of ExampleRequest and put this in a Table storage.
This can be a replacement to a SQL database.Note: Don't forget to add your ConnectionString for you Storage Acoount in local.settings.json
Don't forget to write your Tablename correctly
Don't forget to add the Microsoft.Azure.Cosmos.Table package
package -
FunctionName("GETWithAzureStorage")
Azure GET function that will get all rows or certain rows with a specific value in a specific column.
Be mindfull of parameters and change them accordingly!Note: Don't forget yo add your ConnectionString for your Storage Account in local.settings.json
Don't forget to write your Tablename correctly
Don't forget to add the Microsoft.Azure.Cosmos.Table package
package
4.2 Queues
Queues/Queues.cs
-
FunctionName("Queues")
Function will be triggered when data enters a queue
Includes function to add a certain instance to the queueNote: Don't forget to add the ConnectionString to local.settings.json
Don't forget to add the Azure.Storage.Queues package
package
-
-
IoTHub
5.1 Listen to messages
IoTHub/IoTHubListener.cs
-
FunctionName("IoTHubListener")
Listens to all messages to the IoTHub
Note: Don't forget to add you ConnectionString from YourIoTHub > Built-in endpoints > Event Hub compatible endpoint
5.2 Twins
IoTHub/IoTHubTwinEdits.cs
-
FunctionName("GetDevices")
Will get all Twins from devices registered in the IoTHub
Note: Requires the AdminConnectionString YourIoTHub > Shared access policies > iothubowner
Don't forget to install the Microsoft.Azure.Devices package
package -
FunctionName("changeValue")
Will change a value you specified in a twin of a device you specified via a GET trigger
Note: Requires the AdminConnectionString YourIoTHub > Shared access policies > iothubowner
Don't forget to install the Microsoft.Azure.Devices package
package
5.3 Direct methods and messaging to device
IoTHub/IoTSending.cs
-
FunctionName("IoTSending")
Will send messages OR send direct method to the device in the query params
Note: Requires the AdminConnectionString YourIoTHub > Shared access policies > iothubowner
Don't forget to install the Microsoft.Azure.Devices package
package
5.4 Device
IoTHub/IoTHubPython.py
-
FunctionName("GetDevices")
Will simulate a Device connected to the IoTHub
- Sends data to the IotHub
- Gets data from Device Twin (threshold)
- Triggers event when new Twin is available
Note: Requires the DeviceConnectionString YourIoTHub > Iot Devices > YourDevice > Primary Connection String
Don't forget to installpip install azure-iot-device
- Sends data to the IotHub
-
-
CosmosDb
6.1 Add item to the database
COSMOS/CosmosFunctions.cs
-
FunctionName("AddItemToCosmos")
Adds new item to a specific comsos database in a specific container
Note: Don't forget to add you ConnectionString from YourCosmosDatabase > Keys > Primary ConnectionString
Don't forget to install the Microsoft.Azure.Cosmos package
package
6.2 Query items from the database
COSMOS/CosmosFunctions.cs
-
FunctionName("QueryItemsCosmos")
Queries items fron CosmosDB
Note: Don't forget to add you ConnectionString from YourCosmosDatabase > Keys > Primary ConnectionString
Don't forget to install the Microsoft.Azure.Cosmos package
package
-