Command Line Interface for deploying an IoT preconfigured solution into a user's subscription.
This CLI has the ability to deploy two configurations of PCS solutions:
- Basic - deploys all resources to a single VM.
- Standard - deploys resources using Azure Container Service and Kubernetes across multiple VMs.
The command line interface depends on:
- nodejs used as the runtime for the CLI. Please install node before attempting a deployment.
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.
Basic deployment provisions following resources:
- Azure IoT Hub
- Azure Cosmos DB
- Azure Storage
- Single instance of Azure Virtual Machine with Docker Extension
At the end of deployment, Remote Monitoring WebApp and all the microservices are ready for demo pursposes.
The Standard deployment offers a production ready deployment that can be
scaled up or down as needed. It uses
Azure Container Service
and Kubernetes for orchestration. It would be nice to have installed
kubectl for running commands on kubernetes
in addition to pcs
.
Standard deployment provisions following resources:
- Azure IoT Hub
- Azure Cosmos DB
- Azure Container Service which also provisions following:
git clone https://github.com/Azure/pcs-cli.git
In locally cloned directory run
npm install
npm start
npm link
- If you haven't logged in with your Azure account from the command prompt run
pcs login
. - Run either
pcs
orpcs -t remotemonitoring -s basic
. These are equivalent in that they will both 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, it will take you to the Remote Monitoring WebApp
pcs -t remotemonitoring -s standard
- Follow the on-screen prompts
- The results of the deployment will be saved to a file named {deployment-name}-output.json
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, it will take you to the Remote Monitoring WebApp
- 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
To view Kubernetes dashboard, run the following command, which will start a local web proxy for your cluster (it will start a local server at http://127.0.0.1:8001/ui):
kubectl 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.