-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[ARM] az deployment group/sub/mg/tenant validate/create/what-if: Support deployment with Bicep files #16857
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
[ARM] az deployment group/sub/mg/tenant validate/create/what-if: Support deployment with Bicep files #16857
Conversation
|
ARM |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Commenter does not have sufficient privileges for PR 16857 in repo Azure/azure-cli |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
Hi @zhoxing-ms @Juliehzl could you take a look at this PR? We are hoping to get this merged to catch the release for ignite. |
Co-authored-by: Xing Zhou <[email protected]>
|
|
||
| print(f'Successfully installed Bicep CLI to "{installation_path}".') | ||
| except IOError as err: | ||
| raise CLIError(f"Error while attempting to download Bicep CLI: {err}") |
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.
Could you change those CLIError to some more specific error?
Please refer to azure.cli.core.azclierror
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.
Changed them to more specific error types.
Could we add some tests for this feature? |
@zhoxing-ms I would like to hear your thoughts on how to properly test them. I added some e2e tests in e89fc1e, but I had to revert them because I realized that it won't pass CI. Since I'm using a Windows machine, the recording files will contain the binary data of the Bicep CLI exe, which cannot be invoked on Linux and macOS. The other thing that worries me is that with the Bicep CLI binary data significantly increases the size of recording files (60MB+ each), and I feel like I should not commit something that big... |
Co-authored-by: Xing Zhou <[email protected]>
@shenglol OK, how about changing them to live test? How long do these tests take in live mode? |
Changing them to live tests means that recording files won't be generated, right? If yes I'd be happy to do so. The tests takes about about 10 minutes to complete on my machine. |
These record files are too large, and the binary data contained in the record files will be different when recording on different system platforms, right? |
Got it. I'll add back the tests and change them to live tests. |
Co-authored-by: Xing Zhou <[email protected]>
|
/azp run |
|
Azure Pipelines successfully started running 2 pipeline(s). |
|
|
||
| installed_version = _get_bicep_installed_version(installation_path) | ||
| target_version = _extract_semver(release_tag) | ||
| if installed_version and target_version and semver.compare(installed_version, target_version) == 0: |
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.
@shenglol, if bicep has no fancy versioning schema and complies with PEP 440, can semver be replaced by packaging.version? packaging.version is used by az extension (#17667):
azure-cli/src/azure-cli-core/azure/cli/core/extension/__init__.py
Lines 287 to 298 in 22725b3
| def ext_compat_with_cli(azext_metadata): | |
| from azure.cli.core import __version__ as core_version | |
| from packaging.version import parse | |
| is_compatible, min_required, max_required = (True, None, None) | |
| if azext_metadata: | |
| min_required = azext_metadata.get(EXT_METADATA_MINCLICOREVERSION) | |
| max_required = azext_metadata.get(EXT_METADATA_MAXCLICOREVERSION) | |
| parsed_cli_version = parse(core_version) | |
| if min_required and parsed_cli_version < parse(min_required): | |
| is_compatible = False | |
| elif max_required and parsed_cli_version > parse(max_required): | |
| is_compatible = False |
This will help us reduce Azure CLI’s packaging maintenance cost (#26523).
Description
The PR integrates Bicep CLI so that the ARM template deployment commands can deploy Bicep files.
Testing Guide
History Notes
[ARM] az deployment group/sub/mg/tenant validate/create/what-if: Add support for Bicep files
[ARM] az bicep install: New command for installing Bicep CLI
[ARM] az bicep upgrade: New command for upgrading Bicep CLI
[ARM] az bicep build: New command for building Bicep files
[ARM] az bicep version: New command for showing the current installed version of Bicep CLI
[ARM] az bicep list-versions: New command for showing the available Bicep CLI versions
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.