- Setup development environment by following Get Started
- Open VS Code
- Press F1 or Ctrl + Shift + P -
IoT Workbench: Examples
and select DoorMonitor
-
click the Deploy to Azure button below and deploy SendGrid Service.
-
After the deployment succeeds, click the resource and then click the Manage button. You are taken to your SendGrid page, and need to verify your email address.
-
On the SendGrid page, click Settings > API Keys > Create API Key. Input the API Key Name and click Create & View.
-
Copy the API key.
-
Open the Azure Portal
-
Select the + or Create a resource button and under Enterprise Integration choose Logic App
-
Give it a Name, Resource Group, and Region (any will do) and click Create
-
After the logic app is created, open it
-
The designer should automatically load - if not click the Edit button
-
Select the When an HTTP request is received trigger
-
Click New Step to add a step to the workflow and Add an action
-
Search for the key word of Send email action.
NOTE: You are more than welcome to use any action you want to perform on an IoT event
-
Select the SendGrid - Send email(V2) action and provide the detailed information of the email.
-
Authenticate this logic app by using the SendGrid API key you created before..
-
Click the Save button to save this serverless workflow.
-
Click the When a HTTP request is received card to open and reveal the URL generated after saving. Copy that URL.
- Press F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench:Cloud and click Azure Provision
- Select a subscription.
- Select or choose a resource group.
- Select or create an IoT Hub.
- Wait for the deployment.
- Select or create an IoT Hub device. Please take a note of the device name.
- Create Function App.
- Wait for the deployment.
- Open shakeshake\run.csx and modify the following line with the URL you created in the previous step.
var response = await client.PostAsync("https://prod-1....", httpContent);
- ress F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench: Cloud and click Azure Deploy.
- Wait for function app code uploading.
- Connect your DevKit to your machine.
- Press F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench: Device and click config-device-connection.
- Hold button A on DevKit, then press rest button, and then release button A to enter config mode.
- Wait for connection string configuration to complete.
- Connect your DevKit to your machine.
- Press F1 or Ctrl + Shift + P in Visual Studio Code - IoT Workbench:Device and click Device Upload.
- Wait for arduino code uploading.