Share via


az iot du update init

Note

This reference is part of the azure-iot extension for the Azure CLI (version 2.46.0 or higher). The extension will automatically install the first time you run an az iot du update init command. Learn more about extensions.

This command group is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Utility for import manifest initialization.

Commands

Name Description Type Status
az iot du update init v5

Initialize a v5 import manifest with the desired state.

Extension Preview

az iot du update init v5

Preview

Command group 'iot du update init' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Initialize a v5 import manifest with the desired state.

This command supports all attributes of the v5 import manifest. Note that there is positional sensitivity between --step and --file, as well as --file and --related-file. Review examples and parameter descriptions for details on how to fully utilize the operation.

Read more about using quotation marks and escape characters in different shells here: https://aka.ms/aziotcli-json.

az iot du update init v5 --compat
                         --step
                         --update-name
                         --update-provider
                         --update-version
                         [--description]
                         [--file]
                         [--is-deployable {false, true}]
                         [--no-validation {false, true}]
                         [--related-file]

Examples

Initialize a minimum content import manifest. Inline json optimized for `bash`.

az iot du update init v5 --update-provider Microsoft --update-name myAptUpdate --update-version 1.0.0 --description "My minimum update" --compat manufacturer=Contoso model=Vacuum --step handler=microsoft/apt:1 properties='{"installedCriteria": "1.0"}' --file path=/my/apt/manifest/file

Initialize a minimum content import manifest. Inline json optimized for `powershell`.

az iot du update init v5 --update-provider Microsoft --update-name myAptUpdate --update-version 1.0.0 --description "My minimum update" --compat manufacturer=Contoso model=Vacuum --step handler=microsoft/apt:1 properties='{\"installedCriteria\": \"1.0\"}' --file path=/my/apt/manifest/file

Initialize a minimum content import manifest. Inline json optimized for `cmd`.

az iot du update init v5 --update-provider Microsoft --update-name myAptUpdate --update-version 1.0.0 --description "My minimum update" --compat manufacturer=Contoso model=Vacuum --step handler=microsoft/apt:1 properties="{\"installedCriteria\": \"1.0\"}" --file path=/my/apt/manifest/file

Initialize a minimum content import manifest. Use file input for json.

az iot du update init v5 --update-provider Microsoft --update-name myAptUpdate --update-version 1.0.0 --description "My minimum update" --compat manufacturer=Contoso model=Vacuum --step handler=microsoft/apt:1 properties="@/path/to/file" --file path=/my/apt/manifest/file

Initialize a non-deployable leaf update to be referenced in a bundled update. Inline json optimized for `bash`.

az iot du update init v5 --update-provider Microsoft --update-name mySwUpdate --update-version 1.1.0 --compat manufacturer=Contoso model=Microphone --step handler=microsoft/swupdate:1 description="Deploy Update" properties='{"installedCriteria": "1.0"}' --file path=/my/update/image/file1 --file path=/my/update/image/file2 --is-deployable false

Initialize a bundled update referencing a leaf update as well as defining independent steps. Example optimized for `bash` using command continuation to delineate import manifest segments.

az iot du update init v5 \
--update-provider Microsoft --update-name myBundled --update-version 2.0 \
--compat manufacturer=Contoso model=SpaceStation \
--step handler=microsoft/script:1 properties='{"arguments": "--pre"}' description="Pre-install script" \
--file path=/my/update/scripts/preinstall.sh downloadHandler=microsoft/delta:1 \
--related-file path=/my/update/scripts/related_preinstall.json properties='{"microsoft.sourceFileHashAlgorithm": "sha256"}' \
--step updateId.provider=Microsoft updateId.name=SwUpdate updateId.version=1.1 \
--step handler=microsoft/script:1 properties='{"arguments": "--post"}' description="Post-install script" \
--file path=/my/update/scripts/postinstall.sh

Required Parameters

--compat

Space-separated key=value pairs corresponding to properties of a device this update is compatible with. Typically used for defining properties such as manufacturer and model. --compat can be used 1 or more times.

--step

Space-separated key=value pairs corresponding to 'instructions.steps' element properties. The client will determine if a step is an inline or reference step based on the provided key value pairs. If either inline or reference step can be satisfied, the reference step will be prioritized. Usage of --file will be associated with the nearest inline --step entry, deriving the value for 'files'. The following reference step keys are supported: updateId.provider, updateId.name, updateId.version and description. The following inline step keys are supported: handler (ex: 'microsoft/script:1' or 'microsoft/swupdate:1' or 'microsoft/apt:1'), properties (in-line json object the agent will pass to the handler), and description. --step can be used 1 or more times.

--update-name

The update name as a component of updateId.

--update-provider

The update provider as a component of updateId.

--update-version

The update version as a component of updateId.

Optional Parameters

--description

Description for the import manifest.

--file

Space-separated key=value pairs corresponding to 'files' element properties. A --file entry can include the closest --related-file entries if provided. The following keys are supported: path [required] local file path to update file, downloadHandler (ex: 'microsoft/delta:1') handler for utilizing related files to download payload file, properties (in-line json object the agent will pass to the handler). --file can be used 1 or more times.

--is-deployable

Indicates whether the update is independently deployable.

Accepted values: false, true
--no-validation

Disables client-side json schema validation of the import manifest content.

Accepted values: false, true
--related-file

Space-separated key=value pairs corresponding to 'files[*].relatedFiles' element properties. A --related-file entry will be associated to the closest --file entry if it exists. The following keys are supported: path [required] local file path to related update file, properties (in-line json object passed to the download handler). --related-file can be used 1 or more times.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--verbose

Increase logging verbosity. Use --debug for full debug logs.