GitHub Actions - az cli tool usable without azure/CLI action

Copper Contributor

Hi,

 

until now I followed the documentation when executing commands via the Azure CLI tool:

- name: Azure Login
  uses: azure/login@v1
  with:
    creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Azure CLI script
  uses: azure/CLI@v1
  with:
    azcliversion: 2.0.72
    inlineScript: |
      az account show
      az storage -h

...but then I (accidentally) found out that I can also issue "az" commands with a pure "run" action, without using "azure/CLI" (which runs in a container I guess?):

- name: Azure Login
  uses: azure/login@v1
  with:
    creds: ${{ secrets.AZURE_CREDENTIALS }}

# works as well
- name: Azure CLI script
  run: |
    az account show
    az storage -h

So, if it's possible to use simple "run" actions, why bother using "azure/CLI"? The only noticeable difference seems to be that with "azure/CLI" you can specify the version of the Azure CLI tool being used.

 

Many thanks for you answer. Stay safe!

Oliver

1 Reply

Found an answer to this question here: https://github.com/Azure/cli/issues/11

 

Case closed. ;)