@@ -63,6 +63,10 @@ param (
6363 [ValidateSet (' AzureCloud' , ' AzureUSGovernment' , ' AzureChinaCloud' , ' Dogfood' )]
6464 [string ] $Environment = ' AzureCloud' ,
6565
66+ [Parameter ()]
67+ [ValidateSet (' test' , ' perf' )]
68+ [string ] $ResourceType = ' test' ,
69+
6670 [Parameter ()]
6771 [hashtable ] $ArmTemplateParameters ,
6872
@@ -223,7 +227,7 @@ function BuildBicepFile([System.IO.FileSystemInfo] $file)
223227 }
224228
225229 $tmp = $env: TEMP ? $env: TEMP : [System.IO.Path ]::GetTempPath()
226- $templateFilePath = Join-Path $tmp " test -resources.$ ( New-Guid ) .compiled.json"
230+ $templateFilePath = Join-Path $tmp " $ResourceType -resources.$ ( New-Guid ) .compiled.json"
227231
228232 # Az can deploy bicep files natively, but by compiling here it becomes easier to parse the
229233 # outputted json for mismatched parameter declarations.
@@ -349,7 +353,7 @@ try {
349353 $root = [System.IO.Path ]::Combine($repositoryRoot , " sdk" , $ServiceDirectory ) | Resolve-Path
350354 $templateFiles = @ ()
351355
352- ' test -resources.json' , ' test -resources.bicep' | ForEach-Object {
356+ " $ResourceType -resources.json" , " $ResourceType -resources.bicep" | ForEach-Object {
353357 Write-Verbose " Checking for '$_ ' files under '$root '"
354358 Get-ChildItem - Path $root - Filter " $_ " - Recurse | ForEach-Object {
355359 Write-Verbose " Found template '$ ( $_.FullName ) '"
@@ -586,9 +590,9 @@ try {
586590 # Service principals in the Microsoft AAD tenant must end with an @microsoft.com domain; those in other tenants
587591 # are not permitted to do so. Format the non-MS name so there's an assocation with the Azure SDK.
588592 if ($TenantId -eq ' 72f988bf-86f1-41af-91ab-2d7cd011db47' ) {
589- $displayName = " test -resources-$ ( $baseName ) $suffix .microsoft.com"
593+ $displayName = " $ResourceType -resources-$ ( $baseName ) $suffix .microsoft.com"
590594 } else {
591- $displayName = " $ ( $baseName ) $suffix .test -resources.azure.sdk"
595+ $displayName = " $ ( $baseName ) $suffix .$ResourceType -resources.azure.sdk"
592596 }
593597
594598 $servicePrincipalWrapper = NewServicePrincipalWrapper - subscription $SubscriptionId - resourceGroup $ResourceGroupName - displayName $DisplayName
@@ -705,7 +709,7 @@ try {
705709 }
706710 }
707711
708- $preDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path - ChildPath ' test -resources-pre.ps1'
712+ $preDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path - ChildPath " $ResourceType -resources-pre.ps1"
709713 if (Test-Path $preDeploymentScript ) {
710714 Log " Invoking pre-deployment script '$preDeploymentScript '"
711715 & $preDeploymentScript - ResourceGroupName $ResourceGroupName @PSBoundParameters
@@ -745,7 +749,7 @@ try {
745749
746750 $deploymentOutputs = SetDeploymentOutputs $serviceName $context $deployment $templateFile
747751
748- $postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path - ChildPath ' test -resources-post.ps1'
752+ $postDeploymentScript = $templateFile.originalFilePath | Split-Path | Join-Path - ChildPath " $ResourceType -resources-post.ps1"
749753 if (Test-Path $postDeploymentScript ) {
750754 Log " Invoking post-deployment script '$postDeploymentScript '"
751755 & $postDeploymentScript - ResourceGroupName $ResourceGroupName - DeploymentOutputs $deploymentOutputs @PSBoundParameters
0 commit comments