Merge pull request #502 from EliiseS/feature/update-docs

Update documentation with iothub deploy command
This commit is contained in:
Eliise 2021-09-02 19:58:50 +02:00 коммит произвёл GitHub
Родитель 660fc64fb0 c7a4e53855
Коммит 27fd676b14
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 304 добавлений и 262 удалений

Просмотреть файл

@ -54,8 +54,6 @@ RUN \
rm -rf /tmp/* && \
rm -rf /var/lib/apt/lists/*
# Customize bash
RUN \
# Git command prompt

Просмотреть файл

@ -27,6 +27,8 @@
"ms-azuretools.vscode-docker",
"redhat.vscode-yaml",
"mikestead.dotenv",
"streetsidesoftware.code-spell-checker"
"streetsidesoftware.code-spell-checker",
"yzhang.markdown-all-in-one",
"davidanson.vscode-markdownlint"
]
}

Просмотреть файл

@ -1,6 +1,8 @@
## Commands
**iotedgedev**
```
# Commands
## iotedgedev
```text
Usage: iotedgedev [OPTIONS] COMMAND [ARGS]...
Options:
@ -11,11 +13,9 @@ Commands:
add Add a new module to the solution
build Build the solution
deploy Deploy solution to IoT Edge device
genconfig Expand environment variables and placeholders in deployment
manifest template file and copy to config folder
genconfig Expand environment variables and placeholders in deployment manifest template file and copy to config folder
init Create a new IoT Edge solution and provision Azure resources
log Open a new terminal window for EdgeAgent, EdgeHub and each Edge
module and save to LOGS_PATH
log Open a new terminal window for EdgeAgent, EdgeHub and each Edge module and save to LOGS_PATH
monitor Monitor messages from IoT Edge device to IoT Hub
new Create a new IoT Edge solution
push Push module images to container registry
@ -27,93 +27,96 @@ Commands:
simulator Manage IoT Edge simulator
solution Manage IoT Edge solutions
```
**iotedgedev add**
```
## iotedgedev add
```text
Usage: iotedgedev add [OPTIONS] NAME
Add a new module to the solution, where NAME is the module name
Options:
-t, --template [c|csharp|java|nodejs|python|csharpfunction]
Specify the template used to create the
default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId
[default: com.edgemodule]
Specify the template used to create the default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId [default: com.edgemodule]
-h, --help Show this message and exit.
```
**iotedgedev build**
```
## iotedgedev build
```text
Usage: iotedgedev build [OPTIONS]
Build the solution
Options:
-p, --push Push module images to container registry [default:
False]
-d, --deploy Deploy modules to Edge device using deployment.json in
the config folder [default: False]
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-p, --push Push module images to container registry [default: False]
-d, --deploy Deploy modules to Edge device using deployment.json in the config folder [default: False]
-f, --file TEXT Specify the deployment manifest template file [default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```
**iotedgedev deploy**
```
## iotedgedev deploy
```text
Usage: iotedgedev deploy [OPTIONS]
Deploy solution to IoT Edge device
Options:
-f, --file TEXT Specify the deployment manifest file [default:
config\deployment.amd64.json]
-f, --file TEXT Specify the deployment manifest file [default: config\deployment.amd64.json]
-h, --help Show this message and exit.
```
**iotedgedev genconfig**
```
## iotedgedev genconfig
```text
Usage: iotedgedev genconfig [OPTIONS]
Expand environment variables and placeholders in deployment manifest
template file and copy to config folder
Options:
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-f, --file TEXT Specify the deployment manifest template file [default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```
**iotedgedev init**
```
## iotedgedev init
```text
Usage: iotedgedev init [OPTIONS]
Create a new IoT Edge solution and provision Azure resources
Options:
-m, --module TEXT Specify the name of the default module
[default: filtermodule]
-er, --edge-runtime-version TEXT
Specify the IoT Edge Runtime Version. Currently available 1.0 and 1.1 [default: 1.1]
-m, --module TEXT Specify the name of the default module [default: filtermodule]
-t, --template [c|csharp|java|nodejs|python|csharpfunction]
Specify the template used to create the
default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId
[default: com.edgemodule]
Specify the template used to create the default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId [default: com.edgemodule]
-h, --help Show this message and exit.
```
**iotedgedev log**
```
## iotedgedev log
```text
Usage: iotedgedev log [OPTIONS]
Open a new terminal window for EdgeAgent, EdgeHub and each Edge module and
save to LOGS_PATH. You can configure the terminal command with LOGS_CMD.
Options:
-l, --show Open a new terminal window for EdgeAgent, EdgeHub and each Edge
module. You can configure the terminal command with LOGS_CMD.
[default: False]
-s, --save Save EdgeAgent, EdgeHub and each Edge module logs to LOGS_PATH.
[default: False]
-l, --show Open a new terminal window for EdgeAgent, EdgeHub and each Edge module. You can configure the terminal command with LOGS_CMD. [default: False]
-s, --save Save EdgeAgent, EdgeHub and each Edge module logs to LOGS_PATH. [default: False]
-h, --help Show this message and exit.
```
**iotedgedev monitor**
```
## iotedgedev monitor
```text
Usage: iotedgedev monitor [OPTIONS]
Monitor messages from IoT Edge device to IoT Hub
@ -122,52 +125,53 @@ Options:
-t, --timeout TEXT Specify number of seconds to monitor for messages
-h, --help Show this message and exit.
```
**iotedgedev new**
```
## iotedgedev new
```text
Usage: iotedgedev new [OPTIONS] NAME
Create a new IoT Edge solution, where NAME is the solution folder name.
Use "." as NAME to create in the current folder.
Options:
-m, --module TEXT Specify the name of the default module
[default: filtermodule]
-m, --module TEXT Specify the name of the default module [default: filtermodule]
-t, --template [c|csharp|java|nodejs|python|csharpfunction]
Specify the template used to create the
default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId
[default: com.edgemodule]
Specify the template used to create the default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId [default: com.edgemodule]
-h, --help Show this message and exit.
```
**iotedgedev push**
```
## iotedgedev push
```text
Usage: iotedgedev push [OPTIONS]
Push module images to container registry
Options:
-d, --deploy Deploy modules to Edge device using deployment.json in
the config folder [default: False]
--no-build Inform the push command to not build module images
before pushing to container registry [default: False]
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-d, --deploy Deploy modules to Edge device using deployment.json in the config folder [default: False]
--no-build Inform the push command to not build module images before pushing to container registry [default: False]
-f, --file TEXT Specify the deployment manifest template file [default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```
**iotedgedev setup**
```
## iotedgedev setup
```text
Usage: iotedgedev setup [OPTIONS]
Setup IoT Edge simulator. This must be done before starting
Options:
-g, --gateway-host TEXT GatewayHostName value for the module to connect.
[default: <your hostname>]
-g, --gateway-host TEXT GatewayHostName value for the module to connect. [default: <your hostname>]
-h, --help Show this message and exit.
```
**iotedgedev start**
```
## iotedgedev start
```text
Usage: iotedgedev start [OPTIONS]
Start IoT Edge simulator. To start in solution mode, use `iotedgdev
@ -175,27 +179,20 @@ Usage: iotedgedev start [OPTIONS]
`iotedgedev simulator start -i input1,input2 [-p 53000]`
Options:
-u, --setup Setup IoT Edge simulator before starting. [default:
False]
-s, --solution Start IoT Edge simulator in solution mode using the
deployment.json in config folder. [default: False]
-u, --setup Setup IoT Edge simulator before starting. [default: False]
-s, --solution Start IoT Edge simulator in solution mode using the deployment.json in config folder. [default: False]
-v, --verbose Show the solution container logs. [default: False]
-b, --build Build the solution before starting IoT Edge simulator
in solution mode. [default: False]
-f, --file TEXT Specify the deployment manifest file. When `--build`
flag is set, specify a deployment manifest template and
it will be built. [default:
config\deployment.amd64.json]
-b, --build Build the solution before starting IoT Edge simulator in solution mode. [default: False]
-f, --file TEXT Specify the deployment manifest file. When `--build` flag is set, specify a deployment manifest template and it will be built. [default: config\deployment.amd64.json]
-P, --platform TEXT Specify the platform [default: amd64]
-i, --inputs TEXT Start IoT Edge simulator in single module mode using
the specified comma-separated inputs of the target
module, e.g., `input1,input2`.
-p, --port INTEGER Port of the service for sending message. [default:
53000]
-i, --inputs TEXT Start IoT Edge simulator in single module mode using the specified comma-separated inputs of the target module, e.g., `input1,input2`.
-p, --port INTEGER Port of the service for sending message. [default: 53000]
-h, --help Show this message and exit.
```
**iotedgedev stop**
```
## iotedgedev stop
```text
Usage: iotedgedev stop [OPTIONS]
Stop IoT Edge simulator
@ -203,8 +200,10 @@ Usage: iotedgedev stop [OPTIONS]
Options:
-h, --help Show this message and exit.
```
**iotedgedev docker**
```
## iotedgedev docker
```text
Usage: iotedgedev docker [OPTIONS] COMMAND [ARGS]...
Manage Docker
@ -214,13 +213,13 @@ Options:
Commands:
clean Remove all the containers and images
log Open a new terminal window for EdgeAgent, EdgeHub and each Edge
module and save to LOGS_PATH
setup Pull Edge runtime images from MCR and push to your specified
container registry
```
**iotedgedev docker clean**
log Open a new terminal window for EdgeAgent, EdgeHub and each Edge module and save to LOGS_PATH
setup Pull Edge runtime images from MCR and push to your specified container registry
```
## iotedgedev docker clean
```text
Usage: iotedgedev docker clean [OPTIONS]
Remove all the containers and images
@ -232,23 +231,24 @@ Options:
-i, --image Remove all the images [default: False]
-h, --help Show this message and exit.
```
**iotedgedev docker log**
```
## iotedgedev docker log
```text
Usage: iotedgedev docker log [OPTIONS]
Open a new terminal window for EdgeAgent, EdgeHub and each Edge module and
save to LOGS_PATH. You can configure the terminal command with LOGS_CMD.
Options:
-l, --show Open a new terminal window for EdgeAgent, EdgeHub and each Edge
module. You can configure the terminal command with LOGS_CMD.
[default: False]
-s, --save Save EdgeAgent, EdgeHub and each Edge module logs to LOGS_PATH.
[default: False]
-l, --show Open a new terminal window for EdgeAgent, EdgeHub and each Edge module. You can configure the terminal command with LOGS_CMD. [default: False]
-s, --save Save EdgeAgent, EdgeHub and each Edge module logs to LOGS_PATH. [default: False]
-h, --help Show this message and exit.
```
**iotedgedev docker setup**
```
## iotedgedev docker setup
```text
Usage: iotedgedev docker setup [OPTIONS]
Pull Edge runtime images from Microsoft Container Registry and push to
@ -259,8 +259,10 @@ Usage: iotedgedev docker setup [OPTIONS]
Options:
-h, --help Show this message and exit.
```
**iotedgedev iothub**
```
## iotedgedev iothub
```text
Usage: iotedgedev iothub [OPTIONS] COMMAND [ARGS]...
Manage IoT Hub and IoT Edge devices
@ -269,11 +271,38 @@ Options:
-h, --help Show this message and exit.
Commands:
deploy Create a deployment in IoT Hub
monitor Monitor messages from IoT Edge device to IoT Hub
setup Retrieve or create required Azure resources
```
**iotedgedev iothub monitor**
## iotedgedev iothub deploy
```text
Usage: iotedgedev iothub deploy [OPTIONS]
Create a deployment in IoT Hub. For more information on how automatic deployments work see:
https://docs.microsoft.com/en-us/azure/iot-edge/module-deployment-monitoring
Options:
-f, --file TEXT Specify the deployment manifest file [default: config/deployment.amd64.json]
-n, --name TEXT Specify the name of the deployment that will be created in the IoT hub. [required]
-p, --priority TEXT Specify the deployment priority as positive integer. In the event that two or more
deployments are targeted at the same device, the deployment with the highest
numerical value for Priority will apply. [required]
-t, --target-condition, --tc TEXT
Specify a target condition to determine which devices will be targeted with this
deployment. The condition is based on device twin tags or device twin reported
properties and should match the expression format. For example,
tags.environment='test' and properties.reported.devicemodel='4000x'. This property
can be set via this parameter or in the .env under
'IOTHUB_DEPLOYMENT_TARGET_CONDITION' [default: ;required]
-h, --help Show this message and exit.
```
## iotedgedev iothub monitor
```text
Usage: iotedgedev iothub monitor [OPTIONS]
Monitor messages from IoT Edge device to IoT Hub
@ -282,8 +311,10 @@ Options:
-t, --timeout TEXT Specify number of seconds to monitor for messages
-h, --help Show this message and exit.
```
**iotedgedev iothub setup**
```
## iotedgedev iothub setup
```text
Usage: iotedgedev iothub setup [OPTIONS]
Retrieve or create required Azure resources
@ -291,26 +322,21 @@ Usage: iotedgedev iothub setup [OPTIONS]
Options:
--credentials <TEXT TEXT>... Enter Azure Credentials (username password).
--service-principal <TEXT TEXT TEXT>...
Enter Azure Service Principal Credentials
(username password tenant).
--subscription TEXT The Azure Subscription Name or Id.
[required]
Enter Azure Service Principal Credentials (username password tenant).
--subscription TEXT The Azure Subscription Name or Id. [required]
--resource-group-location [australiaeast|australiasoutheast|brazilsouth|canadacentral|canadaeast|centralindia|centralus|eastasia|eastus|eastus2|japanwest|japaneast|northeurope|northcentralus|southindia|uksouth|ukwest|westus|westeurope|southcentralus|westcentralus|westus2]
The Resource Group Location. [required]
--resource-group-name TEXT The Resource Group Name (Creates a new
Resource Group if not found). [required]
--resource-group-name TEXT The Resource Group Name (Creates a new Resource Group if not found). [required]
--iothub-sku [F1|S1|S2|S3] The IoT Hub SKU. [required]
--iothub-name TEXT The IoT Hub Name (Creates a new IoT Hub if
not found). [required]
--edge-device-id TEXT The IoT Edge Device Id (Creates a new Edge
Device if not found). [required]
-u, --update-dotenv If True, the current .env will be updated
with the IoT Hub and Device connection
strings. [default: False; required]
--iothub-name TEXT The IoT Hub Name (Creates a new IoT Hub if not found). [required]
--edge-device-id TEXT The IoT Edge Device Id (Creates a new Edge Device if not found). [required]
-u, --update-dotenv If True, the current .env will be updated with the IoT Hub and Device connection strings. [default: False; required]
-h, --help Show this message and exit.
```
**iotedgedev simulator**
```
## iotedgedev simulator
```text
Usage: iotedgedev simulator [OPTIONS] COMMAND [ARGS]...
Manage IoT Edge simulator
@ -319,28 +345,29 @@ Options:
-h, --help Show this message and exit.
Commands:
modulecred Get the credentials of target module such as connection string
and certificate file path.
modulecred Get the credentials of target module such as connection string and certificate file path.
setup Setup IoT Edge simulator. This must be done before starting
start Start IoT Edge simulator
stop Stop IoT Edge simulator
```
**iotedgedev simulator modulecred**
```
## iotedgedev simulator modulecred
```text
Usage: iotedgedev simulator modulecred [OPTIONS]
Get the credentials of target module such as connection string and
certificate file path.
Options:
-l, --local Set `localhost` to `GatewayHostName` for module to
run on host natively. [default: False]
-o, --output-file TEXT Specify the output file to save the credentials. If
the file exists, its content will be overwritten.
-l, --local Set `localhost` to `GatewayHostName` for module to run on host natively. [default: False]
-o, --output-file TEXT Specify the output file to save the credentials. If the file exists, its content will be overwritten.
-h, --help Show this message and exit.
```
**iotedgedev simulator setup**
```
## iotedgedev simulator setup
```text
Usage: iotedgedev simulator setup [OPTIONS]
Setup IoT Edge simulator. This must be done before starting
@ -350,8 +377,10 @@ Options:
[default: <your hostname>]
-h, --help Show this message and exit.
```
**iotedgedev simulator start**
```
## iotedgedev simulator start
```text
Usage: iotedgedev simulator start [OPTIONS]
Start IoT Edge simulator. To start in solution mode, use `iotedgdev
@ -359,27 +388,20 @@ Usage: iotedgedev simulator start [OPTIONS]
`iotedgedev simulator start -i input1,input2 [-p 53000]`
Options:
-u, --setup Setup IoT Edge simulator before starting. [default:
False]
-s, --solution Start IoT Edge simulator in solution mode using the
deployment.json in config folder. [default: False]
-u, --setup Setup IoT Edge simulator before starting. [default: False]
-s, --solution Start IoT Edge simulator in solution mode using the deployment.json in config folder. [default: False]
-v, --verbose Show the solution container logs. [default: False]
-b, --build Build the solution before starting IoT Edge simulator
in solution mode. [default: False]
-f, --file TEXT Specify the deployment manifest file. When `--build`
flag is set, specify a deployment manifest template and
it will be built. [default:
config\deployment.amd64.json]
-b, --build Build the solution before starting IoT Edge simulator in solution mode. [default: False]
-f, --file TEXT Specify the deployment manifest file. When `--build` flag is set, specify a deployment manifest template and it will be built. [default: config\deployment.amd64.json]
-P, --platform TEXT Specify the platform [default: amd64]
-i, --inputs TEXT Start IoT Edge simulator in single module mode using
the specified comma-separated inputs of the target
module, e.g., `input1,input2`.
-p, --port INTEGER Port of the service for sending message. [default:
53000]
-i, --inputs TEXT Start IoT Edge simulator in single module mode using the specified comma-separated inputs of the target module, e.g., `input1,input2`.
-p, --port INTEGER Port of the service for sending message. [default: 53000]
-h, --help Show this message and exit.
```
**iotedgedev simulator stop**
```
## iotedgedev simulator stop
```text
Usage: iotedgedev simulator stop [OPTIONS]
Stop IoT Edge simulator
@ -387,8 +409,10 @@ Usage: iotedgedev simulator stop [OPTIONS]
Options:
-h, --help Show this message and exit.
```
**iotedgedev solution**
```
## iotedgedev solution
```text
Usage: iotedgedev solution [OPTIONS] COMMAND [ARGS]...
Manage IoT Edge solutions
@ -401,71 +425,56 @@ Commands:
build Build the solution
deploy Deploy solution to IoT Edge device
e2e Push, deploy, start, monitor
genconfig Expand environment variables and placeholders in deployment
manifest template file and copy to config folder
genconfig Expand environment variables and placeholders in deployment manifest template file and copy to config folder
init Create a new IoT Edge solution and provision Azure resources
new Create a new IoT Edge solution
push Push module images to container registry
```
**iotedgedev solution add**
```
## iotedgedev solution add
```text
Usage: iotedgedev solution add [OPTIONS] NAME
Add a new module to the solution, where NAME is the module name
Options:
-t, --template [c|csharp|java|nodejs|python|csharpfunction]
Specify the template used to create the
default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId
[default: com.edgemodule]
Specify the template used to create the default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId [default: com.edgemodule]
-h, --help Show this message and exit.
```
**iotedgedev solution build**
```
## iotedgedev solution build
```text
Usage: iotedgedev solution build [OPTIONS]
Build the solution
Options:
-p, --push Push module images to container registry [default:
False]
-d, --deploy Deploy modules to Edge device using deployment.json in
the config folder [default: False]
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-p, --push Push module images to container registry [default: False]
-d, --deploy Deploy modules to Edge device using deployment.json in the config folder [default: False]
-f, --file TEXT Specify the deployment manifest template file [default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```
**iotedgedev solution build**
```
Usage: iotedgedev solution build [OPTIONS]
Build the solution
## iotedgedev solution deploy
Options:
-p, --push Push module images to container registry [default:
False]
-d, --deploy Deploy modules to Edge device using deployment.json in
the config folder [default: False]
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```
**iotedgedev solution deploy**
```
```text
Usage: iotedgedev solution deploy [OPTIONS]
Deploy solution to IoT Edge device
Options:
-f, --file TEXT Specify the deployment manifest file [default:
config\deployment.amd64.json]
-f, --file TEXT Specify the deployment manifest file [default: config\deployment.amd64.json]
-h, --help Show this message and exit.
```
**iotedgedev solution e2e**
```
## iotedgedev solution e2e
```text
Usage: iotedgedev solution e2e [OPTIONS]
Push, deploy, start, monitor
@ -473,65 +482,63 @@ Usage: iotedgedev solution e2e [OPTIONS]
Options:
-h, --help Show this message and exit.
```
**iotedgedev solution genconfig**
```
## iotedgedev solution genconfig
```text
Usage: iotedgedev solution genconfig [OPTIONS]
Expand environment variables and placeholders in deployment manifest
template file and copy to config folder
Options:
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-f, --file TEXT Specify the deployment manifest template file [default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```
**iotedgedev solution init**
```
## iotedgedev solution init
```text
Usage: iotedgedev solution init [OPTIONS]
Create a new IoT Edge solution and provision Azure resources
Options:
-m, --module TEXT Specify the name of the default module
[default: filtermodule]
-m, --module TEXT Specify the name of the default module [default: filtermodule]
-t, --template [c|csharp|java|nodejs|python|csharpfunction]
Specify the template used to create the
default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId
[default: com.edgemodule]
Specify the template used to create the default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId [default: com.edgemodule]
-h, --help Show this message and exit.
```
**iotedgedev solution new**
```
## iotedgedev solution new
```text
Usage: iotedgedev solution new [OPTIONS] NAME
Create a new IoT Edge solution, where NAME is the solution folder name.
Use "." as NAME to create in the current folder.
Options:
-m, --module TEXT Specify the name of the default module
[default: filtermodule]
-m, --module TEXT Specify the name of the default module [default: filtermodule]
-t, --template [c|csharp|java|nodejs|python|csharpfunction]
Specify the template used to create the
default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId
[default: com.edgemodule]
Specify the template used to create the default module [default: csharp]
-g, --group-id TEXT (Java modules only) Specify the groupId [default: com.edgemodule]
-h, --help Show this message and exit.
```
**iotedgedev solution push**
```
## iotedgedev solution push
```text
Usage: iotedgedev solution push [OPTIONS]
Push module images to container registry
Options:
-d, --deploy Deploy modules to Edge device using deployment.json in
the config folder [default: False]
--no-build Inform the push command to not build module images
before pushing to container registry [default: False]
-f, --file TEXT Specify the deployment manifest template file
[default: deployment.template.json]
-d, --deploy Deploy modules to Edge device using deployment.json in the config folder [default: False]
--no-build Inform the push command to not build module images before pushing to container registry [default: False]
-f, --file TEXT Specify the deployment manifest template file [default: deployment.template.json]
-P, --platform TEXT Specify the platform [default: amd64]
-h, --help Show this message and exit.
```

Просмотреть файл

@ -1,83 +1,114 @@
You can use the IoT Edge Dev Tool container to avoid having to install all the dependencies on your local dev machine. The only thing you need to install is Docker. All of the other dev dependencies are included in the container. Please see the [Quickstart](quickstart-with-IoT-Edge-Dev-Container) to learn more.
# Usage
You can use the IoT Edge Dev Tool container to avoid having to install all the dependencies on your local dev machine. The only thing you need to install is Docker. All of the other dev dependencies are included in the container. Please see the [Quickstart](quickstart-with-IoT-Edge-Dev-Container) to learn more.
To set up development machines manually instead of using the IoT Edge Dev Container, please see the [Manual Development Machine Setup Wiki](manual-Dev-Machine-Setup).
If you are using a separate Edge device, like a Raspberry Pi, you do not need to run all of these steps on your IoT Edge device, you can install and setup Edge runtime directly on the device. See the [Edge Device Setup](edge-device-setup) wiki page for more information on setting up your Edge device.
> Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edge Dev Tool has been tested with.
Note: See the ["Test Coverage"](test-coverage) wiki page to see what the IoT Edge Dev Tool has been tested with.
1. **Initialize IoT Edge solution and setup Azure resources**
`iotedgedev init`
```sh
iotedgedev init
```
> `iotedgedev init` will run both `iotedgedev new .` and `iotedgedev iothub setup`, which will create a new solution and setup your Azure resources in a single command.
> If you want to use your existing IoT Hub and IoT Edge device, you can run `iotedgedev new .`, and update the `.env` file with the IoT Hub connection string and IoT Edge device connection string.
> `iotedgedev init` and `iotedgedev new .` will add a default C# module named `filtermodule` to the solution. To customize this behavior, append the parameters ` --module <module-name> --template <template>`.
`iotedgedev init` will run both `iotedgedev new .` and `iotedgedev iothub setup`, which will create a new solution and setup your Azure resources in a single command.
If you want to use your existing IoT Hub and IoT Edge device, you can run `iotedgedev new .`, and update the `.env` file with the IoT Hub connection string and IoT Edge device connection string.
`iotedgedev init` and `iotedgedev new .` will add a default C# module named `filtermodule` to the solution. To customize this behavior, append the parameters `--module <module-name--template <template>`.
1. **Add modules to IoT Edge solution**
`iotedgedev add <module-name> --template <template>`
> Currently the available template values are `c`, `csharp`, `java`, `nodejs`, `python`, `csharpfunction`. We are working on supporting more templates.
```sh
iotedgedev add <module-name--template <template>
```
Currently the available template values are `c`, `csharp`, `java`, `nodejs`, `python`, `csharpfunction`. We are working on supporting more templates.
1. **Build IoT Edge module images**
`sudo iotedgedev build`
```sh
sudo iotedgedev build
```
You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
* You are on Windows or macOS.
* You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
> You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
> * You are on Windows or macOS.
> * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
1. **Setup the [IoT Edge Simulator]((https://pypi.org/project/iotedgehubdev/).)**
`sudo iotedgedev setup`
```sh
sudo iotedgedev setup
```
> IoT Edge Simulator does not support running Python and C modules yet. You'll need IoT Edge Runtime to run your Python and C modules.
IoT Edge Simulator does not support running Python and C modules yet. You'll need IoT Edge Runtime to run your Python and C modules.
> You can avoid `sudo` if you are on Windows, and running IoT Edge Dev Tool outside Docker container.
You can avoid `sudo` if you are on Windows, and running IoT Edge Dev Tool outside Docker container.
1. **Start the IoT Edge Simulator to run the solution**
`sudo iotedgedev start`
```sh
sudo iotedgedev start
```
> You can also combine setup and start with `sudo iotedgedev start --setup`
You can also combine setup and start with `sudo iotedgedev start --setup`
> You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
> * You are on Windows or macOS.
> * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
* You are on Windows or macOS.
* You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
1. **Monitor messages sent from IoT Edge Simulator to IoT Hub**
`iotedgedev monitor`
```sh
iotedgedev monitor
```
1. **Stop the IoT Edge Simulator**
`sudo iotedgedev stop`
```sh
sudo iotedgedev stop
```
> You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
> * You are on Windows or macOS.
> * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
* You are on Windows or macOS.
* You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
1. **Setup the IoT Edge Runtime**
1. Copy the device connection string from the `DEVICE_CONNECTION_STRING` environment variable in the `.env` file, [Azure Portal](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-register-device-portal#retrieve-the-connection-string), or [Azure CLI](https://docs.microsoft.com/en-us/azure/iot-edge/how-to-register-device-cli#retrieve-the-connection-string).
1. Follow [Edge Device Setup](edge-device-setup) to setup and start the IoT Edge Runtime with the copied device connection string
1. **Push IoT Edge module images**
`sudo iotedgedev push`
```sh
sudo iotedgedev push
```
> You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
> * You are on Windows or macOS.
> * You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
You can avoid `sudo` if you are running IoT Edge Dev Tool outside Docker container, and:
* You are on Windows or macOS.
* You are on Linux, and you have followed the [post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user) to allow running Docker commands without `sudo`.
1. **Deploy modules to IoT Edge device**
`iotedgedev deploy`
> You can also combine push and deploy with `iotedgedev push --deploy`
```sh
iotedgedev deploy
```
You can also combine push and deploy with `iotedgedev push --deploy`
1. **Deploy modules with automatic deployments to IoT Hub**
```sh
iotedgedev iothub deploy
```
> More information on how automatic deployments work can be found here: <https://docs.microsoft.com/en-us/azure/iot-edge/module-deployment-monitoring?view=iotedge-2020-11>
1. **Monitor messages sent from IoT Edge Runtime to IoT Hub**
`iotedgedev monitor`
```sh
iotedgedev monitor
```

Просмотреть файл

@ -251,7 +251,7 @@ main.add_command(deploy)
@iothub.command(
name="deploy",
context_settings=CONTEXT_SETTINGS,
help="Create a deployment in IoT Hub")
help="Create a deployment in IoT Hub. For more information on how automatic deployments work see: https://docs.microsoft.com/en-us/azure/iot-edge/module-deployment-monitoring")
@click.option("--file",
"-f",
"manifest_file",
@ -262,19 +262,23 @@ main.add_command(deploy)
@click.option("--name",
"-n",
required=True,
help="Specify the deployment name")
help="Specify the name of the deployment that will be created in the IoT hub.")
@click.option("--priority",
"-p",
required=True,
help="Specify the deployment priority")
help=("Specify the deployment priority as positive integer. "
"In the event that two or more deployments are targeted at the same device, the deployment with the highest numerical value for Priority will apply."))
@click.option("--target-condition",
"--tc",
"-t",
"target_condition",
default=envvars.get_envvar("IOTHUB_DEPLOYMENT_TARGET_CONDITION"),
show_default=True,
required=False,
help="Specify the deployment target condition")
required=True,
help=("Specify a target condition to determine which devices will be targeted with this deployment. "
"The condition is based on device twin tags or device twin reported properties and should match the expression format. "
"For example, tags.environment='test' and properties.reported.devicemodel='4000x'. "
"This property can be set via this parameter or in the .env under 'IOTHUB_DEPLOYMENT_TARGET_CONDITION'"))
@with_telemetry
def iothub_deploy(manifest_file, name, priority, target_condition):
ensure_azure_cli_iot_ext()