Azure에 ASDK 등록

Azure에 ASDK(Azure Stack Development Kit) 설치를 등록하여 Azure에서 마켓플레이스 항목을 다운로드하고 Microsoft에 다시 보고하는 상거래 데이터를 설정할 수 있습니다. 마켓플레이스 배포를 포함하여 전체 Azure Stack Hub 기능을 지원하려면 등록이 필요합니다. 마켓플레이스 배포 및 사용 현황 보고와 같은 중요한 Azure Stack Hub 기능을 테스트하려면 등록이 필요합니다. Azure Stack Hub를 등록하면 사용량이 Azure 상거래에 보고됩니다. 등록에 사용한 구독에서 볼 수 있습니다. 그러나 ASDK 사용자는 보고하는 사용량에 대해 요금이 청구되지 않습니다.

ASDK를 등록하지 않으면 ASDK를 등록하도록 권고하는 활성화 필수 경고 경고가 표시될 수 있습니다. 이는 정상적인 동작입니다.

사전 요구 사항

이러한 지침을 사용하여 AZURE에 ASDK를 등록하기 전에 배포 후 구성 문서에 설명된 대로 Azure Stack Hub PowerShell을 설치하고 Azure Stack Hub 도구를 다운로드했는지 확인합니다.

또한 Azure에 ASDK를 등록하는 데 사용되는 컴퓨터에서 PowerShell 언어 모드를 FullLanguage 로 설정해야 합니다. 현재 언어 모드가 전체로 설정되어 있는지 확인하려면 관리자 권한 PowerShell 창을 열고 다음 PowerShell 명령을 실행합니다.

$ExecutionContext.SessionState.LanguageMode

출력이 FullLanguage를 반환하는지 확인합니다. 다른 언어 모드가 반환되면 계속하기 전에 다른 컴퓨터에서 등록을 실행하거나 언어 모드를 FullLanguage 로 설정해야 합니다.

등록에 사용되는 Microsoft Entra 계정은 Azure 구독에 액세스할 수 있어야 하며 해당 구독과 연결된 디렉터리에 ID 앱 및 서비스 주체를 만들 수 있는 권한이 있어야 합니다. 전역 관리자 자격 증명을 사용하는 대신 등록에 사용할 서비스 계정을 만들어 Azure에 Azure Stack Hub를 등록하는 것이 좋습니다.

ASDK 등록

다음 단계에 따라 AZURE에 ASDK를 등록합니다.

참고

이러한 모든 단계는 권한 있는 엔드포인트에 대한 액세스 권한이 있는 컴퓨터에서 실행해야 합니다. ASDK의 경우 ASDK 호스트 컴퓨터입니다.

  1. 관리자 권한 PowerShell 프롬프트를 엽니다.

  2. 다음 PowerShell cmdlet을 실행하여 ASDK 설치를 Azure에 등록합니다. Azure 청구 구독 ID와 로컬 ASDK 설치 모두에 로그인합니다. Azure 청구 구독 ID가 아직 없는 경우 여기에서 무료 Azure 계정을 만들 수 있습니다. Azure Stack Hub를 등록하면 Azure 구독에 비용이 발생하지 않습니다.

    Set-AzsRegistration cmdlet을 실행할 때 등록에 대한 고유한 이름을 설정합니다. RegistrationName 매개 변수의 기본값은 AzureStackRegistration입니다. 그러나 둘 이상의 Azure Stack Hub instance 동일한 이름을 사용하는 경우 스크립트가 실패합니다.

    # Add the Azure cloud subscription environment name. 
    # Supported environment names are AzureCloud, AzureChinaCloud, or AzureUSGovernment depending which Azure subscription you're using.
    Connect-AzAccount -EnvironmentName "<environment name>"
    
    # Register the Azure Stack Hub resource provider in your Azure subscription
    Register-AzResourceProvider -ProviderNamespace Microsoft.AzureStack
    
    # Import the registration module that was downloaded with the GitHub tools
    Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1
    
    # If you have multiple subscriptions, run the following command to select the one you want to use:
    # Get-AzSubscription -SubscriptionID "<subscription ID>" | Select-AzSubscription
    
    # Register Azure Stack Hub
    $AzureContext = Get-AzContext
    $CloudAdminCred = Get-Credential -UserName AZURESTACK\CloudAdmin -Message "Enter the credentials to access the privileged endpoint."
    $RegistrationName = "<unique-registration-name>"
    Set-AzsRegistration `
    -PrivilegedEndpointCredential $CloudAdminCred `
    -PrivilegedEndpoint AzS-ERCS01 `
    -BillingModel Development `
    -RegistrationName $RegistrationName `
    -UsageReportingEnabled:$true
    
  3. 스크립트가 완료되면 제공된 매개 변수를 사용하여 환경이 등록되고 활성화됨이라는 메시지가 표시됩니다.

이제 환경이 등록되었습니다.

연결이 끊긴 환경에 등록

연결이 끊긴 환경에서(인터넷에 연결되지 않은) Azure Stack Hub를 등록하는 경우 Azure Stack Hub 환경에서 등록 토큰을 가져와서 Azure에 연결할 수 있는 컴퓨터에서 해당 토큰을 사용하여 ASDK 환경에 대한 활성화 리소스를 등록하고 만들어야 합니다.

중요

이러한 지침을 사용하여 Azure Stack Hub를 등록하기 전에 ASDK 호스트 컴퓨터와 Azure에 연결하고 등록하는 데 사용되는 인터넷 액세스 권한이 있는 컴퓨터의 배포 후 구성 문서에 설명된 대로 Azure Stack Hub용 PowerShell을 설치하고 Azure Stack Hub 도구를 다운로드했는지 확인합니다.

Azure Stack Hub 환경에서 등록 토큰 가져오기

ASDK 호스트 컴퓨터에서 관리자 권한으로 PowerShell을 시작하고 Azure Stack Hub 도구를 다운로드할 때 만든 AzureStack-Tools-az 디렉터리의 등록 폴더로 이동합니다. 다음 PowerShell 명령을 사용하여 RegisterWithAzure.psm1 모듈을 가져온 다음 Get-AzsRegistrationToken cmdlet을 사용하여 등록 토큰을 가져옵니다.

# Import the registration module that was downloaded with the GitHub tools
Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1

# Create registration token
$CloudAdminCred = Get-Credential -UserName AZURESTACK\CloudAdmin -Message "Enter the credentials to access the privileged endpoint."
# File path to save the token. This example saves the file as C:\RegistrationToken.txt.
$FilePathForRegistrationToken = "$env:SystemDrive\RegistrationToken.txt"
$RegistrationToken = Get-AzsRegistrationToken -PrivilegedEndpointCredential $CloudAdminCred `
-UsageReportingEnabled:$false `
-PrivilegedEndpoint AzS-ERCS01 `
-BillingModel Development `
-MarketplaceSyndicationEnabled:$false `
-TokenOutputFilePath $FilePathForRegistrationToken

인터넷에 연결된 컴퓨터에서 사용할 수 있도록 이 등록 토큰을 저장합니다. 매개 변수로 만든 파일에서 파일 또는 텍스트를 복사할 $FilePathForRegistrationToken 수 있습니다.

Azure에 연결하고 등록

인터넷에 연결된 컴퓨터에서 다음 PowerShell 명령을 사용하여 RegisterWithAzure.psm1 모듈을 가져온 다음 Register-AzsEnvironment cmdlet을 사용하여 방금 만든 등록 토큰과 고유한 등록 이름을 사용하여 Azure에 등록합니다.

# Add the Azure cloud subscription environment name. 
# Supported environment names are AzureCloud, AzureChinaCloud or AzureUSGovernment depending which Azure subscription you are using.
Connect-AzAccount -EnvironmentName "<environment name>"

# If you have multiple subscriptions, run the following command to select the one you want to use:
# Get-AzSubscription -SubscriptionID "<subscription ID>" | Select-AzSubscription

# Register the Azure Stack Hub resource provider in your Azure subscription
Register-AzResourceProvider -ProviderNamespace Microsoft.AzureStack

# Import the registration module that was downloaded with the GitHub tools
Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1

# Register with Azure
# This example uses the C:\RegistrationToken.txt file.
$registrationToken = Get-Content -Path "$env:SystemDrive\RegistrationToken.txt"
$RegistrationName = "<unique-registration-name>"
Register-AzsEnvironment -RegistrationToken $registrationToken `
-RegistrationName $RegistrationName

또는 Get-Content cmdlet을 사용하여 등록 토큰이 포함된 파일을 가리킬 수 있습니다.

# Add the Azure cloud subscription environment name. 
# Supported environment names are AzureCloud, AzureChinaCloud or AzureUSGovernment depending which Azure subscription you are using.
Connect-AzAccount -EnvironmentName "<environment name>"

# If you have multiple subscriptions, run the following command to select the one you want to use:
# Get-AzSubscription -SubscriptionID "<subscription ID>" | Select-AzSubscription

# Register the Azure Stack Hub resource provider in your Azure subscription
Register-AzResourceProvider -ProviderNamespace Microsoft.AzureStack

# Import the registration module that was downloaded with the GitHub tools
Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1

# Register with Azure 
# This example uses the C:\RegistrationToken.txt file.
$registrationToken = Get-Content -Path "$env:SystemDrive\RegistrationToken.txt"
Register-AzsEnvironment -RegistrationToken $registrationToken `
-RegistrationName $RegistrationName

등록이 완료되면 다음과 같은 메시지가 표시됩니다. 이제 Azure Stack Hub 환경이 Azure에 등록됩니다.

중요

PowerShell 창을 닫 지 마세요 .

나중에 참조할 수 있도록 등록 토큰 및 등록 리소스 이름을 저장합니다.

Azure 등록 리소스에서 활성화 키 검색

인터넷에 연결된 컴퓨터 와 동일한 PowerShell 콘솔 창을 사용하여 Azure에 등록할 때 만든 등록 리소스에서 활성화 키를 검색합니다.

활성화 키를 얻으려면 다음 PowerShell 명령을 실행합니다. 이전 단계에서 Azure에 등록할 때 제공한 것과 동일한 고유한 등록 이름 값을 사용합니다.

$RegistrationResourceName = "<unique-registration-name>"
# File path to save the activation key. This example saves the file as C:\ActivationKey.txt.
$KeyOutputFilePath = "$env:SystemDrive\ActivationKey.txt"
$ActivationKey = Get-AzsActivationKey -RegistrationName $RegistrationResourceName `
-KeyOutputFilePath $KeyOutputFilePath

Azure Stack Hub에서 활성화 리소스 만들기

Get-AzsActivationKey에서 만든 활성화 키의 파일 또는 텍스트를 사용하여 Azure Stack Hub 환경으로 돌아갑니다. 다음 PowerShell 명령을 실행하여 해당 활성화 키를 사용하여 Azure Stack Hub에서 활성화 리소스를 만듭니다.

# Import the registration module that was downloaded with the GitHub tools
Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1

$CloudAdminCred = Get-Credential -UserName AZURESTACK\CloudAdmin -Message "Enter the credentials to access the privileged endpoint."
$ActivationKey = "<activation key>"
New-AzsActivationResource -PrivilegedEndpointCredential $CloudAdminCred `
-PrivilegedEndpoint AzS-ERCS01 `
-ActivationKey $ActivationKey

또는 Get-Content cmdlet을 사용하여 등록 토큰이 포함된 파일을 가리킬 수 있습니다.

# Import the registration module that was downloaded with the GitHub tools
Import-Module C:\AzureStack-Tools-az\Registration\RegisterWithAzure.psm1

$CloudAdminCred = Get-Credential -UserName AZURESTACK\CloudAdmin -Message "Enter the credentials to access the privileged endpoint."
# This example uses the C:\ActivationKey.txt file.
$ActivationKey = Get-Content -Path "$env:SystemDrive\Activationkey.txt"
New-AzsActivationResource -PrivilegedEndpointCredential $CloudAdminCred `
-PrivilegedEndpoint AzS-ERCS01 `
-ActivationKey $ActivationKey

활성화가 완료되면 다음과 같은 메시지가 표시됩니다. 사용자 환경이 등록 및 활성화 프로세스를 완료했습니다.

등록에 성공했는지 확인합니다.

지역 관리 타일을 사용하여 Azure Stack Hub 등록에 성공했는지 확인할 수 있습니다. 이 타일은 관리자 포털의 기본 대시보드에서 사용할 수 있습니다.

  1. Azure Stack Hub 관리자 포털(https://adminportal.local.azurestack.external)에 로그인합니다.

  2. 대시보드에서 지역 관리를 선택합니다.

    Azure Stack Hub 관리자 포털 지역 관리 타일의

  3. 속성을 선택합니다. 이 블레이드는 환경의 상태 및 세부 정보를 보여 줍니다. 상태 등록 또는 등록 안 됨일 수 있습니다. 등록된 경우 등록 리소스 그룹 및 이름과 함께 Azure Stack Hub를 등록하는 데 사용한 Azure 구독 ID도 표시됩니다.

등록 리소스 이동

동일한 구독에서 리소스 그룹 간에 등록 리소스 이동이 지원 됩니다 . 리소스를 새 리소스 그룹으로 이동하는 방법에 대한 자세한 내용은 리소스를 새 리소스 그룹 또는 구독으로 이동을 참조하세요.

다음 단계