forked from MicrosoftLearning/eShopOnWeb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheshoponweb-cd-webapp-code.yml
59 lines (49 loc) · 1.69 KB
/
eshoponweb-cd-webapp-code.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
#NAME THE PIPELINE SAME AS FILE (WITHOUT ".yml")
# Trigger CD when CI executed succesfully
resources:
pipelines:
- pipeline: eshoponweb-ci
source: eshoponweb-ci # given pipeline name
trigger: true
variables:
resource-group: 'AZ400-EWebShop-NAME'
location: 'westeurope'
templateFile: '.azure/bicep/webapp.bicep'
subscriptionid: 'YOUR-SUBSCRIPTION-ID'
azureserviceconnection: 'azure subs'
webappname: 'az400-webapp-NAME'
# webappname: 'webapp-windows-eshop'
stages:
- stage: Deploy
displayName: Deploy to WebApp
jobs:
- job: Deploy
pool:
vmImage: windows-latest
steps:
#download artifacts
- download: eshoponweb-ci
# Deploy App Service Plan + App Service using Bicep
- task: AzureResourceManagerTemplateDeployment@3
displayName: Deploy App Service Plan Bicep
inputs:
deploymentScope: 'Resource Group'
azureResourceManagerConnection: '$(azureserviceconnection)'
subscriptionId: '$(subscriptionid)'
action: 'Create Or Update Resource Group'
resourceGroupName: '$(resource-group)'
location: '$(location)'
templateLocation: 'Linked artifact'
csmFile: '$(templateFile)'
overrideParameters: '-webAppName $(webappname) -location $(location)'
deploymentMode: 'Incremental'
deploymentOutputs: 'asp-json'
#Publish Website to Azure WebApp
- task: AzureRmWebAppDeployment@4
displayName: Publish Website to WebApp
inputs:
ConnectionType: 'AzureRM'
azureSubscription: '$(azureserviceconnection)'
appType: 'webApp'
WebAppName: '$(webappname)'
packageForLinux: '$(Pipeline.Workspace)/**/Web.zip'