-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathazure-pipelines.yml
66 lines (58 loc) · 1.86 KB
/
azure-pipelines.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
trigger:
- master
# The source used by the pipeline
resources:
- repo: self
variables:
# Container registry service connection established during pipeline creation
azureSubscriptionName: 'your-azure-subscription-name'
dockerRegistryServiceConnection: 'your-docker-registry-connection-number'
dockerfilePath: '$(Build.SourcesDirectory)/taskapp/taskapp/Dockerfile'
tag: '$(Build.BuildId)'
# Agent VM image name
vmImageName: 'windows-latest'
# Build stage to build your application and push it to a registry
stages:
- stage: Build
displayName: Build and push stage
jobs:
- job: Build
displayName: Build
pool:
vmImage: $(vmImageName)
steps:
# Build and push Docker task to push to ACR
- task: Docker@2
displayName: Build and push an image to container registry
inputs:
command: buildAndPush
repository: '$(imageRepository)'
dockerfile: $(dockerfilePath)
containerRegistry: $(dockerRegistryServiceConnection)
tags: |
$(tag)
# Deploy stage to your App Service and Azure SQL Database
- stage: Deploy
displayName: Deploy to App Service and Azure SQL
jobs:
- job: Deploy
displayName: Deploy
pool:
vmImage: $(vmImageName)
steps:
# Deploy to Azure App Service
- task: AzureWebAppContainer@1
inputs:
azureSubscription: '$(azureSubscriptionName)'
appName: '$(applicationName)'
containers: '$(containerRegistry)/$(imageRepository):$(tag)'
# Deploy to Azure SQL
- task: SqlAzureDacpacDeployment@1
inputs:
azureSubscription: '$(azureSubscriptionName)'
AuthenticationType: 'connectionString'
ConnectionString: '$(azureSQLConnectionString)'
deployType: 'DacpacTask'
DeploymentAction: 'Publish'
DacpacFile: '$(Build.SourcesDirectory)/data.dacpac'
IpDetectionMethod: 'AutoDetect'