-
Notifications
You must be signed in to change notification settings - Fork 164
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bicep deployment fix for parameter file updates (#733)
* initial commit * Update Strings Co-authored-by: Jesper Fajers <jesper@fajers.se>
- Loading branch information
1 parent
124623c
commit 1755d64
Showing
4 changed files
with
40 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
function ConvertFrom-AzOpsBicepTemplate { | ||
<# | ||
.SYNOPSIS | ||
Transpiles bicep template to Azure Resource Manager (ARM) template. | ||
The json file will be created in the same folder as the bicep file. | ||
.PARAMETER BicepTemplatePath | ||
BicepTemplatePath | ||
#> | ||
|
||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[string] | ||
$BicepTemplatePath | ||
) | ||
|
||
begin { | ||
# Assert bicep binaries | ||
Assert-AzOpsBicepDependency -Cmdlet $PSCmdlet | ||
} | ||
process { | ||
# Convert bicep template | ||
$transpiledTemplatePath = $BicepTemplatePath -replace '\.bicep', '.json' | ||
Write-PSFMessage -Level Verbose -String 'ConvertFrom-AzOpsBicepTemplate.Resolve.ConvertBicepTemplate' -StringValues $BicepTemplatePath, $transpiledTemplatePath | ||
Invoke-AzOpsNativeCommand -ScriptBlock { bicep build $bicepTemplatePath --outfile $transpiledTemplatePath } | ||
# Return transpiled ARM json path | ||
return $transpiledTemplatePath | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters