Azure/Azure Administrator

[Azure Administrator] Azure PowerShell Install - Windows

coxfactor-Tech 2024. 11. 12. 10:54

"Azure PowerShell"은 Windows, Linux, MacOS에서 모두 실행할 수 있으며, PowerShell 코드를 통해 Azure 리소스를 관리, 배포, 삭제하는 데 사용할 수 있습니다. 특히 대규모 리소스를 배포하거나 자동화가 필요한 경우 매우 유용합니다.

Azure CLI와 Azure PowerShell은 Visual Studio Code, GitHub, Azure DevOps, Azure Automation 등과 연동하여 다양한 방식으로 Azure 리소스를 관리하고 접근할 수 있는 유연성을 제공합니다.

 

 

 

Az PowerShell 모듈에 권장되는 설치 방법 및 PowerShell 버전

PowerShell 갤러리에서 설치 -링크-
PowerShell 버전 7 이상과 함께 사용하세요 -Githud-

# powershell 로 powershell 7 install v7.3.6
Invoke-WebRequest -Uri "https://github.com/PowerShell/PowerShell/releases/download/v7.3.6/PowerShell-7.3.6-win-x64.msi" -OutFile "$env:TEMP\PowerShell-7.3.6-win-x64.msi"
Start-Process -FilePath "$env:TEMP\PowerShell-7.3.6-win-x64.msi" -ArgumentList "/quiet" -Wait

 

# Az Powershell 모듈을 설치합니다.
Install-Module -Name Az -Repository PSGallery -Force

 

 

# Az Powershell 모듈을 업데이트 합니다. 
Update-Module -Name Az -Force

 

* 왠만하면 Tenantid, Subscription 을 작성해주세요... 다른 고객사에게 배포하지말고..

# Azure Login 
Connect-AzAccount '
-TenantId "작성해라" '
-Subscription "작성해라"

 

ex) 리소스 그룹 삭제, 검색, 생성 

# 리소스 그룹 생성
New-AzResourceGroup -ResourcegroupName "TEST-NAME" -Location "???????"

# 리소스 그룹 검색
Get-AzResourceGroup -ResourceGroupName "TEST-NAME"

# 리소스 그룹 삭제 
Remove-AzResourceGroup -ResourceGroupName "TEST-NAME"

 

위 내용처럼 나중에는 Code 로 대량 배포, 자동화 적용, 리소스 관리, 모니터링 등 다양 내용을 다루게 됩니다. 

 

(내가 Powershell code 를 먼저 안알려주는 이유 프로젝트 지원 나갔더니 클릭질 두번으로 끝날걸 Powershell 시간 끌고 있음... 아놔 이게 무슨 Bicep, Terraform 이냐? 어떤 새끼들이 code 관리가 아놔 ??... 시간날때 Json, Powershell 정리는 별도로 하고 Portal 이 빠르면 Portal 써라... 어디서 쿠세를 배워서는....엔지니어 간지 ?!???!??  )

 

- 다음에는 Vscode 에 Azure PowerShell, Azure CLI 활용 환경 구성 ~