So you can run Azure CLI commands on a mac by setting the environment variable

export AZURE_CLI_DISABLE_CONNECTION_VERIFICATION=1

This would allow the CLI to ignore the SSL certifcate validity but you are still getting a warning about Unverified HTTPS requests being made. It is not advised to use this method because it disables SSL verification(security is important you know especially in worksplace).

Microsoft does provide a document URL about working with a proxy.

As Azure CLI is python based, you would need to set REQUESTS_CA_BUNDLE environment variable to point to your corporate proxy’s certificate file.

Open Keychain Access on the Mac and look for your the root certificate for your proxy. Export the cert as .pem file.

If you already do not have OpenSSL installed then install it by running

brew install [email protected]

Copy the .pem file to /usr/local/etc/[email protected]/certs

Run this command /usr/local/opt/[email protected]/bin/c_rehash this will scan directories & creates sym link for the root certificate you added.

Now all you need to do is to point the Python requests to the your proxy’s root certificate by setting the environment variable as

export REQUESTS_CA_BUNDLE=/usr/local/etc/[email protected]/certs/your-cert.pem

You may want to set this environment variable permanently by adding it to your profile

echo "export REQUESTS_CA_BUNDLE=/usr/local/etc/[email protected]/certs/your-cert.pem" >> ~/.zshrc

This would now allow you to use Azure CLI & by using your corporate proxy certificate.