Hi all,
Welcome to another blog post about AVD in combination with Terraform. Cost saving is very important in Azure and this is no different with AVD. Remote apps can help save costs because more users can work on the same session host. This is of course because remote apps don’t consume the same amount of resources then a published desktop.
In this blog post I’ll show you how to deploy remote apps using Terraform. In this example the remote app group already exists so we need to import it with a data block.
data "azurerm_virtual_desktop_application_group" "remoteapps" {
provider = azurerm.hub
name = "vdpool-prd-jvn-avd-remoteapps"
resource_group_name = "rg-prd-jvn-avd-backplane-01"
}
Now it’s time to deploy some remote apps. In this example I’ll deploy a commonly used app like NotePad++. Really important for making the code work is to change the path where the application is installed. You need to add an extra backslash or \ in the path and icon path, otherwise it won’t work.
resource "azurerm_virtual_desktop_application" "notepadplusplus" {
name = "NotepadPlusPlus"
application_group_id = data.azurerm_virtual_desktop_application_group.remoteapps.id
friendly_name = "NotepadPlusPlus"
description = "NotepadPlusPlus"
path = "C:\\Program Files\\Notepad++\\notepad++.exe"
command_line_argument_policy = "DoNotAllow"
command_line_arguments = "--incognito"
show_in_portal = true
icon_path = "C:\\Program Files\\Notepad++\\notepad++.exe"
icon_index = 0
}
I did the same for Outlook and Adobe Reader.
When opening the new Windows app the end-user will find the remote apps in the Apps tab.
There you go, an easy way to publish AVD remote apps with Terraform. As always the entire code that I’ve used can be found on my Github.
Feel free to leave a comment in case you have any questions
Author
-
Johan Vanneuville is a Microsoft MVP for Microsoft Enterprise Mobility from Belgium and he is one of the first expert contributors in this community. Make sure to follow him as he guides us in the world of Azure Virtual Desktop, Infrastructure-as-Code and Terraform!
View all posts