Skip to content

Commit 7730d09

Browse files
authored
Remove ARM template to reduce overhead. (Azure#24270)
1 parent d46f18c commit 7730d09

File tree

3 files changed

+9
-145
lines changed

3 files changed

+9
-145
lines changed

sdk/digitaltwins/azure-digitaltwins-core/src/test/resources/prerequisite/prerequisite readme.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ The script outputs [test-resources.bicep](https://github.com/Azure/azure-sdk-for
3030

3131
### Generate the ARM template
3232

33-
The ARM template [test-resources.json](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/digitaltwins/test-resources.json) is generated from the [test-resources.bicep](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/digitaltwins/test-resources.bicep) file by running the following script
33+
The ARM template is generated from the [test-resources.bicep](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/digitaltwins/test-resources.bicep) file by running the following script
3434

3535
- `.\generateArmTemplate.ps1`
3636

sdk/digitaltwins/azure-digitaltwins-core/src/test/resources/prerequisite/setup.ps1

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,17 @@ if ($rgExists -eq "False")
8282
az group create --name $ResourceGroup --location $Region --output none
8383
}
8484

85+
Write-Host "`nGenerating the ARM template using the cli bicep extention."
86+
$bicepFilePath = Join-Path -Path $PSScriptRoot -ChildPath "../../../../../test-resources.bicep";
87+
az bicep build --f $bicepFilePath
88+
8589
Write-Host "`nDeploying resources to $ResourceGroup in $Region`n"
8690

8791
$armTemplateFile = Join-Path -Path $PSScriptRoot -ChildPath "../../../../../test-resources.json";
8892

8993
if (-not (Test-Path $armTemplateFile -PathType leaf))
9094
{
91-
throw "`nARM template was not found. Please make sure you have an ARM template file named test-resources.json in the root of the service directory`n"
95+
throw "`nARM template was not found. Please make sure you have a bicep file called test-resources.bicep in the root of the service directory`n"
9296
}
9397

9498
# Deploy test-resources.json ARM template.
@@ -128,4 +132,7 @@ $protectedBytes = [Security.Cryptography.ProtectedData]::Protect($bytes, $null,
128132
Set-Content $outputFile -Value $protectedBytes -AsByteStream -Force
129133
Write-Host "`nTest environment settings stored into encrypted $outputFile`n"
130134

135+
Write-Host "`nRemoving generated ARM template JSON file."
136+
rm -r $armTemplateFile
137+
131138
Write-Host "Done!"

sdk/digitaltwins/test-resources.json

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)