Azure PowerShell 서비스 관리 모듈 설치

참고

이 설명서에서 참조하는 cmdlet은 Service Management API를 사용하는 레거시 Azure 리소스를 관리하기 위한 것입니다. Azure Resource Manager 리소스를 관리하는 cmdlet은 Az PowerShell 모듈을 참조하세요.

Azure PowerShell 서비스 관리 모듈은 롤업 모듈입니다. Azure PowerShell 서비스 관리 모듈을 설치하면 서비스 관리 API를 사용하고 해당 cmdlet을 사용할 수 있게 하는 레거시 Azure 리소스를 관리하기 위해 일반적으로 사용할 수 있는 모듈이 다운로드됩니다.

사전 요구 사항

중요

Azure PowerShell Service Management 모듈은 Windows PowerShell에서만 작동합니다. PowerShell 버전 6 이상과 호환되지 않으며 Linux 또는 macOS에서 실행되지 않습니다.

  • PowerShell에서 다음 명령을 실행하여 PowerShell 버전을 확인합니다.

    $PSVersionTable.PSVersion
    
  • Windows PowerShell 5.1로 업데이트

  • PowerShell 실행 정책을 원격 서명됨 또는 덜 제한적인 정책으로 설정

    • PowerShell 실행 정책을 확인합니다.

      Get-ExecutionPolicy -List
      
    • PowerShell 실행 정책을 원격 서명됨으로 설정합니다.

      Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
      

      실행 정책에 대한 자세한 내용은 about_Execution_Policies 참조하세요.

  • Windows PowerShell 5.1용 PowerShellGet 업데이트

설치

Install-Module cmdlet을 사용하여 Azure PowerShell 서비스 관리 모듈을 설치합니다.

Install-Module -Name Azure, Azure.Storage -Repository PSGallery -AllowClobber -Force

Azure PowerShell 서비스 관리 모듈은 Azure PowerShell Resource Manager 모듈과 종속성을 공유합니다. Azure PowerShell Resource Manager 모듈을 설치한 경우 이전 명령과 같이 AllowClobber 매개 변수가 필요합니다. 이렇게 하면 기존 공유 종속성을 업데이트할 수 있습니다. 이 매개 변수가 없으면 모듈 설치가 실패합니다.

Azure PowerShell 서비스 관리 모듈을 설치한 후 모듈을 가져옵니다.

Import-Module -Name Azure

로그인

Azure PowerShell 서비스 관리 모듈을 사용하여 레거시 Azure 리소스 관리를 시작하려면 PowerShell 세션을 시작하고 Add-AzureAccount를 실행하여 Azure에 로그인합니다.

Add-AzureAccount

Azure에 로그인한 후 Azure PowerShell 서비스 관리 모듈은 지정된 세션에 대한 컨텍스트를 만듭니다. 해당 컨텍스트에는 해당 세션 내의 모든 cmdlet에 사용되는 Azure 환경, 계정, 테넌트 및 구독이 포함됩니다.

문제 해결

"버전이 '4.3.0'인 지정된 모듈 'Azure.Storage'가 모듈 디렉터리에서 유효한 모듈 파일을 찾을 수 없어 로드되지 않았습니다."라는 오류가 표시되면 Azure.Storage PowerShell 모듈을 설치해야 합니다.

Install-Module -Name Azure.Storage -Repository PSGallery -AllowClobber -Force

"'Install-Module' 명령이 'PowerShellGet' 모듈에서 발견되었지만 모듈을 로드할 수 없습니다."라는 오류가 표시되면 PowerShell 실행 정책을 원격 서명되거나 덜 제한적으로 설정해야 합니다.

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

참고 항목

Azure PowerShell 서비스 관리 모듈의 명령에 대한 자세한 내용은 cmdlet 참조 설명서를 참조 하세요.