Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit f98ebaf

Browse filesBrowse files
feat: support azurerm v4 (Azure#278)
# Pull Request ## Description azurerm v4 requires ARM_SUBSCRIPTION_ID env var to be set ## License By submitting this pull request, I confirm that my contribution is made under the terms of the projects associated license.
1 parent d70001f commit f98ebaf
Copy full SHA for f98ebaf

File tree

1 file changed

+12
-0
lines changed
Filter options

1 file changed

+12
-0
lines changed

‎src/ALZ/Private/Deploy-Accelerator-Helpers/Invoke-Terraform.ps1

Copy file name to clipboardExpand all lines: src/ALZ/Private/Deploy-Accelerator-Helpers/Invoke-Terraform.ps1
+12Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ function Invoke-Terraform {
2424
)
2525

2626
if ($PSCmdlet.ShouldProcess("Apply Terraform", "modify")) {
27+
# Check and Set Subscription ID
28+
if($null -eq $env:ARM_SUBSCRIPTION_ID -or $env:ARM_SUBSCRIPTION_ID -eq "") {
29+
Write-Verbose "Setting environment variable ARM_SUBSCRIPTION_ID"
30+
$subscriptionId = $(az account show --query id -o tsv)
31+
if($null -eq $subscriptionId -or $subscriptionId -eq "") {
32+
Write-Error "Subscription ID not found. Please ensure you are logged in to Azure and have selected a subscription. Use 'az account show' to check."
33+
return
34+
}
35+
$env:ARM_SUBSCRIPTION_ID = $subscriptionId
36+
Write-Verbose "Environment variable ARM_SUBSCRIPTION_ID set to $subscriptionId"
37+
}
38+
2739
terraform -chdir="$moduleFolderPath" init
2840
$action = "apply"
2941
if($destroy) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.