Handles communication with the IoT Hub (device registration, device queries, etc.)
- WebService.csproj - C# web service exposing REST interface for IoT Hub management functionality
- WebService.Test.csproj - Unit tests for web services functionality
- Services.csproj - C# assembly containining business logic for interacting with Azure services (IoTHub, etc.)
- Services.Test.csproj - Unit tests for services functionality
- Solution/scripts - contains build scripts, docker container creation scripts, and scripts for running the microservice from the command line
For Unit Tests:
- There are two test projects:
- Services.Test - this contains tests for the Services project which interacts with Azure services through the Azure SDKs, e.g. the IoT Hub, and
- WebService.Test - this contains tests for the WebService project which contains the webservices APIs (note these tests are also dependent on Services code).
- Open the desired test project, e.g. WebService.Test
- Open the controller test file, e.g. DevicesControllerTest.cs
- Right click on a test and run it, e.g. Right click on TestAllDevices and select Run Intellitest from the context menu.
For Debugging:
- Set your PCS_IOTHUB_CONNSTRING system environment variable for your IoT Hub connection, and PCS_CONFIG_WEBSERVICE_URL for the URL of the config service.
- Run F5 from VS.
- Hit the REST api for the web service using:
- http://127.0.0.1:9002/v1/status (checks status of the web service)
- http://127.0.0.1:9002/v1/devices (queries for all devices)
- http://127.0.0.1:9002/v1/devices/ (queries for a single device)
- <todo - create device>
- <todo - create device>
Using Swagger:
- <todo - Swagger>
Running locally in a container:
- <todo - container instructions>
Running on Azure in a container in ACS:
- <todo - cloud environment container instructions>
- webservice\appsettings.ini allows configuring the microservice, like
IoT Hub connection string and web service TCP port. By default, the
file references the environment variable below:
- PCS_IOTHUB_CONNSTRING is a system environment variable and should contain your IoT Hub connection string. Create this environment variable before running the microservice.
- <todo - logging/monitoring>
- Contributing and Development setup
- Development setup, scripts and tools
- <todo - architecture docs link>
- <todo - doc pointing to overarching doc for how this microservice is used in remote monitoring and other PCS types>