azure,

Configure Azure CLI automatic upgrades

Aug 31, 2021 · 1 min read · Post a comment
Configure Azure CLI automatic upgrades

As part of the Azure CLI series, today we are going to see how we can configure automatic upgrades.

Prerequisites

  • Azure CLI

Manual upgrade

Open a terminal and run the following command:

az upgrade

Automatic upgrade

Step 1. auto-upgrade is disabled by default. Let’s enable it:

az config set auto-upgrade.enable=yes

Step 2. Confirm the upgrade settings:

az config get | jq '."auto-upgrade"'

Example output:

[
  {
    "name": "enable",
    "source": "/Users/devcoops/.azure/config",
    "value": "yes"
  }
]

Step 3. Optionally, if you want to disable the upgrade prompt, run the following command:

az config set auto-upgrade.prompt=no

Step 4. Optionally, if you wanna disable auto-upgrade again:

az config set auto-upgrade.enable=no

Step 5. Confirm the upgrade settings again, by running the command described in Step 2.

Example output:

[
  {
    "name": "enable",
    "source": "/Users/devcoops/.azure/config",
    "value": "no"
  }
]

Conclusion

Although you could still use PowerShell Azure modules, in the CLI world, az CLI is still the powerhouse of the Azure resource management.
Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on telegram.