다음을 통해 공유


SqlAzureDacpacDeployment@1 - Azure SQL Database 배포 v1 작업

이 작업을 사용하여 DACPAC를 사용하여 Azure SQL Database를 배포하거나 SQLCMD를 사용하여 스크립트를 실행합니다.

구문론

# Azure SQL Database deployment v1
# Deploy an Azure SQL Database using DACPAC or run scripts using SQLCMD.
- task: SqlAzureDacpacDeployment@1
  inputs:
    #azureConnectionType: 'ConnectedServiceNameARM' # 'ConnectedServiceName' | 'ConnectedServiceNameARM'. Alias: ConnectedServiceNameSelector. Azure Service Connection Type. Default: ConnectedServiceNameARM.
    #azureClassicSubscription: # string. Alias: ConnectedServiceName. Required when ConnectedServiceNameSelector = ConnectedServiceName. Azure Classic Subscription. 
    azureSubscription: # string. Alias: ConnectedServiceNameARM. Required when ConnectedServiceNameSelector = ConnectedServiceNameARM. Azure Subscription. 
  # SQL Database
    AuthenticationType: 'server' # 'server' | 'aadAuthenticationPassword' | 'aadAuthenticationIntegrated' | 'connectionString' | 'servicePrincipal'. Required. Authentication Type. Default: server.
    #ServerName: # string. Required when AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated || AuthenticationType = servicePrincipal. Azure SQL Server. 
    #DatabaseName: # string. Required when AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated || AuthenticationType = servicePrincipal. Database. 
    SqlUsername: # string. Required when AuthenticationType = server. Login. 
    SqlPassword: # string. Required when AuthenticationType = server. Password. 
    #aadSqlUsername: # string. Required when AuthenticationType = aadAuthenticationPassword. Login. 
    #aadSqlPassword: # string. Required when AuthenticationType = aadAuthenticationPassword. Password. 
    #ConnectionString: # string. Required when AuthenticationType = connectionString. Connection String. 
  # Deployment Package
    deployType: 'DacpacTask' # 'DacpacTask' | 'SqlTask' | 'InlineSqlTask'. Alias: TaskNameSelector. Required. Deploy type. Default: DacpacTask.
    DeploymentAction: 'Publish' # 'Publish' | 'Extract' | 'Export' | 'Import' | 'Script' | 'DriftReport' | 'DeployReport'. Required when TaskNameSelector = DacpacTask. Action. Default: Publish.
    #DacpacFile: # string. Required when DeploymentAction = Publish || DeploymentAction = Script || DeploymentAction = DeployReport. DACPAC File. 
    #BacpacFile: # string. Required when DeploymentAction = Import. BACPAC File. 
    #SqlFile: # string. Required when TaskNameSelector = SqlTask. SQL Script. 
    #SqlInline: # string. Required when TaskNameSelector = InlineSqlTask. Inline SQL Script. 
    #PublishProfile: # string. Optional. Use when TaskNameSelector = DacpacTask || DeploymentAction = Script || DeploymentAction = DeployReport. Publish Profile. 
    #AdditionalArguments: # string. Optional. Use when TaskNameSelector = DacpacTask || DeploymentAction = Extract || DeploymentAction = Export || DeploymentAction = Import || DeploymentAction = Script || DeploymentAction = DeployReport || DeploymentAction = DriftReport. Additional SqlPackage.exe Arguments. 
    #SqlAdditionalArguments: # string. Optional. Use when TaskNameSelector = SqlTask. Additional Invoke-Sqlcmd Arguments. 
    #InlineAdditionalArguments: # string. Optional. Use when TaskNameSelector = InlineSqlTask. Additional Invoke-Sqlcmd Arguments. 
  # Firewall
    IpDetectionMethod: 'AutoDetect' # 'AutoDetect' | 'IPAddressRange'. Required. Specify Firewall Rules Using. Default: AutoDetect.
    #StartIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. Start IP Address. 
    #EndIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. End IP Address. 
    #DeleteFirewallRule: true # boolean. Delete Rule After Task Ends. Default: true.
# Azure SQL Database deployment v1
# Deploy an Azure SQL Database using DACPAC or run scripts using SQLCMD.
- task: SqlAzureDacpacDeployment@1
  inputs:
    #azureConnectionType: 'ConnectedServiceNameARM' # 'ConnectedServiceName' | 'ConnectedServiceNameARM'. Alias: ConnectedServiceNameSelector. Azure Service Connection Type. Default: ConnectedServiceNameARM.
    #azureClassicSubscription: # string. Alias: ConnectedServiceName. Required when ConnectedServiceNameSelector = ConnectedServiceName. Azure Classic Subscription. 
    azureSubscription: # string. Alias: ConnectedServiceNameARM. Required when ConnectedServiceNameSelector = ConnectedServiceNameARM. Azure Subscription. 
  # SQL Database
    AuthenticationType: 'server' # 'server' | 'aadAuthenticationPassword' | 'aadAuthenticationIntegrated' | 'connectionString'. Required. Authentication Type. Default: server.
    #ServerName: # string. Required when AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated. Azure SQL Server. 
    #DatabaseName: # string. Required when AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated. Database. 
    SqlUsername: # string. Required when AuthenticationType = server. Login. 
    SqlPassword: # string. Required when AuthenticationType = server. Password. 
    #aadSqlUsername: # string. Required when AuthenticationType = aadAuthenticationPassword. Login. 
    #aadSqlPassword: # string. Required when AuthenticationType = aadAuthenticationPassword. Password. 
    #ConnectionString: # string. Required when AuthenticationType = connectionString. Connection String. 
  # Deployment Package
    deployType: 'DacpacTask' # 'DacpacTask' | 'SqlTask' | 'InlineSqlTask'. Alias: TaskNameSelector. Required. Deploy type. Default: DacpacTask.
    DeploymentAction: 'Publish' # 'Publish' | 'Extract' | 'Export' | 'Import' | 'Script' | 'DriftReport' | 'DeployReport'. Required when TaskNameSelector = DacpacTask. Action. Default: Publish.
    #DacpacFile: # string. Required when DeploymentAction = Publish || DeploymentAction = Script || DeploymentAction = DeployReport. DACPAC File. 
    #BacpacFile: # string. Required when DeploymentAction = Import. BACPAC File. 
    #SqlFile: # string. Required when TaskNameSelector = SqlTask. SQL Script. 
    #SqlInline: # string. Required when TaskNameSelector = InlineSqlTask. Inline SQL Script. 
    #PublishProfile: # string. Optional. Use when TaskNameSelector = DacpacTask || DeploymentAction = Script || DeploymentAction = DeployReport. Publish Profile. 
    #AdditionalArguments: # string. Optional. Use when TaskNameSelector = DacpacTask || DeploymentAction = Extract || DeploymentAction = Export || DeploymentAction = Import || DeploymentAction = Script || DeploymentAction = DeployReport || DeploymentAction = DriftReport. Additional SqlPackage.exe Arguments. 
    #SqlAdditionalArguments: # string. Optional. Use when TaskNameSelector = SqlTask. Additional Invoke-Sqlcmd Arguments. 
    #InlineAdditionalArguments: # string. Optional. Use when TaskNameSelector = InlineSqlTask. Additional Invoke-Sqlcmd Arguments. 
  # Firewall
    IpDetectionMethod: 'AutoDetect' # 'AutoDetect' | 'IPAddressRange'. Required. Specify Firewall Rules Using. Default: AutoDetect.
    #StartIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. Start IP Address. 
    #EndIpAddress: # string. Required when IpDetectionMethod = IPAddressRange. End IP Address. 
    #DeleteFirewallRule: true # boolean. Delete Rule After Task Ends. Default: true.

입력

Azure 서비스 연결 유형azureConnectionType -
입력 별칭: ConnectedServiceNameSelector. string; 허용되는 값: ConnectedServiceName(Azure 클래식), ConnectedServiceNameARM(Azure Resource Manager). 기본값은 ConnectedServiceNameARM입니다.


Azure 클래식 구독azureClassicSubscription -
입력 별칭: ConnectedServiceName. string; ConnectedServiceNameSelector = ConnectedServiceName때 필요합니다.

SQL 파일을 배포하기 위한 대상 Azure 클래식 구독을 지정합니다.


Azure 구독azureSubscription -
입력 별칭: ConnectedServiceNameARM. string; ConnectedServiceNameSelector = ConnectedServiceNameARM때 필요합니다.

SQL 파일을 배포하기 위한 대상 Azure Resource Manager 구독을 지정합니다.


AuthenticationType - 인증 유형
string; 필수 사항입니다. 허용되는 값: server(SQL Server 인증), aadAuthenticationPassword(Active Directory - 암호), aadAuthenticationIntegrated(Active Directory - 통합), connectionString(연결 문자열), servicePrincipal(서비스 주체). 기본값은 server입니다.

데이터베이스 인증 유형을 지정합니다. SQL Server, Active Directory(통합), Active Directory(암호), 연결 문자열 또는 서비스 주체 인증일 수 있습니다. 통합 인증은 에이전트가 현재 Active Directory 계정 컨텍스트를 사용하여 데이터베이스에 액세스한다는 것을 의미합니다.

Azure SQL Server 데이터베이스에 연결하는 옵션을 지정합니다. Azure SQL Server 데이터베이스 세부 정보, SQL Server 연결 문자열, AD 인증(암호 또는 통합)을 제공하거나 서비스 주체를 사용할 수 있습니다. SQL Server 인증의 경우 SQL Server의 사용자 자격 증명을 사용합니다. AD 인증의 경우 SQL Server에 구성된 AD 사용자에 대한 자격 증명을 사용합니다.


AuthenticationType - 인증 유형
string; 필수 사항입니다. 허용되는 값: server(SQL Server 인증), aadAuthenticationPassword(Active Directory - 암호), aadAuthenticationIntegrated(Active Directory - 통합), connectionString(연결 문자열) 기본값은 server입니다.

데이터베이스 인증 유형을 지정합니다. SQL Server, Active Directory(통합), Active Directory(암호), 연결 문자열 또는 서비스 주체 인증일 수 있습니다. 통합 인증은 에이전트가 현재 Active Directory 계정 컨텍스트를 사용하여 데이터베이스에 액세스한다는 것을 의미합니다.

Azure SQL Server 데이터베이스에 연결하는 옵션을 지정합니다. Azure SQL Server 데이터베이스 세부 정보, SQL Server 연결 문자열, AD 인증(암호 또는 통합)을 제공하거나 서비스 주체를 사용할 수 있습니다. SQL Server 인증의 경우 SQL Server의 사용자 자격 증명을 사용합니다. AD 인증의 경우 SQL Server에 구성된 AD 사용자에 대한 자격 증명을 사용합니다.


Azure SQL ServerServerName -
string; AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated || AuthenticationType = servicePrincipal때 필요합니다.

Fabrikam.database.windows.net.placeholder,1433 또는 Fabrikam.database.windows.net.placeholder같은 Azure SQL Server 이름을 지정합니다.


Azure SQL ServerServerName -
string; AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated때 필요합니다.

Fabrikam.database.windows.net.placeholder,1433 또는 Fabrikam.database.windows.net.placeholder같은 Azure SQL Server 이름을 지정합니다.


DatabaseName - 데이터베이스
string; AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated || AuthenticationType = servicePrincipal때 필요합니다.

파일이 배포되는 Azure SQL 데이터베이스의 이름을 지정합니다.


DatabaseName - 데이터베이스
string; AuthenticationType = server || AuthenticationType = aadAuthenticationPassword || AuthenticationType = aadAuthenticationIntegrated때 필요합니다.

파일이 배포되는 Azure SQL 데이터베이스의 이름을 지정합니다.


SqlUsername - 로그인
string; AuthenticationType = server때 필요합니다.

Azure SQL Server 관리자 로그인을 지정합니다.


암호SqlPassword -
string; AuthenticationType = server때 필요합니다.

Azure SQL Server 관리자의 암호를 지정합니다. $(passwordVariable) 빌드 또는 릴리스 파이프라인에 정의된 변수가 허용됩니다. 변수 형식을 secret 표시하여 보호할 수 있습니다.


aadSqlUsername - 로그인
string; AuthenticationType = aadAuthenticationPassword때 필요합니다.

Active Directory 사용자 이름을 지정합니다.


암호aadSqlPassword -
string; AuthenticationType = aadAuthenticationPassword때 필요합니다.

Active Directory 사용자의 암호를 지정합니다. $(passwordVariable) 빌드 또는 릴리스 파이프라인에 정의된 변수가 허용됩니다. 변수 형식을 secret 표시하여 보호할 수 있습니다.


ConnectionString - 연결 문자열
string; AuthenticationType = connectionString때 필요합니다.

Server=testServer.database.windows.net.placeholder;Database=testdb;User ID=AccountPlaceholder;Password=$(securePassword);같은 Azure SQL Server 연결 문자열을 지정합니다.


deployType - 형식 배포
입력 별칭: TaskNameSelector. string; 필수 사항입니다. 허용되는 값: DacpacTask(SQL DACPAC 파일), SqlTask(SQL 스크립트 파일), InlineSqlTask(인라인 SQL 스크립트). 기본값은 DacpacTask입니다.


DeploymentAction - 작업
string; TaskNameSelector = DacpacTask때 필요합니다. 허용되는 값: Publish, Extract, Export, Import, Script, DriftReport(드리프트 보고서), DeployReport(보고서 배포). 기본값은 Publish입니다.

목록에서 SQL 작업 중 하나를 지정합니다. SQL 작업 목록대해 자세히 알아봅니다.


DACPAC 파일DacpacFile -
string; DeploymentAction = Publish || DeploymentAction = Script || DeploymentAction = DeployReport때 필요합니다.

자동화 에이전트 또는 자동화 에이전트에서 액세스할 수 있는 UNC 경로(예: \\BudgetIT\Web\Deploy\FabrikamDB.dacpac)에서 DACPAC 파일의 위치를 지정합니다. $(agent.releaseDirectory)같은 미리 정의된 시스템 변수도 사용할 수 있습니다.


BACPAC 파일BacpacFile -
string; DeploymentAction = Import때 필요합니다.

자동화 에이전트 또는 자동화 에이전트에서 액세스할 수 있는 UNC 경로(예: \\BudgetIT\Web\Deploy\FabrikamDB.bacpac)에서 BACPAC 파일의 위치를 지정합니다. $(agent.releaseDirectory)같은 미리 정의된 시스템 변수도 사용할 수 있습니다.


SQL 스크립트SqlFile -
string; TaskNameSelector = SqlTask때 필요합니다.

자동화 에이전트 또는 자동화 에이전트에서 액세스할 수 있는 UNC 경로(예: \\BudgetIT\Web\Deploy\FabrikamDB.sql)에서 SQL 스크립트 파일의 위치를 지정합니다. $(agent.releaseDirectory)같은 미리 정의된 시스템 변수도 사용할 수 있습니다.


SqlInline - 인라인 SQL 스크립트
string; TaskNameSelector = InlineSqlTask때 필요합니다.

이전에 선택한 데이터베이스에서 실행할 SQL 스크립트를 지정합니다.


프로필 게시PublishProfile -
string; 선택 사항. TaskNameSelector = DacpacTask || DeploymentAction = Script || DeploymentAction = DeployReport때 사용합니다.

Azure SQL 데이터베이스 만들기 또는 업그레이드에 대한 세분화된 제어를 제공합니다.
자동화 에이전트 컴퓨터 또는 UNC 공유에서 게시 프로필 XML 파일의 경로를 지정합니다. 게시 프로필에 자격 증명과 같은 비밀이 포함된 경우 암호화를 사용하여 안전하게 저장되는 보안 파일 라이브러리에 업로드합니다. 다음으로 파이프라인 시작 시 보안 파일 다운로드 작업을 사용하여 파이프라인이 실행되면 에이전트 컴퓨터에 다운로드합니다. 파이프라인이 완료되면 삭제합니다. $(agent.buildDirectory) 또는 $(agent.releaseDirectory)같은 미리 정의된 시스템 변수도 사용할 수 있습니다.


추가 SqlPackage.exe 인수AdditionalArguments -
string; 선택 사항. TaskNameSelector = DacpacTask || DeploymentAction = Extract || DeploymentAction = Export || DeploymentAction = Import || DeploymentAction = Script || DeploymentAction = DeployReport || DeploymentAction = DriftReport때 사용합니다.

/p:IgnoreAnsiNulls=True /p:IgnoreComments=True같이 DACPAC 옵션을 선택한 경우 Azure SQL 데이터베이스를 배포할 때 적용되는 추가 SqlPackage.exe 인수를 지정합니다. 이러한 인수는 게시 프로필 XML 파일의 설정을 재정의합니다(제공된 경우).


추가 Invoke-Sqlcmd 인수SqlAdditionalArguments -
string; 선택 사항. TaskNameSelector = SqlTask때 사용합니다.

-ConnectionTimeout 100 -OutputSqlErrors같이 Azure SQL 데이터베이스에서 지정된 SQL 쿼리를 실행할 때 적용되는 추가 Invoke-Sqlcmd 인수를 지정합니다.


추가 Invoke-Sqlcmd 인수InlineAdditionalArguments -
string; 선택 사항. TaskNameSelector = InlineSqlTask때 사용합니다.

-ConnectionTimeout 100 -OutputSqlErrors같이 Azure SQL Database에서 지정된 SQL 쿼리를 실행할 때 적용되는 추가 Invoke-Sqlcmd 인수를 지정합니다.


IpDetectionMethod - 사용하여 방화벽 규칙 지정
string; 필수 사항입니다. 허용되는 값: AutoDetect, IPAddressRange. 기본값은 AutoDetect입니다.

작업을 실행하려면 자동화 에이전트의 IP 주소를 Azure SQL Server 방화벽의 허용된 IP 주소 추가해야 합니다. 자동 검색을 선택하여 자동화 에이전트의 가능한 IP 주소 범위에 대한 방화벽 예외를 자동으로 추가하거나 범위를 명시적으로 지정합니다.


StartIpAddress - 시작 IP 주소
string; IpDetectionMethod = IPAddressRange때 필요합니다.

자동화 에이전트 컴퓨터 풀의 시작 IP 주소(예: 196.21.30.50)를 지정합니다.


EndIpAddress - 끝 IP 주소
string; IpDetectionMethod = IPAddressRange때 필요합니다.

자동화 에이전트 컴퓨터 풀의 끝 IP 주소(예: 196.21.30.65)를 지정합니다.


작업이 종료된 후 규칙 삭제 DeleteFirewallRule -
boolean; 기본값은 true입니다.

이 옵션을 선택하면 작업이 종료된 후 여기에 지정된 IP 주소가 Azure SQL Server 방화벽의 허용된 IP 주소 목록에서 삭제됩니다.


작업 제어 옵션

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

출력 변수

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

SqlDeploymentOutputFile
배포 패키지 작업이 Extract, Export, Script, DriftReport또는 DeployReport경우 생성된 출력 파일 경로입니다.

비고

이 작업을 사용하여 DACPAC를 사용하여 Azure SQL 데이터베이스를 배포하거나 SQLCMD를 사용하여 스크립트를 실행합니다.

중요합니다

이 작업은 Windows 환경에서만 지원됩니다. Azure AD(Azure Active Directory) 통합 인증을 사용하려는 경우 프라이빗 에이전트를 만들어야 합니다. 호스트된 에이전트에는 Azure AD 통합 인증이 지원되지 않습니다.

요구 사항

요구 사항 설명
파이프라인 유형 YAML, 클래식 빌드, 클래식 릴리스
다음에서 실행 에이전트
요구 자체 호스팅 에이전트에는 다음 요구 사항과 일치하는 기능 있어야 이 작업을 사용하는 작업을 실행해야 합니다. sqlpackage
기능 이 작업은 작업의 후속 작업에 대한 요구 사항을 충족하지 않습니다.
명령 제한 어느 것이든
settable 변수 어느 것이든
에이전트 버전 1.103.0 이상
작업 범주 배치하다