workshop-azure-iot
This repository is for a workshop using Azure IoT services.
Prerequisites
To run all the projects in this repository, you need the followings.
Here are the preferred tools for development.
Scenarios
Setup
Infrastructure
Click the button below to deploy the infrastructure to Azure.
Application
Setup environment variables
To get started, you have to set environment variables in the *.env
files in the root directory.
Please refer to the *.env.template
files for the required environment variables.
# Clone the repository
$ git clone https://github.com/ks6088ts-labs/workshop-azure-iot.git
# Change the directory
$ cd workshop-azure-iot
# Prepare the environment files based on the templates
$ make env
Please update the environment files to fit your environment.
How to run
Connection test
Following commands are for testing the connection to the Azure resources. Passing the test means the environment is set up correctly.
# Run test locally to check the environment is set up correctly
$ make test
Run FastAPI server locally
# Install dependencies
$ make install-deps
# Run FastAPI server locally
$ make server
Run FastAPI server locally from Docker image
Docker is required to run the FastAPI server locally from the Docker image. The image for this project is available on Docker Hub. See the Docker Hub repository: ks6088ts/workshop-azure-iot.
# Run FastAPI server locally from Docker image
$ make docker-run
Run Azure Functions locally
# Run Azure Functions locally
$ make azure-functions
Deploy Azure Functions
# Deploy Azure Functions resources
$ make azure-functions-deploy
# Publish Azure Functions
$ export FUNCTION_APP_NAME=adhoc-azure-functions-RANDOM_SUFFIX
$ make azure-functions-publish