다음을 통해 공유


빠른 시작: Java를 사용하여 가상 머신용 Azure Automanage 사용

주의

2027년 9월 30일에 Azure Automanage Best Practices 서비스가 사용 중지됩니다. 따라서 새 구성 프로필을 만들거나 서비스에 새 구독을 온보딩하면 오류가 발생합니다. 해당 날짜 이전에 Azure Policy로 마이그레이션하는 방법에 대해 자세히 알아보세요.

주의

2025년 2월 1일부터 Azure Automanage는 사용되지 않는 MMA(Microsoft Monitoring Agent)에 종속된 모든 서비스에 대한 지원 및 적용을 중단하기 위한 변경 내용을 롤아웃하기 시작합니다. 변경 내용 추적 및 관리, VM Insights, 업데이트 관리 및 Azure Automation을 계속 사용하려면 새 AMA(Azure Monitor 에이전트)로 마이그레이션합니다.

Azure Automanage를 통해 사용자는 Azure 모범 사례를 가상 머신에 원활하게 적용할 수 있습니다. 이 빠른 시작 가이드는 azure-sdk-for-java 리포지토리를 사용하여 기존 가상 머신에 모범 사례 구성 프로필을 적용하는 데 도움이 됩니다.

필수 조건

참고 항목

평가판 계정은 이 자습서에서 사용되는 가상 머신에 액세스할 수 없습니다. 종량제 구독으로 업그레이드하세요.

중요

Automanage를 사용하도록 설정하려면 VM이 포함된 리소스 그룹에 대한 기여자 역할이 있어야 합니다. 구독에서 처음으로 Automanage를 사용하도록 설정하는 경우 다음 권한이 필요합니다. 구독에 대한 사용자 액세스 관리자 역할과 함께 소유자 역할 또는 기여자

필요한 종속성 추가

Azure IdentityAzure Automanage 종속성을 pom.xml에 추가합니다.

<!-- https://mvnrepository.com/artifact/com.azure/azure-identity -->
<dependency>
    <groupId>com.azure</groupId>
    <artifactId>azure-identity</artifactId>
    <version>1.6.0-beta.1</version>
    <scope>test</scope>
</dependency>

<!-- https://mvnrepository.com/artifact/com.azure.resourcemanager/azure-resourcemanager-automanage -->
<dependency>
    <groupId>com.azure.resourcemanager</groupId>
    <artifactId>azure-resourcemanager-automanage</artifactId>
    <version>1.0.0-beta.1</version>
</dependency>

Azure에 인증하고 Automanage 클라이언트 만들기

Azure ID 패키지를 사용하여 Azure에 인증한 다음, Automanage 클라이언트를 만듭니다.

AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
TokenCredential credential = new DefaultAzureCredentialBuilder()
    .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
    .build();

AutomanageManager client = AutomanageManager
    .authenticate(credential, profile);

기존 가상 머신에 대한 모범 사례 구성 프로필 사용

String configProfile = "/providers/Microsoft.Automanage/bestPractices/AzureBestPracticesProduction";

client
    .configurationProfileAssignments()
    .define("default") // name must be default
    .withExistingVirtualMachine("resourceGroupName", "vmName")
    .withProperties(
        new ConfigurationProfileAssignmentProperties()
            .withConfigurationProfile(configProfile))
    .create();

다음 단계

azure-sdk-for-java 리포지토리에서 Java Automanage 클라이언트로 더 많은 작업을 수행하는 방법을 알아봅니다.