Azure Desktop Virtualization Workspace

This page shows how to write Terraform and Azure Resource Manager for Desktop Virtualization Workspace and write them securely.

azurerm_virtual_desktop_workspace (Terraform)

The Workspace in Desktop Virtualization can be configured in Terraform with the resource name azurerm_virtual_desktop_workspace. The following sections describe 10 examples of how to use the resource and its parameters.

Example Usage from GitHub

workspace.tf#L6
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = var.workspace.name
  location            = azurerm_resource_group.workspace.location
  resource_group_name = azurerm_resource_group.workspace.name
}
main.tf#L14
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = var.workspace
  location            = var.region
  resource_group_name = azurerm_resource_group.default.name

  friendly_name = var.workspacefriendlyname
WPs.tf#L2
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = var.workspace
  location            = var.region
  resource_group_name = var.rgname
  friendly_name       = var.workspacefriendlyname
  description         = var.workspacedesc
windows-workspace.tf#L1
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = "workspace"
  location                     = azurerm_resource_group.arg.location
  resource_group_name         = azurerm_resource_group.arg.name
  friendly_name = "Bastion Desktop"
  description   = "A description of my workspace"
azure-rdp.tf#L27
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = "workspace"
  location            = azurerm_resource_group.example.location
  resource_group_name = azurerm_resource_group.example.name
}

wvd.tf#L2
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = var.wkspacename
  location            = var.location
  resource_group_name = azurerm_resource_group.wvdwks.name

  friendly_name = var.wkspacename
virtual_desktop_workspace.tf#L11
resource "azurerm_virtual_desktop_workspace" "wvdws" {
  name                = azurecaf_name.wvdws.result
  location            = var.location
  resource_group_name = var.resource_group_name

  friendly_name = try(var.settings.friendly_name, null)
Hostpool.tf#L1
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = var.wkspacename
  location            = var.location
  resource_group_name = var.resourcename

  friendly_name = var.wkspacename
virtual_desktop_workspace.tf#L11
resource "azurerm_virtual_desktop_workspace" "wvdws" {
  name                = azurecaf_name.wvdws.result
  location            = var.location
  resource_group_name = var.resource_group_name

  friendly_name = try(var.settings.friendly_name, null)
wvd-workspace.tf#L3
resource "azurerm_virtual_desktop_workspace" "workspace" {
  name                = var.wkspace-name
  location            = azurerm_resource_group.wvdrg.location
  resource_group_name = azurerm_resource_group.wvdrg.name

  friendly_name = var.wkspace-name

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Virtual Desktop Workspace.

Microsoft.DesktopVirtualization/workspaces (Azure Resource Manager)

The workspaces in Microsoft.DesktopVirtualization can be configured in Azure Resource Manager with the resource name Microsoft.DesktopVirtualization/workspaces. The following sections describe how to use the resource and its parameters.

Example Usage from GitHub

new-workspace.json#L39
            "type": "Microsoft.DesktopVirtualization/workspaces",
            "location": "[parameters('location')]",
            "tags": "[parameters('tags')]",
            "properties": {
                "friendlyName": "[parameters('workspaceName')]",
                "description": "[parameters('workspaceDescription')]",
new-workspace.json#L39
            "type": "Microsoft.DesktopVirtualization/workspaces",
            "location": "[parameters('location')]",
            "tags": "[parameters('tags')]",
            "properties": {
                "friendlyName": "[parameters('workspaceName')]",
                "description": "[parameters('workspaceDescription')]",

Parameters

  • apiVersion required - string
  • identity optional
      • type optional - string

        The identity type.

  • kind optional - string

    Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value.

  • location optional - string

    The geo-location where the resource lives

  • managedBy optional - string

    The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource.

  • name required - string

    The name of the workspace

  • plan optional
      • name required - string

        A user defined name of the 3rd Party Artifact that is being procured.

      • product required - string

        The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding.

      • promotionCode optional - string

        A publisher provided promotion code as provisioned in Data Market for the said product/artifact.

      • publisher required - string

        The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic

      • version optional - string

        The version of the desired product/artifact.

  • properties required
      • applicationGroupReferences optional - array

        List of applicationGroup resource Ids.

      • description optional - string

        Description of Workspace.

      • friendlyName optional - string

        Friendly name of Workspace.

  • sku optional
      • capacity optional - integer

        If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted.

      • family optional - string

        If the service has different generations of hardware, for the same SKU, then that can be captured here.

      • name required - string

        The name of the SKU. Ex - P3. It is typically a letter+number code

      • size optional - string

        The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code.

      • tier optional - string

        This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT.

  • tags optional - string

    Resource tags.

  • type required - string

Frequently asked questions

What is Azure Desktop Virtualization Workspace?

Azure Desktop Virtualization Workspace is a resource for Desktop Virtualization of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Desktop Virtualization Workspace?

For Terraform, the yaegashi/wvd-terraform, deanl1982/TF-Create-AVDHP-Using-Vars and diogofrj/Hashicorp source code examples are useful. See the Terraform Example section for further details.

For Azure Resource Manager, the mariuszdotnet/azure-image-builder-wvd and tylerd/azure-wvd-template-spec source code examples are useful. See the Azure Resource Manager Example section for further details.