1. zure Stack에는 Azure CLI 설치
Azure Stack에는 Azure CLI 2.0 이상 버전이 필요 합니다. Azure CLI 설치는 아래 링크를 참조 랍니다.
https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest
여기서는 Windows 기준으로 설치 합니다.
Install on WindowsYou can install Azure CLI 2.0 with the MSI and use it in the Windows command-line, or you can install the CLI with Install with MSI for the Windows command-lineTo install the CLI on Windows and use it in the Windows command-line, download and run the MSI. Install with apt-get for Bash on Ubuntu on Windows
|
"...download and run the MSI." 에서 MSI 를 클릭해서 다운 받거나 "https://aka.ms/InstallAzureCliWindows" 에서 다운 받아 설치 합니다.
"Install" 버튼을 클릭합니다.
설치가 진행됩니다.
설치가 완료 후 "Finsh" 버튼을 클릭합니다.
설치 완료 후 정상적으로 설치가 되었는 아래 명령어롤 이용해 CMD 에서 버전을 확인 합니다.
정상적으로 Azure CLI 2.0 이상 버전이 걸치 되었습니다.
2. Azure Stack CA root 인증서 설정
인증을 위해 root 인증서를 받아서 Python 경로에 추가 해야 합니다. Azure Stack 설명서(https://docs.microsoft.com/ko-kr/azure/azure-stack/azure-stack-connect-cli)는 조금 다르게 나와 있습니다. 아래 Script 는 MS 이동호 부장님께서 정리 하신 자료를 이용했습니다.
관리자권한 PowerShell 에서 실행 합니다.
$label = "AzureStackSelfSignedRootCert"
Write-Host "Getting certificate from the current user trusted store with subject CN=$label" $root = Get-ChildItem Cert:\CurrentUser\Root | Where-Object Subject -eq "CN=$label" | select -First 1 if (-not $root) { Log-Error "Cerficate with subject CN=$label not found" return }
Write-Host "Exporting certificate" Export-Certificate -Type CERT -FilePath root.cer -Cert $root
Write-Host "Converting certificate to PEM format" certutil -encode root.cer root.pem
Write-Host "Extracting needed information from the cert file"
$md5Hash=(Get-FileHash -Path root.pem -Algorithm MD5).Hash.ToLower() $sha1Hash=(Get-FileHash -Path root.pem -Algorithm SHA1).Hash.ToLower() $sha256Hash=(Get-FileHash -Path root.pem -Algorithm SHA256).Hash.ToLower() $issuerEntry = [string]::Format("# Issuer: {0}", $root.Issuer) $subjectEntry = [string]::Format("# Subject: {0}", $root.Subject) $labelEntry = [string]::Format("# Label: {0}", $label) $serialEntry = [string]::Format("# Serial: {0}", $root.GetSerialNumberString().ToLower()) $md5Entry = [string]::Format("# MD5 Fingerprint: {0}", $md5Hash) $sha1Entry = [string]::Format("# SHA1 Finterprint: {0}", $sha1Hash) $sha256Entry = [string]::Format("# SHA256 Fingerprint: {0}", $sha256Hash) $certText = (Get-Content -Path root.pem -Raw).ToString().Replace("`r`n","`n") $rootCertEntry = "`n" + $issuerEntry + "`n" + $subjectEntry + "`n" + $labelEntry + "`n" + ` $serialEntry + "`n" + $md5Entry + "`n" + $sha1Entry + "`n" + $sha256Entry + "`n" + $certText
Write-Host "Adding the certificate content to Python Cert store"
Add-Content "${env:ProgramFiles(x86)}\Microsoft SDKs\Azure\CLI2\Lib\site-packages\certifi\cacert.pem" $rootCertEntry
Write-Host "Python Cert store was updated for allowing the azure stack CA root certificate" |
3. Azure Stack 환경 등록 및 로그인
아래 Script를 이용해서 Endpoint 환경 등록을 하고 로그인 합니다.
az cloud register -n AzureStackAdmin --endpoint-resource-manager "https://adminmanagement.local.azurestack.external" --suffix-storage-endpoint "local.azurestack.external" --suffix-keyvault-dns ".adminvault.local.azurestack.external"
az cloud set -n AzureStackAdmin az cloud update --profile 2017-03-09-profile az login -u [Azure AD 게정] |
*참고 : PowerShell 에서 안되는 경우가 있습니다. CMD 를 이용해서 로그인 하십시오.
'Microsoft Azure stack' 카테고리의 다른 글
ASDK : Azure Stack에 Items 추가 (0) | 2017.09.13 |
---|---|
ASDK : Azure Marketplace 연동 (0) | 2017.09.12 |
Azure Stack Development kit 설치 - "60.140 - Phase 5 - DeployServices fails" (0) | 2017.09.09 |
ASDK : Azure Stack Develpment Kit 설치 (0) | 2017.09.08 |
Install Visual Studio and Connect to Azure Stack (0) | 2017.09.01 |