Citrix Virtual Apps and Desktops

Connection to Azure Local

Create and manage connections and resources describes the wizards that create a connection. The following information covers details specific to Azure Local environments.

Create a hosting connection

You can create a host connection using:

Use Web Studio

  1. In Web Studio, open Hosting > Add Connection and Resources.
  2. On the Connection page, follow these steps to configure the connection:

    1. Select Create a new connection.
    2. Select Microsoft® Azure™ Arc as the connection type.
    3. Select an Azure environment.
    4. Select a zone. The options are all resource locations you configured.
    5. Select Other tools for creating virtual machines.

      Note:

      Selecting Other tools creates just the hosting connection without a hosting unit.

    6. Click Next.
  3. On the Connection Details page, enter connection details following the guidance in the Wizard. If you use an existing SPN, make sure that the SPN has been granted the contributor role of the subscription. Check Required Azure Local permissionsfor more information.

  4. On the Scopes page, select one or more scopes for this connection.
  5. On the Summary page, check the configuration and click Finish.

Use PowerShell

Header of the script

Make sure that you provide the correct parameter values defined in the header of the script.

$azureSubscription = "" # Azure Subscription ID 

$azureTenantId = "" # Microsoft Entra Tenant ID 

$appClientId = "" # Client ID of an Microsoft Entra application which is grant with sufficient permissions 

$appClientSecret = "" # Client secret of above client ID 

$appClientSecretExpirationDateTimestamp = "" # Client secret expiration date in epoch timestamp format 

$region = "" # Azure region of your Azure Local cluster 

$resourceGroupName = "" # Azure resource group of your Azure Local cluster 

$zoneUid = "" # Zone UID of your resource location 

$hostingConnectionName = "" # Name of the created hosting connection 
<!--NeedCopy-->

Create a hosting connection

asnp citrix* 

[SecureString]$appClientSecretSecureString = $appClientSecret | ConvertTo-SecureString -AsPlainText -Force 

$conn = New-Item -ConnectionType "Custom" -CustomProperties "<CustomProperties xmlns=`"http://schemas.citrix.com/2014/xd/machinecreation`" xmlns:xsi=`"http://www.w3.org/2001/XMLSchema-instance`"><Property xsi:type=`"StringProperty`" Name=`"SubscriptionId`" Value=`"$azureSubscription`" /><Property xsi:type=`"StringProperty`" Name=`"ManagementEndpoint`" Value=`"https://management.azure.com/`" /><Property xsi:type=`"StringProperty`" Name=`"AuthenticationAuthority`" Value=`"https://login.microsoftonline.com/`" /><Property xsi:type=`"StringProperty`" Name=`"TenantId`" Value=`"$azureTenantId`" /></CustomProperties>" -HypervisorAddress @("https://management.azure.com/") -Path @("XDHyp:\Connections\$hostingConnectionName") -Persist -PluginId "AzureArcFactory" -Scope @() -SecurePassword $appClientSecretSecureString -UserName $appClientId -ZoneUid $zoneUid 

New-BrokerHypervisorConnection -HypHypervisorConnectionUid $conn.HypervisorConnectionUid 

Set-HypHypervisorConnectionMetadata -HypervisorConnectionUid $conn.HypervisorConnectionUid -Name Citrix_Orchestration_Hypervisor_Secret_Allow_Edit -Value true 

Set-HypHypervisorConnectionMetadata -HypervisorConnectionUid $conn.HypervisorConnectionUid -Name Citrix_Orchestration_Hypervisor_Secret_Expiration_Date -Value $appClientSecretExpirationDateTimestamp
<!--NeedCopy-->

Create a hosting unit

You can create a hosting unit using:

Create a hosting unit Use Web Studio

  1. In Web Studio, open Hosting > Add Connection and Resources.
  2. On the Connection page:

    • To create a new hosting connection along with a hosting unit, select Create a new connection, then do the following:

      1. Select Create a new connection.
      2. Select Microsoft® Azure™ Arc as the connection type.
      3. Select an Azure environment.
      4. Select a zone. The options are all resource locations you configured.
      5. Select Citrix provisioning tools (Machine Creation Services™ or Citrix Provisioning) for creating virtual machines.
      6. Click Next.
    • To create hosting units from an existing host connection, select Use an existing Connection and then choose the relevant connection.

  3. On the Connection Details page, enter connection details following the guidance in the Wizard. If you use an existing SPN, make sure that the SPN has been granted the contributor role of the subscription.
  4. On the Cluster Selection page, browse resource groups and select the target Azure Local cluster.
  5. On the Storage Selection page, select at least one storage device for each supported data type before you can proceed to the next page in the wizard. For more information about storage selection, see Host storage.
  6. On the Network page, enter a name for the resources. This name appears in Studio to identify the storage and network combination associated with the connection. Select one or more networks that the VMs use.
  7. On the Summary page, check the details and click Finish.

Create a hosting unit using PowerShell

Header of the script

Make sure that you provide the correct parameter values defined in the header of the script.

$resourceGroupName = "" # Azure resource group of your Azure Local cluster 

$clusterName = "" # Name of your Azure Local cluster 

$storagePathName = "" # Storage path in your Azure Local cluster that wants to be used in this hosting unit 

$logicalNetworkName = "" # Logical network in your Azure Local cluster that wants to be used in this hosting unit 

$zoneUid = "" # Zone UID of your resource location 

$hostingConnectionName = "" # Name of the created hosting connection 

$hostingUnitName = "" # Name of the created hosting unit 
<!--NeedCopy-->

Create a hosting unit

asnp citrix* 

$guid = (New-Guid).Guid 

New-HypStorage -StoragePath @("XDHyp:\Connections\$hostingConnectionName\$region.region\$resourceGroupName.resourcegroup\cluster.folder\$clusterName.cluster\storage.folder\$storagePathName.storage") -StorageType "TemporaryStorage" -JobGroup $guid 

New-Item -Path XDHyp:\HostingUnits -Name $hostingUnitName -HypervisorConnectionName $hostingConnectionName -RootPath "XDHyp:\Connections\$hostingConnectionName\$region.region\$resourceGroupName.resourcegroup\cluster.folder\$clusterName.cluster" -NetworkPath "XDHyp:\Connections\$hostingConnectionName\$region.region\$resourceGroupName.resourcegroup\cluster.folder\$clusterName.cluster\network.folder\$logicalNetworkName.network" -StoragePath "XDHyp:\Connections\$hostingConnectionName\$region.region\$resourceGroupName.resourcegroup\cluster.folder\$clusterName.cluster\storage.folder\$storagePathName.storage" -JobGroup $guid 
<!--NeedCopy-->

Required Azure Local permissions

Contributor role has full access for managing all resources and provides the best compatibility going forward although it does include more permissions than needed with the current feature set. This section details the minimum permissions required for Azure Local.

Minimum permissions

Power managing VMs

"Microsoft.Resources/tenants/read", 

"Microsoft.Resources/subscriptions/read", 

"Microsoft.Resources/subscriptions/locations/read", 

"Microsoft.Resources/subscriptions/resourceGroups/read", 

"Microsoft.AzureStackHCI/VirtualMachines/Read", 

"Microsoft.AzureStackHCI/virtualMachineInstances/Read", 

"Microsoft.AzureStackHCI/LogicalNetworks/Read", 

"Microsoft.AzureStackHCI/StorageContainers/Read", 

"Microsoft.AzureStackHCI/Clusters/Read", 

"Microsoft.AzureStackHCI/VirtualMachineInstances/start/action", 

"Microsoft.AzureStackHCI/VirtualMachineInstances/stop/action", 

"Microsoft.AzureStackHCI/VirtualMachineInstances/restart/action" 

"Microsoft.ExtendedLocation/CustomLocations/Read", 

"Microsoft.KubernetesConfiguration/extensions/read", 

"Microsoft.HybridCompute/machines/read" 
<!--NeedCopy-->

Creating, updating, or deleting VMs

"Microsoft.Resources/tenants/read", 

"Microsoft.Resources/subscriptions/read", 

"Microsoft.Resources/subscriptions/locations/read", 

"Microsoft.Resources/subscriptions/resourceGroups/read", 

"Microsoft.Resources/subscriptions/resourceGroups/write", 

"Microsoft.Resources/subscriptions/resourceGroups/delete", 

"Microsoft.HybridCompute/machines/read", 

"Microsoft.HybridCompute/machines/write", 

"Microsoft.HybridCompute/machines/delete", 

"Microsoft.AzureStackHCI/Clusters/Read", 

"Microsoft.AzureStackHCI/VirtualMachines/Read", 

"Microsoft.AzureStackHCI/VirtualMachines/Write", 

"Microsoft.AzureStackHCI/VirtualMachines/Delete", 

"Microsoft.AzureStackHCI/virtualMachineInstances/Read", 

"Microsoft.AzureStackHCI/virtualMachineInstances/Write", 

"Microsoft.AzureStackHCI/virtualMachineInstances/Delete", 

"Microsoft.AzureStackHCI/VirtualMachineInstances/start/action", 

"Microsoft.AzureStackHCI/VirtualMachineInstances/stop/action", 

"Microsoft.AzureStackHCI/VirtualMachineInstances/restart/action", 

"Microsoft.AzureStackHCI/LogicalNetworks/Read", 

"Microsoft.AzureStackHCI/LogicalNetworks/join/action", 

"Microsoft.AzureStackHCI/StorageContainers/Read", 

"Microsoft.AzureStackHCI/StorageContainers/deploy/action", 

"Microsoft.AzureStackHCI/GalleryImages/Read", 

"Microsoft.AzureStackHCI/GalleryImages/Write", 

"Microsoft.AzureStackHCI/GalleryImages/Delete", 

"Microsoft.AzureStackHCI/GalleryImages/deploy/action", 

"Microsoft.AzureStackHCI/NetworkInterfaces/Read", 

"Microsoft.AzureStackHCI/NetworkInterfaces/Write", 

"Microsoft.AzureStackHCI/NetworkInterfaces/Delete", 

"Microsoft.AzureStackHCI/VirtualHardDisks/Read", 

"Microsoft.AzureStackHCI/VirtualHardDisks/Write", 

"Microsoft.AzureStackHCI/VirtualHardDisks/Delete", 

"Microsoft.AzureStackHCI/VirtualHardDisks/upload/action", 

"Microsoft.AzureStackHCI/marketplaceGalleryImages/deploy/action", 

"Microsoft.ExtendedLocation/CustomLocations/Read", 

"Microsoft.ExtendedLocation/customLocations/deploy/action", 

"Microsoft.KubernetesConfiguration/extensions/read", 

"Microsoft.Compute/disks/read", 

"Microsoft.Compute/disks/write", 

"Microsoft.Compute/disks/delete", 

"Microsoft.Compute/disks/beginGetAccess/action", 

"Microsoft.Compute/disks/endGetAccess/action", 

"Microsoft.Compute/snapshots/read", 

"Microsoft.Compute/snapshots/write", 

"Microsoft.Compute/snapshots/delete", 

"Microsoft.Compute/snapshots/beginGetAccess/action", 

"Microsoft.Compute/snapshots/endGetAccess/action"
<!--NeedCopy-->

Where to go next

More information

Connection to Azure Local