Azure CLI를 성공적으로 설치하는 방법

Azure CLI를 성공적으로 설치하는 방법

Azure CLI를 설치하는 데 문제가 있습니다. 세 가지 방법을 시도했지만 모두 실패했습니다.

처음 두 사람은 출신입니다.Windows에 Azure CLI 설치, 난 노력 했어

  • PowerShell을 사용하여 Azure CLI를 설치하고
  • Azure CLI .msi 파일의 최신 릴리스를 직접 다운로드하여 설치하세요.
  • 제거하고 .msi 파일을 사용하여 다시 설치해 보았습니다.

하지만 모든 경우에 를 입력하면 az다음과 같은 결과가 나타납니다.

az : The term 'az' is not recognized as the name of a cmdlet, function, script file, or operable program.

그런 다음 시도했습니다.Linux에 Azure CLI 설치최후의 수단으로 시도했지만 역시 실패했습니다.

+ 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.

답변1

Windows에서는 Azure CLI를 찾을 수 있습니다.az.cmd여기:
C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin

이 경로는 환경 변수에서 찾을 수 있습니다 Path. 여기에 이미지 설명을 입력하세요

파워셸: $Env:Path

C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin;

msi 파일을 사용하여 Azure CLI를 설치하면 애플리케이션이 설치되고 Path변수에 위치가 추가됩니다.

열려 있는 PowerShell이 ​​있는 경우 Path백그라운드에서 자동으로 새로 고쳐지지 않습니다. PowerShell을 닫고 새 세션을 열어야 합니다. 일반적으로 업데이트된 내용 Path이 로드됩니다. 이 동작은 훨씬 더 많은 응용 프로그램에도 적용됩니다.

따라서 컴퓨터를 다시 시작하는 것이 합리적일 수 있습니다(또는 안전을 원할 경우).

그런데: 다음도 가능합니다.Windows 11에서 환경 변수 새로 고침(재부팅하지 않음)예를 들어 Chocolatey와 함께

관련 정보