
Ich habe Probleme bei der Installation von Azure CLI. Ich habe drei Methoden ausprobiert, aber alle sind fehlgeschlagen.
Die ersten beiden sind vonInstallieren der Azure CLI unter Windows, Ich habe es versucht
- Installieren Sie die Azure CLI mit PowerShell und
- Laden Sie die neueste Version der MSI-Datei der Azure CLI selbst herunter und installieren Sie sie.
- Ich habe versucht, es zu entfernen und auch mit der MSI-Datei neu zu installieren.
Aber in allen Fällen, wenn ich eingebe az
, bekomme ich
az : The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program.
Dann habe ich versuchtInstallieren der Azure CLI unter Linuxals letzten Ausweg, aber auch das schlug fehl:
+ echo 'deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ bullseye main'
+ apt-get update
Hit:1 http://security.debian.org/debian-security bullseye-security InRelease
Hit:2 http://deb.debian.org/debian bullseye InRelease
Hit:3 http://ftp.debian.org/debian bullseye-backports InRelease
Hit:4 http://deb.debian.org/debian bullseye-updates InRelease
Hit:5 http://ppa.launchpad.net/suntong001/ppa/ubuntu focal InRelease
Get:6 https://packages.microsoft.com/repos/azure-cli bullseye InRelease [10.4 kB]
Err:6 https://packages.microsoft.com/repos/azure-cli bullseye InRelease
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Reading package lists... Done
W: http://security.debian.org/debian-security/dists/bullseye-security/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://deb.debian.org/debian/dists/bullseye/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://ftp.debian.org/debian/dists/bullseye-backports/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://deb.debian.org/debian/dists/bullseye-updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: http://ppa.launchpad.net/suntong001/ppa/ubuntu/dists/focal/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: https://packages.microsoft.com/repos/azure-cli/dists/bullseye/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/microsoft.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: https://packages.microsoft.com/repos/azure-cli bullseye InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
E: The repository 'https://packages.microsoft.com/repos/azure-cli bullseye InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
Antwort1
Unter Windows finden Sie die Azure CLIaz.cmdHier:
C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin
Und dieser Pfad ist in der Umgebungsvariable zu finden Path
:
Power Shell:
$Env:Path
C:\Programme (x86)\Microsoft SDKs\Azure\CLI2\wbin;
Wenn Sie Azure CLI mit einer MSI-Datei installieren, wird die Anwendung installiert und der Speicherort zur Path
Variablen hinzugefügt.
Wenn eine PowerShell geöffnet ist, Path
wird diese nicht automatisch im Hintergrund aktualisiert. Man muss die PowerShell schließen und eine neue Sitzung öffnen. Normalerweise Path
wird dann die aktualisierte Version geladen. Dieses Verhalten gilt auch für viele andere Anwendungen.
Daher kann es sinnvoll sein (oder wenn Sie auf Nummer sicher gehen wollen), Ihren Computer neu zu starten.
Übrigens: Es ist auch möglich,Umgebungsvariablen in Windows 11 aktualisieren (ohne Neustart)mit zB Chocolatey