Command Line Interface for deploying an Azure IoT Solution Accelerator into a user's Azure subscription.
An IoT Solution Accelerator is open source implementation of common IoT solution patterns that can be deployed to Azure using an Azure subscription. Each solution combines custom code and services to implement a specific IoT scenario or scenarios. Any of the solutions can be customized to meet any specific requirements. Visit azureiotsolutions.com for more details or to deploy using the GUI.
This CLI has the ability to deploy the following solution types:
- Remote Monitoring.
- Device Simulation.
This CLI has the ability to deploy the following configurations of solutions:
- basic - deploys all resources to a single VM.
- standard - deploys resources using Azure Kubernetes Service (AKS).
- local - deploys resources to be used for running and debugging microservices locally.
Deploy remote monitoring using the CLI
- nodejs used as the runtime for the CLI. Please install node before attempting a deployment.
- Azure Subscription (also see permissions guidelines)
npm install -g iot-solutions
git clone https://github.com/Azure/pcs-cli.git
cd {your-local-repo}
in command line.npm install
npm start
npm link
Sign in using pcs login
and credentials for an Azure account.
-
- Run
pcs -t remotemonitoring -s basic
. This will deploy a basic deployment (i.e. a deployment to a single VM). - Follow the on-screen prompts
- The results of the deployment will be saved to a file named
output.json
Click on the link that is shown in the output window to go to the Remote Monitoring web application.
pcs -t remotemonitoring -s standard --servicePrincipalId {servicePrincipalId} --servicePrincipalSecret {servicePrincipalSecret}
- Follow the on-screen prompts
- The results of the deployment will be saved to a file named {deployment-name}-output.json
Tip:
To get more info about service principal creation please go here. Use the
--password
option for service principal creation.Sample output format:
"resourceGroup" : { "type": "string", "value": "{myResourceGroupName}" }, "iotHubHostName": { "type": "string", "value": "{myIoTHubHostName}" }, "iotHubConnectionString": { "type": "string", "value": "{HostName={hubname}.azure-devices.net; SharedAccessKeyName={policy type};SharedAccessKey={Access Key};}" }, "documentDBConnectionString" : { "type": "string", "value": "{AccountEndpoint={URI};AccountKey={Key};}" }
- Click on the link that is shown in the output window to go to the Remote Monitoring web application.
- It can take upto 5 minutes for the webapp to be ready
- Go to {azurewebitesurl}/hubmanager/v1/status to see HubManager microservice status
- Go to {azurewebitesurl}/devices/v1/status to see Devices microservice status
Please look [here](https://docs.microsoft.com/azure/iot-suite/iot-suite-remote-monitoring-deploy-local for more information for using this option)
pcs -s local
- Follow onscreen prompts to start the deployment
- Run
-
- Run
pcs -t devicesimulation
. This will deploy a basic deployment (i.e. a deployment to a single VM). - Follow the on-screen prompts
- The results of the deployment will be saved to a file named
output.json
Click on the link that is shown in the output window to go to the Device Simulation web application.
- Run
pcs -t devicesimulation-nohub
. This will deploy a basic deployment (i.e. a deployment to a single VM) without an IoT hub. - Follow the on-screen prompts
- The results of the deployment will be saved to a file named
output.json
Click on the link that is shown in the output window to go to the Device Simulation web application.
- Run
These are available for
remotemonitoring
solution type only.
When deploying the preconfigured solution, there are several options that configure the deployment process:
Option | Values | Description |
---|---|---|
SKU | basic , standard , local |
A basic deployment is intended for test and demonstrations, it deploys all the microservices to a single virtual machine. A standard deployment is intended for production, it deploys the microservices to multiple virtual machines. A local deployment configures a Docker container to run the microservices locally, and uses Azure services, such as storage and Cosmos DB, in the cloud. |
Runtime | dotnet , java |
Selects the language implementation of the microservices. |
To learn about how to use the local deployment, see Running the remote monitoring solution locally.
The purpose of the basic deployment is to demo the capabilities of the system and requires minimal setup, deploying all resources to a single VM.
Creating a basic solution will result in the following Azure services being provisioned into the subscription:
Resource | Used For |
---|---|
Linux Virtual Machine | Hosting microservices |
Azure IoT Hub | Device management and communication |
Azure Cosmos DB | Stores configuration data, and device telemetry like rules, alerts, and messages |
Azure Storage Account | Storage for checkpoints |
Azure Stream Analytics | Transforms data into messages and alerts Processes and stores telemetry, and create alarms |
Azure Event Hub | Used for device notifications |
App Service | Application gateway with valid SSL certificate |
Azure Maps | Used to provide geospatial context to the solution |
Azure Time Series Insights | Used to analyze time-series data from IoT devices |
Azure Logic Apps | Used to integrate with other services to automate workflows |
Device Provisioning Service | Used to provision devices with the IoT Hub |
Key Vault | Stores configuration and settings needed for the microservices to operate |
The standard deployment is a production-ready deployment a developer can customize and extend to meet their needs. The standard deployment option should be used when ready to customize a production-ready architecture, built for scale and extensibility. Application microservices are built as Docker containers and deployed using AKS. The orchestrator is responsible for deployment, scaling, and management of the application.
Creating a standard solution will result in the following Azure services being provisioned into the subscription:
Resource | Used For |
---|---|
Azure IoT Hub | Device management, command and control |
Azure Kubernetes Service | Use a fully managed Kubernetes container orchestration service, defaults to 3 agents |
Azure Cosmos DB | Stores configuration data, and device telemetry like rules, alerts, and messages |
Azure Storage Accounts | 4 for VM storage, and 1 for the streaming checkpoints |
Azure Stream Analytics | Transforms data into messages and alerts Processes and stores telemetry, and create alarms |
Azure Event Hub | Used for device notifications |
App Service | Application gateway with valid SSL certificate |
Azure Maps | Used to provide geospatial context to the solution |
Azure Time Series Insights | Used to analyze time-series data from IoT devices |
Azure Logic Apps | Used to integrate with other services to automate workflows |
Device Provisioning Service | Used to provision devices with the IoT Hub |
Key Vault | Stores configuration and settings needed for the microservices to operate |
The purpose of the local deployment is to deploy the minimal set of services required to set up the solution for local development.
Creating a local deployment will result in the following Azure services being provisioned into the subscription:
Resource | Used For |
---|---|
Azure IoT Hub | Device management and communication |
Azure Cosmos DB | Storing configuration data, and device telemetry like rules, alerts, and messages |
Azure Storage Account | Storage for checkpoints |
Azure Stream Analytics | Transforms data into messages and alerts Processes and stores telemetry, and create alarms |
Azure Event Hub | Used for device notifications |
Azure Maps | Used to provide geospatial context to the solution |
Azure Time Series Insights | Used to analyze time-series data from IoT devices |
Azure Logic Apps | Used to integrate with other services to automate workflows |
Device Provisioning Service | Used to provision devices with the IoT Hub |
Key Vault | Stores configuration and settings needed for the microservices to operate |
Pricing information for these services can be found here. Usage amounts and billing details for a subscription can be found in the Azure Portal.
Install kubectl
kubectl proxy
to view Kubernetes dashboard that will start a local
web proxy for your cluster (it will start a local server at http://127.0.0.1:8001/api/v1/namespaces/kube-system/services/kubernetes-dashboard/proxy/):
To get help run pcs -h
or --help
To get the version run pcs -v
or --version
Please enter issues, bugs, or suggestions as GitHub Issues here: https://github.com/Azure/pcs-cli/issues.
See Contributing.md
Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT License.