다음을 통해 공유


AzureSpringCloud@0 - Azure Spring Apps v0 작업

이 작업은 Azure Spring Apps에 애플리케이션을 배포하고 해당 배포를 관리합니다.

중요합니다

이 작업은 Azure Spring Apps Basic/Standard 및 Enterprise 플랜에서 지원됩니다. 자세한 내용은 Azure Spring Apps에 애플리케이션 배포 자동화를 참조하세요.

문법

# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription. 
    Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
    AzureSpringCloud: # string. Required. Azure Spring Apps Name. 
    AppName: # string. Required. App. 
    #DeploymentType: 'Artifacts' # 'Artifacts' | 'CustomContainer'. Optional. Use when Action = Deploy. Deployment Type. Default: Artifacts.
    #UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
    #CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
    #DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment. 
    #Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
    #RegistryServer: 'docker.io' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Server. Default: docker.io.
    #RegistryUsername: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Username. 
    #RegistryPassword: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Password. 
    #ImageName: 'hello-world:v1' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Name and Tag. Default: hello-world:v1.
    #ImageCommand: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Command. 
    #ImageArgs: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Arguments. 
    #ImageLanguageFramework: # 'springboot'. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Language Framework. 
  # Application and Configuration Settings
    #Builder: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Builder. 
    #EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables. 
    #JvmOptions: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. JVM Options. 
    #RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'Java_17' | 'Java_21' | 'NetCore_31'. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Runtime Version. Default: Java_11.
    #DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path. 
    #Version: # string. Optional. Use when Action = Deploy. Version.
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription. 
    Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
    AzureSpringCloud: # string. Required. Azure Spring Apps Name. 
    AppName: # string. Required. App. 
    #DeploymentType: 'Artifacts' # 'Artifacts' | 'CustomContainer'. Optional. Use when Action = Deploy. Deployment Type. Default: Artifacts.
    #UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
    #CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
    #DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment. 
    #Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
    #RegistryServer: 'docker.io' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Server. Default: docker.io.
    #RegistryUsername: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Username. 
    #RegistryPassword: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Registry Password. 
    #ImageName: 'hello-world:v1' # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Name and Tag. Default: hello-world:v1.
    #ImageCommand: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Command. 
    #ImageArgs: # string. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Image Arguments. 
    #ImageLanguageFramework: # 'springboot'. Optional. Use when Action = Deploy && DeploymentType = CustomContainer. Language Framework. 
  # Application and Configuration Settings
    #Builder: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Builder. 
    #EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables. 
    #JvmOptions: # string. Optional. Use when Action = Deploy && DeploymentType = Artifacts. JVM Options. 
    #RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'NetCore_31'. Optional. Use when Action = Deploy && DeploymentType = Artifacts. Runtime Version. Default: Java_11.
    #DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path. 
    #Version: # string. Optional. Use when Action = Deploy. Version.
# Azure Spring Apps v0
# Deploy applications to Azure Spring Apps and manage deployments.
- task: AzureSpringCloud@0
  inputs:
    azureSubscription: # string. Alias: ConnectedServiceName. Required. Azure subscription. 
    Action: 'Deploy' # 'Deploy' | 'Set Production' | 'Delete Staging Deployment'. Required. Action. Default: Deploy.
    AzureSpringCloud: # string. Required. Azure Spring Apps Name. 
    AppName: # string. Required. App. 
    #UseStagingDeployment: true # boolean. Optional. Use when Action = Deploy || Action = Set Production. Use Staging Deployment. Default: true.
    #CreateNewDeployment: false # boolean. Optional. Use when Action = Deploy && UseStagingDeployment = false. Create a new staging deployment if one does not exist. Default: false.
    #DeploymentName: # string. Optional. Use when UseStagingDeployment = false && Action != Delete Staging Deployment. Deployment. 
    #Package: '$(System.DefaultWorkingDirectory)/**/*.jar' # string. Optional. Use when Action = Deploy. Package or folder. Default: $(System.DefaultWorkingDirectory)/**/*.jar.
  # Application and Configuration Settings
    #EnvironmentVariables: # string. Optional. Use when Action = Deploy. Environment Variables. 
    #JvmOptions: # string. Optional. Use when Action = Deploy. JVM Options. 
    #RuntimeVersion: 'Java_11' # 'Java_8' | 'Java_11' | 'NetCore_31'. Optional. Use when Action = Deploy. Runtime Version. Default: Java_11.
    #DotNetCoreMainEntryPath: # string. Optional. Use when RuntimeVersion = NetCore_31. Main Entry Path. 
    #Version: # string. Optional. Use when Action = Deploy. Version.

입력

Azure 구독
입력 별칭: ConnectedServiceName. string; 필수 사항입니다.

배포에 대한 Azure Resource Manager 구독을 지정합니다.


Action - 작업
string; 필수 사항입니다. 허용되는 값: Deploy, Set Production (프로덕션 배포 설정), Delete Staging Deployment. 기본값은 Deploy입니다.

Azure Spring Apps에서 수행할 작업입니다.


AzureSpringCloud - Azure Spring Apps 이름
string; 필수 사항입니다.

배포할 Azure Spring Apps 인스턴스의 이름 또는 리소스 ID입니다.


AppName -
string; 필수 사항입니다.

배포할 Azure Spring Apps 앱의 이름입니다. 앱은 작업 실행 전에 존재해야 합니다.


DeploymentType - 배포 유형
string; 선택 사항입니다. Action = Deploy때 사용합니다. 허용되는 값: Artifacts, CustomContainer (사용자 지정 컨테이너). 기본값은 Artifacts입니다.

소스 코드 또는 Java 패키지를 사용하여 배포하려면 "아티팩트"를 선택합니다. 컨테이너 이미지를 사용하여 배포하려면 "사용자 지정 컨테이너"를 선택합니다.


UseStagingDeployment - 스테이징 배포 사용
boolean; 선택 사항입니다. Action = Deploy || Action = Set Production때 사용합니다. 기본값은 true입니다.

작업이 실행될 때 이 입력은 로 staging설정된 배포를 자동으로 선택합니다.

true설정하면 실행 시 스테이징 배포로 설정된 배포 에 작업을 적용합니다. 생략 DeploymentName 할 경우 매개 변수를 설정해야 합니다.


CreateNewDeployment - 스테이징 배포가 없는 경우 새 스테이징 배포를 만듭니다.
boolean; 선택 사항입니다. Action = Deploy && UseStagingDeployment = false때 사용합니다. 기본값은 false입니다.

로 설정 true되고 로 DeploymentName 지정된 배포가 실행 시 존재하지 않으면 생성됩니다. 생략 DeploymentName 할 경우 매개 변수를 설정해야 합니다.


DeploymentName - 전개
string; 선택 사항입니다. UseStagingDeployment = false && Action != Delete Staging Deployment때 사용합니다.

이 작업이 적용되는 배포 입니다. 블루-그린 배포를 사용하지 않는 경우 이 필드를 default로 설정합니다. 값은 문자로 시작해야 하며 소문자와 숫자로만 구성되어야 합니다.


패키지 또는 폴더
string; 선택 사항입니다. Action = Deploy && DeploymentType = Artifacts때 사용합니다. 기본값은 $(System.DefaultWorkingDirectory)/**/*.jar입니다.

Azure Spring Apps 앱 콘텐츠를 포함하는 패키지 또는 폴더의 파일 경로입니다(.jar Java의 경우 파일, .zip .NET Core의 경우 file).
변수( 빌드 | 릴리스) 및 와일드카드가 지원됩니다.
예를 들어 $(System.DefaultWorkingDirectory)/**/*.jar


패키지 또는 폴더
string; 선택 사항입니다. Action = Deploy때 사용합니다. 기본값은 $(System.DefaultWorkingDirectory)/**/*.jar입니다.

Azure Spring Apps 앱 콘텐츠를 포함하는 패키지 또는 폴더의 파일 경로입니다(.jar Java의 경우 파일, .zip .NET Core의 경우 file).
변수( 빌드 | 릴리스) 및 와일드카드가 지원됩니다.
예를 들어 $(System.DefaultWorkingDirectory)/**/*.jar


Builder - 건설자
string; 선택 사항입니다. Action = Deploy && DeploymentType = Artifacts때 사용합니다.

VMware Tanzu® Build Service™의 빌더를 선택하면 엔터프라이즈 계층에서 사용할 수 있습니다.
자세한 설명은 Tanzu Build Service 사용을 확인하십시오.


RegistryServer - 레지스트리 서버
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다. 기본값은 docker.io입니다.

컨테이너 이미지의 레지스트리입니다. 기본값: docker.io.


RegistryUsername - 레지스트리 사용자 이름
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다.

컨테이너 레지스트리의 사용자 이름입니다.


레지스트리 암호RegistryPassword -
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다.

컨테이너 레지스트리의 암호입니다.


ImageName - 이미지 이름 및 태그
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다. 기본값은 hello-world:v1입니다.

컨테이너 이미지 태그입니다.


ImageCommand - 이미지 명령
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다.

컨테이너 이미지의 명령입니다.


ImageArgs - 이미지 인수
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다.

컨테이너 이미지의 인수입니다.


ImageLanguageFramework - 언어 프레임워크
string; 선택 사항입니다. Action = Deploy && DeploymentType = CustomContainer때 사용합니다. 허용되는 값: springboot.


EnvironmentVariables - 환경 변수
string; 선택 사항입니다. Action = Deploy때 사용합니다.

구문을 -key value 사용하여 입력할 환경 변수(예: -CUSTOMER_NAME Contoso-WEBSITE_TIME_ZONE). 공백이 포함된 값은 큰따옴표로 묶어야 합니다(예: "Eastern Standard Time").


JvmOptions - JVM 옵션
string; 선택 사항입니다. Action = Deploy && DeploymentType = Artifacts때 사용합니다.

앱의 JVM 옵션을 편집합니다. JVM 옵션을 포함하는 문자열(예: -Xms1024m -Xmx2048m.


JvmOptions - JVM 옵션
string; 선택 사항입니다. Action = Deploy때 사용합니다.

앱의 JVM 옵션을 편집합니다. JVM 옵션을 포함하는 문자열(예: -Xms1024m -Xmx2048m.


RuntimeVersion - 런타임 버전
string; 선택 사항입니다. Action = Deploy && DeploymentType = Artifacts때 사용합니다. 허용되는 값: Java_8 (Java 8), Java_11 (Java 11), Java_17 (Java 17), Java_21 (Java 21), NetCore_31 (.Net Core 3.1). 기본값은 Java_11입니다.

앱이 실행될 런타임 버전입니다.


RuntimeVersion - 런타임 버전
string; 선택 사항입니다. Action = Deploy && DeploymentType = Artifacts때 사용합니다. 허용되는 값: Java_8 (Java 8), Java_11 (Java 11), NetCore_31 (.Net Core 3.1). 기본값은 Java_11입니다.

앱이 실행될 런타임 버전입니다.


RuntimeVersion - 런타임 버전
string; 선택 사항입니다. Action = Deploy때 사용합니다. 허용되는 값: Java_8 (Java 8), Java_11 (Java 11), NetCore_31 (.Net Core 3.1). 기본값은 Java_11입니다.

앱이 실행될 런타임 버전입니다.


DotNetCoreMainEntryPath - 주 진입 경로
string; 선택 사항입니다. RuntimeVersion = NetCore_31때 사용합니다.

zip 루트를 기준으로 하는 .NET 실행 파일의 경로입니다.


Version - 버전
string; 선택 사항입니다. Action = Deploy때 사용합니다.

배포 버전입니다. 설정하지 않으면 버전이 변경되지 않은 상태로 유지됩니다.


작업 제어 옵션

모든 작업에는 작업 입력 외에 제어 옵션이 있습니다. 자세한 내용은 컨트롤 옵션 및 일반적인 작업 속성참조하세요.

출력 변수

이 작업은 다운스트림 단계, 작업 및 단계에서 사용할 수 있는 다음 출력 변수정의합니다.

testEndpoint
'배포' 작업 후에만 가능합니다. 업데이트된 배포에 액세스하기 위한 개인 URL을 포함합니다.

비고

이 작업을 사용하여 Azure Spring Apps 에 애플리케이션을 배포하고 Azure Spring Cloud 배포를 관리합니다.

중요합니다

이 작업은 Azure Spring Apps Basic/Standard 및 Enterprise 플랜에서 지원됩니다. 자세한 내용은 Azure Spring Apps에 애플리케이션 배포 자동화를 참조하세요.

예시

다음 예제는 일반적인 사용 시나리오를 보여줍니다. 자세한 내용은 Azure Spring Apps에 애플리케이션 배포 자동화를 참조하세요.

스테이징 배포 삭제

"Delete Staging Deployment(스테이징 배포 삭제)" 작업을 사용하면 프로덕션 트래픽을 수신하지 않는 배포를 삭제할 수 있습니다. 이렇게 하면 해당 배포에서 사용하는 리소스를 확보하고 새 스테이징 배포를 위한 공간을 확보할 수 있습니다.

variables:
  azureSubscription: Contoso

steps:
- task: AzureSpringCloud@0
  continueOnError: true # Don't fail the pipeline if a staging deployment doesn't already exist.
  inputs:
    continueOnError: true
    inputs:
    azureSubscription: $(azureSubscription)
    Action: 'Delete Staging Deployment'
    AppName: customer-api
    AzureSpringCloud: contoso-dev-az-spr-cld

배포 중

프로덕션으로

다음 예제에서는 Azure Spring Apps의 기본 프로덕션 배포에 배포합니다. 다음은 기본 SKU를 사용할 때 가능한 유일한 배포 시나리오입니다.

비고

패키지 검색 패턴은 정확히 하나의 패키지만 반환해야 합니다. 빌드 작업에서 sources.jarjavadoc.jar 같은 여러 JAR 패키지가 생성되는 경우에는 애플리케이션 이진 아티팩트와만 일치하도록 검색 패턴을 구체화해야 합니다.

variables:
  azureSubscription: Contoso

steps:
- task: AzureSpringCloud@0
    inputs:
    azureSubscription: $(azureSubscription)
    Action: 'Deploy'
    AzureSpringCloud: contoso-dev-az-spr-cld
    AppName: customer-api
    UseStagingDeployment: false
    DeploymentName: default
    Package: '$(System.DefaultWorkingDirectory)/**/*customer-api*.jar'

파란색-녹색

다음 예제에서는 기존 스테이징 배포에 배포합니다. 이 배포는 프로덕션 배포로 설정될 때까지 프로덕션 트래픽을 수신하지 않습니다.

variables:
  azureSubscription: Contoso

steps:
- task: AzureSpringCloud@0
    inputs:
    azureSubscription: $(azureSubscription)
    Action: 'Deploy'
    AzureSpringCloud: contoso-dev-az-spr-cld
    AppName: customer-api
    UseStagingDeployment: true
    Package: '$(System.DefaultWorkingDirectory)/**/*customer-api*.jar'

대체 접근 방식을 포함하여 블루-그린 배포에 대한 자세한 내용은 블루-그린 배포 전략을 참조하세요.

프로덕션 배포 설정

다음 예제에서는 현재 준비 배포를 프로덕션으로 설정하여 프로덕션 트래픽을 수신할 배포를 효과적으로 스왑합니다.

variables:
  azureSubscription: Contoso

steps:
- task: AzureSpringCloud@0
    inputs:
    azureSubscription: $(azureSubscription)
    Action: 'Set Production'
    AzureSpringCloud: contoso-dev-az-spr-cld
    AppName: customer-api
    UseStagingDeployment: true

요구 사항

요구 사항 설명
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
다음에서 실행 에이전트, DeploymentGroup
요구 없음
기능 이 작업은 작업의 후속 작업에 대한 요구 사항을 충족하지 않습니다.
명령 제한 어느 것이든
settable 변수 어느 것이든
에이전트 버전 2.104.1 이상
작업 범주 배치하다