-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support building and deploying bicep templates #1767
Conversation
e1965bb
to
a23ef50
Compare
The following pipelines have been queued for testing: |
The following pipelines have been queued for testing: |
d3dcf8a
to
7114bd9
Compare
The following pipelines have been queued for testing: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments/suggestions but otherwise looks good once you finish your testing.
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: |
1db5bbf
to
db1ef44
Compare
The following pipelines have been queued for testing: |
The following pipelines have been queued for testing: |
@@ -119,6 +119,26 @@ function MergeHashes([hashtable] $source, [psvariable] $dest) { | |||
} | |||
} | |||
|
|||
function BuildBicepFile([System.IO.FileSystemInfo] $file) { | |||
if (!(Get-Command bicep -ErrorAction Ignore)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is an appropriate check. According to https://docs.microsoft.com/en-us/azure/azure-resource-manager/bicep/deploy-powershell, Az 5.6.0 and newer support bicep. Why not just check if Az is that version or newer and let the cmdlets do their job?
if (!(Get-Module -FullyQualifiedName @{ModuleName='Az'; ModuleVersion='5.6.0'} -ListAvailable)) {
throw 'No'
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This way, too, you don't introduce yet another dependency beyond the cmdlets.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We decided to call the tool directly because the rest of the deployment script depends on having a arm template json file for things like parsing parameters, etc, so we decided to call bicep build up front and keep the rest of the script the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding some context Wes' comment: while az bicep build
is a supported command for the az
cli, there is no equivalent bicep build
command to compile to ARM templates in the Az
cmdlet (not yet at least).
This check is really intended for local usage of New-TestResources.ps1
only, since the azure pipelines images include the Bicep command in the default image (except for MacOS, as I discovered today, so this is a separate problem that needs solving).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, for future context re arm template json: it's not just to keep the rest of the script the same, but to avoid having to write custom parsing for bicep file parameters.
Testing out an existing non-bicep live test: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=987175&view=results |
Tests ^^ are passing for normal usage. It looks like bicep was added to MacOS today (https://github.com/actions/virtual-environments/blob/e8381d7db3a011a744a9d76eebb6e044327cfdae/images/macos/provision/core/bicep.sh), so by the time anyone actually starts using bicep templates, I expect our MacOS agents to have caught up. |
Hello @azure-sdk! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
/check-enforcer evaluate |
This adds support to our common ARM deployment script to compile and deploy Azure bicep files.
Resolves #1712