AVD CLI Reference
This page describes reference documentation of the avdcli
tool.
A more general guide on how to build images using the avdcli
can be found in other parts of this chapter.
avdcli image new
Create the folder structure and template files for a new image layer. You can use this command any time you want to start a new image layer. It will create a new folder and a default folder structure.
You must specify the -o
flag to point to the path in which you want to create a new image layer.
For example, to create a new image layer python
, you can call the command avdcli image new -o images/python
.
This assumes that you want to create the new image layer in the folder ./images/python
relative to your current working directory.
avdcli image package
To build an image, you first need to build an “Image Package”. An Image Package combines all the layers, resources and configuration that is required to build the image.
To build the Image Package, you need to decide which layers you want to include in the final image.
You can specify the path to each layer you want to include, by setting one or multiple -l(ayer)
flags.
These layers are then combined into a single Image Package and written to the output folder (./out
by default).
The output folder is configured using the -o(utput)
flag.
--overwrite
if a frequently used parameter to this command during debugging.
It will overwrite the output directory instead of returning an error.
You can use the --dry-run
flag to check the validity of the command and the layers,
but not write the package to disk.
Each -l(ayer)
flag must point to a directory of a valid layer.
The file and folder structure of a layer is described in the layer section of this chapter.
By default, avdcli will download the latest deployment template published by Schoolyear.
If you want to use your own deployment template, you can overwrite using the --deployment-template
(short: -dt
) flag.
This flag can point to a .json(5)
file path or http(s) URL.
If you point to a URL, this must be a publicly available URL.
avdcli package deploy
This command will take an Image Package and use it to build a disk image in your Azure tenant. First, it will resolve any parameter left unresolved in the Image Package. Secondly, it will upload the resources in the Image Package to a storage account that you configure. Finally, it will create a Custom Image Template and start the build process.
This command depends on you being logged into Azure using the azurecli
.
Make sure you have the Azure CLI installed and that you are logged in.
Example:
This command will create a Custom Image Template named “office365” in the imagebuilding
resource group
in your Azure subscription ([[subscriptionid]]
).
It will use the https://imageresources.blob.core.windows.net/resources
storage account to upload the resources to
that are needed during the image building process.
It will also start the build process of the image (--start
) and wait for that process to complete (--wait
).
Note that this build process may take hours. --wait
is commonly only used in automated pipelines.
Other flags:
--timeout
: Set after how much time the command should time out. Especially useful in combination with--wait
(default: 0s). Valid time units are “ns”, “us” (or “µs”), “ms”, “s”, “m”, “h”. You can combine these units. For example, “1h30m”. See this documentation for more information.--package
: The path to the Image Package (default:./out
).--azure-tenant-id
: Overwrite the default Azure Tenant ID. By default, avdcli uses the default tenant id of your locally logged inazurecli
. If your locally logged in account inazurecli
has access to multiple tenants, you can specify the one you want to use, using this flag.--resolve-interactively
: Prompt for any unresolved parameters. Defaults to true.--env
: Specify one or multiple paths to dot-env files in which parameters are configured. To specify multiple, you can set the flag multiple times. Defaults to.env
,.env.local
.
Templating
There are a few special placeholders that allow dynamic behavior during package deployment.
Match | Resolved how | Use-Case |
---|---|---|
[[[param:*]]] | resolved from either .env files or prompted during package deployment. | Parameters that should be configurable at the time of image building |
[[[props:*]]] | resolved from the placeholderProperties property in the properties.json file in the image package. | Properties that can be configured by other layers. |
[[[builtin:sessionHostProxyWhitelist]]] | search-and-replaced in the deployment_template.json with a comma-separated list of keys of the whitelistedHosts property in the properties.json file in the image package. | Configure HTTP(S) hosts that should be reachable during the exam. E.g., for license servers |
avdcli update
Using this command, you can update your local installation of avdcli
to the latest version.
This command will prompt before downloading and installing a new version.
If you want to skip this prompt, you can pass the -y(es)
flag.
avdcli help
This command will give you more information on the usage of each command.
For example, to get more information on the avdcli image new
command,
you can write avdcli image help new
or just avdcli image new -h
.
avdcli --version
Get the current version of the avdcli tool. This may be useful when submitting bug reports.