This example illustrates how to deploy a catalog to a customer’s account using PowerShell.

functionDeployCatalog{param([Parameter(Mandatory=$true)][string]$customerId,[Parameter(Mandatory=$true)][string]$siteId,[Parameter(Mandatory=$true)][string]$bearerToken,[Parameter(Mandatory=$true)][string]$jsonBody)$requestUri=[string]::Format("https://catalogs.apps.cloud.com/{0}/{1}/catalogs/deploy",$customerId,$siteId)$headers=@{"Accept"="application/json";"Content-Type"="application/json""Authorization"="CwsAuth bearer=$bearerToken"}$response=Invoke-RestMethod-Uri$requestUri-MethodPOST-Headers$headers-Body$jsonBodyreturn$response}$body=@{"AddCatalog"=@{"Name"="Finance Catalog";}"AddAzureConfiguration"=@{"AzureSubscriptionId"="c38c7a5c-...";"AzureResourceGroup"="FinanceRG";"AzureVNet"="FinanceVnet";"AzureSubnet"="FinanceSubnet"}"AddCatalogDomain"=@{"DomainName"="customer.local";"DomainOu"="";"ServiceAccountName"="admin1"}"AddCatalogResourceLocation"=@{"Name"="Finance Resource Location";"AzureResourceGroup"="FinanceRG";"OrganizationalUnit"=""}"AddCatalogImage"=@{"TemplateId"="ba75cfe9-c08a-4cd6-9ac5-5cbb39a139a7";"CitrixPrepared"=$true}"AddCatalogCapacity"=@{"ComputeWorker"=@{"UsePremiumStorage"=$false;"UseAzureHUB"=$false;"MaxUsersPerVM"="16";"InstanceName"="Standard_D2_v2"}"ScaleSettings"=@{"MinInstances"="1";"MaxInstances"="2";"Weekdays"=@{"Monday"=$true;"Tuesday"=$true;"Wednesday"=$true;"Thursday"=$true;"Friday"=$true;"Saturday"=$false;"Sunday"=$false};"PeakStartTime"="9";"PeakEndTime"="17";"PeakTimeZone"="Eastern Standard Time";"PeakMinInstances"="2";"BufferCapacity"="15"}"SessionTimeout"="15";}"DeploySecrets"=@{"ClientId"="b3175618-...";"ClientSecret"="iEnl1...";"ServiceAccountPassword"="..."}}$customerId="customer1"#Replace with your customerId$siteId="61603f15-cdf9-4c7f-99ff-91636601a795"#Replace with your site ID$bearerToken="ey1.."#See Prerequisites for all API calls section for a sample of how to get your bearer token$response=DeployCatalog$customerId$siteId$bearerToken(ConvertTo-Json-Depth3$body)

This example illustrates how to deploy a catalog to a customer’s account using C#.

publicsealedclassAddCatalogModel{/// <summary>/// Name of the catalog/// </summary> [StringLength(38, MinimumLength = 2)] [Required]publicstringName{get;set;}}publicclassCatalogAzureConfigurationModel{/// <summary>/// ID of the azure subscription the catalog is associated with/// </summary> [Required]publicGuidAzureSubscriptionId{get;set;}/// <summary>/// Name of the resource group where all objects are going to be located in/// </summary> [Required] [StringLength(64, MinimumLength = 1)]publicstringAzureResourceGroup{get;set;}/// <summary>/// Name of the VNET all machines will be connected to/// </summary> [Required] [StringLength(64, MinimumLength = 2)]publicstringAzureVNet{get;set;}/// <summary>/// Address range of the machines in the catalog/// </summary> [Required] [StringLength(80, MinimumLength = 2)]publicstringAzureSubnet{get;set;}}publicclassCatalogDomainModel{/// <summary>/// Domain the VMs will join/// </summary> [Required] [StringLength(63, MinimumLength = 1)]publicstringDomainName{get;set;}/// <summary>/// OU of the domain/// </summary>publicstringDomainOu{get;set;}/// <summary>/// Name of the service account that will be used to join the domain/// </summary> [Required] [StringLength(104, MinimumLength = 1)]publicstringServiceAccountName{get;set;}}publicclassCatalogResourceLocationConfiguration{/// <summary>/// The desired name of the resource location that will be created for the catalog/// </summary> [StringLength(64, MinimumLength = 1)] [Required]publicstringName{get;set;}/// <summary>/// Name of the resource location where to provision the connector VDAs/// </summary> [StringLength(64, MinimumLength = 1)] [Required]publicstringAzureResourceGroup{get;set;}/// <summary>/// Organization Unit associated with computer accounts added for the Resource Location/// </summary>publicstringOrganizationalUnit{get;set;}}publicclassCatalogTemplateImageModel{/// <summary>/// ID of the Template image to configure for the catalog/// </summary> [Required]publicstringTemplateId{get;set;}/// <summary>/// Whether the image was prepared by Citrix, or provided by the customer/// </summary>publicboolCitrixPrepared{get;set;}=false;}publicclassCatalogCapacitySettingsModel{/// <summary>/// Compute settings for the catalog/// </summary>publicCatalogComputeWorkerModelComputeWorker{get;set;}/// <summary>/// Scale settings for the catalog/// </summary>publicCatalogScaleSettingsModelScaleSettings{get;set;}/// <summary>/// Idle timeout for session in the catalog (in minutes)/// </summary>publicintSessionTimeout{get;set;}/// <summary>/// Indicates if the capacity job is currently active/// This should always be set to true/// </summary>publicboolIsActive{get;}}publicclassCatalogComputeWorkerModel{/// <summary>/// Indicates if Premium Storage will be used/// </summary>publicboolUsePremiumStorage{get;set;}/// <summary>/// Indicates if the catalog VMs should be deployed with Azure HUB license/// </summary>publicboolUseAzureHUB{get;set;}/// <summary>/// Number of concurrent users per VM/// </summary>publicintMaxUsersPerVM{get;set;}/// <summary>/// Type of VM to create for VDA machines/// </summary>publicstringInstanceName{get;set;}}publicclassCatalogScaleSettingsModel{/// <summary>/// Minimum number of active VMs for the catalog/// </summary>publicintMinInstances{get;set;}/// <summary>/// Number of VMs that will be provisioned for this catalog/// </summary>publicintMaxInstances{get;set;}/// <summary>/// Days of the week that are included in peek days/// </summary>publicDictionary<string,bool>Weekdays{get;set;}/// <summary>/// Hour of day when peak usage begins/// </summary>publicintPeakStartTime{get;set;}/// <summary>/// Hour of day when peak usage ends/// </summary>publicintPeakEndTime{get;set;}/// <summary>/// Display of the peak usage timezone/// </summary>publicstringPeakTimeZone{get;set;}/// <summary>/// Minimum number of instances that should be running during peak hours/// </summary>publicintPeakMinInstances{get;set;}/// <summary>/// Percentage of buffer capacity/// </summary>publicint?BufferCapacity{get;set;}}publicclassDeploySecretsModel{/// <summary>/// The client id that has administrators permissions to Citrix Cloud/// </summary> [Required]publicstringClientId{get;set;}/// <summary>/// The client secret that has administrators permissions to Citrix cloud/// </summary> [Required]publicstringClientSecret{get;set;}/// <summary>/// Service account password for required in domain joining. This will be stored in a azure vault./// </summary>publicstringServiceAccountPassword{get;set;}}publicclassCatalogConfigDeployModel{/// <summary>/// Step 1 Properties/// </summary>publicAddCatalogModelAddCatalog{get;set;}/// <summary>/// Step 2 Properties/// </summary>publicCatalogAzureConfigurationModelAddAzureConfiguration{get;set;}/// <summary>/// Step 3 Properties/// </summary>publicCatalogDomainModelAddCatalogDomain{get;set;}/// <summary>/// Step 4 Properties/// </summary>publicCatalogResourceLocationConfigurationAddCatalogResourceLocation{get;set;}/// <summary>/// Step 5 Properties/// </summary>publicCatalogTemplateImageModelAddCatalogImage{get;set;}/// <summary>/// Step 6 Properties/// </summary>publicCatalogCapacitySettingsModelAddCatalogCapacity{get;set;}/// <summary>/// Step 7 Properties/// </summary>publicDeploySecretsModelDeploySecrets{get;set;}}