Skip to content

Commit

Permalink
Remove ARM template to reduce overhead. (Azure#24270)
Browse files Browse the repository at this point in the history
  • Loading branch information
azabbasi authored Sep 22, 2021
1 parent d46f18c commit 7730d09
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ The script outputs [test-resources.bicep](https://github.com/Azure/azure-sdk-for

### Generate the ARM template

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
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

- `.\generateArmTemplate.ps1`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,17 @@ if ($rgExists -eq "False")
az group create --name $ResourceGroup --location $Region --output none
}

Write-Host "`nGenerating the ARM template using the cli bicep extention."
$bicepFilePath = Join-Path -Path $PSScriptRoot -ChildPath "../../../../../test-resources.bicep";
az bicep build --f $bicepFilePath

Write-Host "`nDeploying resources to $ResourceGroup in $Region`n"

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

if (-not (Test-Path $armTemplateFile -PathType leaf))
{
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"
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"
}

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

Write-Host "`nRemoving generated ARM template JSON file."
rm -r $armTemplateFile

Write-Host "Done!"
143 changes: 0 additions & 143 deletions sdk/digitaltwins/test-resources.json

This file was deleted.

0 comments on commit 7730d09

Please sign in to comment.