the following script assumes that you have the az command installed on your mac. if you have installed it using homebrew then it copies the auto-completion file to the location /opt/homebrew/etc/bash_completion.d/az already. all we have to do is to make it auto load on zsh startup. copy and paste the following command to do it. restart your zsh (cmd+q) after entering this command.
az_comp="$(brew --prefix)/etc/bash_completion.d/az"
[[ -f "$az_comp" ]] && printf '\n# azure cli auto completion\nautoload -U +X bashcompinit && bashcompinit\nsource "%s"\n' "$az_comp" >> ~/.zshrc || echo 'autocomplete file not found'