what are the benefits on using azure/CLI action over standard run command
Closed this issue · 2 comments
xiang-zhu-pr commented
Hello,
Except for azcliversion
in azure/CLI that I can specify the version to use, what are the other benefits of cli over - run:
step, as I find that I can also run az
command inside - run:
step, and I write less code than azure/cli
action.
MoChilia commented
Hi @xiang-zhu-pr,
The primary benefit of using the Azure/CLI action over the standard '- run' step with 'az' commands lies in its containerized environment. When you use the Azure/CLI action, it runs 'az' commands within a Docker container. This provides several advantages:
- It offers a separated operating environment, ensuring that your workflow runs consistently and independently of the runner's configuration. This isolation minimizes the risk of conflicts with different versions of 'az cli' that you may need to use within the same runner, as well as potential clashes with installed tools and dependencies.
- As you mentioned, it allows you to easily manage and switch between different versions of 'az cli.' This flexibility ensures that your scripts remain compatible with your desired 'az cli' version, providing adaptability to changing project requirements.
- Besides, some self-hosted runners may not have 'az cli' pre-installed, the Azure/CLI action eliminates the need for complex installation steps. You can conveniently execute 'az' commands within the Azure/CLI action without the hassle of manual setup.
xiang-zhu-pr commented
thx a lot