Skip to content

Commit 9a70e29

Browse files
docs: azdo pipeline
1 parent 4e0c82c commit 9a70e29

File tree

6 files changed

+95
-3
lines changed

6 files changed

+95
-3
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
2+
# Deploy infrastructure using GitHub Actions
3+
4+
!!! info "Module Duration"
5+
30 minutes
6+
7+
Azure Devops pipeline is another great way to automate your workflow. In this section, we will create a Azure Devops Pipeline to
8+
deploy the infrastructure components of our application.
9+
10+
The workshop repository contains a Azure Devops Pipeline yaml file that will be used to deploy the infrastructure
11+
components of our application. Follow the steps below to create a devops pipeline to deploy the
12+
infrastructure components of our application.
13+
14+
### Fork the GitHub repository
15+
16+
Start by forking the workshop repository to your GitHub account. Follow the steps below to fork the workshop:
17+
18+
1. Navigate to the workshop repository at [:material-github: Azure/aca-dotnet-workshop](https://github.com/Azure/aca-dotnet-workshop){target=_blank}
19+
2. Click the **Fork** button in the top-right corner of the page.
20+
3. Select your GitHub account to fork the repository to.
21+
4. Wait for the repository to be forked.
22+
23+
### Configure Service Connection for GitHub and Azure Subscription
24+
25+
Before we start with creating pipeline, we need to configure service connection for GitHub and Azure Subscription. You can do this in either existing or new project.
26+
27+
#### Create Service Connection for GitHub
28+
29+
Provide access to the repository forked above by creating a service connection to GitHub. You create a new pipeline
30+
by first selecting a GitHub repository and then a YAML file in repository at path [.ado/infra-deploy.yml](https://raw.githubusercontent.com/Azure/aca-dotnet-workshop/main/.ado/infra-deploy.yml){target=_blank}.
31+
32+
The repository in which the YAML file is present is called self repository. By default, this is the repository that your pipeline builds.
33+
34+
There are three authentication types for granting Azure Pipelines access to your GitHub repositories while creating
35+
a pipeline. Follow guide at [this link](https://learn.microsoft.com/en-us/azure/devops/pipelines/repos/github?view=azure-devops&tabs=yaml#access-to-github-repositories){target=_blank}
36+
to create service connection for GitHub.
37+
38+
39+
![AZDO GitHub Connection](../../assets/gifs/azdo-github-connection.gif)
40+
41+
#### Create Service Connection for Azure Subscription
42+
43+
Create new service connection to your azure subscription by following steps at [this link](https://docs.microsoft.com/en-us/azure/devops/pipelines/library/service-endpoints?view=azure-devops&tabs=yaml#create-a-service-connection){target=_blank}
44+
45+
!!! note
46+
Update the created service connection role to have **[User Access Administrator](https://learn.microsoft.com/en-us/azure/role-based-access-control/built-in-roles#user-access-administrator)** role.
47+
This is required for pipeline to be able to perform role assignments in the infrastructure components deployed.
48+
49+
### Configure Variable group under Library
50+
51+
Create a variable group named **AcaApp** under Library in your Azure Devops project. Make sure the pipeline has
52+
permissions to access the created variable group under **Pipeline permissions**.
53+
54+
This variable group will be used to store below details:
55+
56+
```bash
57+
# AZURE_SUBSCRIPTION: Name of the service connection created for Azure Subscription
58+
AZURE_SUBSCRIPTION=<service connection name>
59+
60+
# LOCATION: Azure region where resources will be deployed
61+
LOCATION=<location>
62+
63+
# RESOURCE_GROUP: Name of the resource group which will be created and resources will be deployed
64+
RESOURCE_GROUP=<resource group name>
65+
66+
# (OPTIONAL)CONTAINER_REGISTRY_NAME: Unique name of the container registry which will be created and where images will be imported
67+
CONTAINER_REGISTRY_NAME=<container registry name>
68+
```
69+
70+
!!! note
71+
72+
Repository variables `CONTAINER_REGISTRY_NAME` is only needed by pipeline, if you wish the images to be deployed from private ACR.
73+
74+
You may chose to skip defining this variable and the pipeline will use the [public github container registry images](https://github.com/orgs/Azure/packages?repo_name=aca-dotnet-workshop) to deploy the images.
75+
76+
### Trigger Azure Devops Pipeline
77+
78+
With these steps completed, you are now ready to trigger the Pipeline.
79+
80+
!!! success
81+
82+
Your Pipeline should be triggered and the infrastructure components of our application should be deployed successfully.
83+
84+
![GitHub Actions Workflow](../../assets/gifs/azdo-trigger.gif)
85+
86+
87+
??? info "Want to delete the resources deployed by the pipeline?"
88+
89+
Trigger the pipeline again select **checkbox** option named **Should teardown infrastructure?**.
90+
91+
![GitHub Actions Workflow](../../assets/gifs/azdo-delete.gif)

docs/aca/10-aca-iac-bicep/iac-bicep.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,13 +323,13 @@ Next, we will prepare container images for the three container apps and update t
323323
"value": "<CONTAINER_REGISTRY_NAME>"
324324
},
325325
"backendProcessorServiceImage": {
326-
"value": "<CONTAINER_REGISTRY_NAME>.azurecr.io/tasksmanager/<BACKEND_API_NAME>:latest"
326+
"value": "<CONTAINER_REGISTRY_NAME>.azurecr.io/tasksmanager/tasksmanager-backend-processor:latest"
327327
},
328328
"backendApiServiceImage": {
329-
"value": "<CONTAINER_REGISTRY_NAME>.azurecr.io/tasksmanager/<FRONTEND_WEBAPP_NAME>:latest"
329+
"value": "<CONTAINER_REGISTRY_NAME>.azurecr.io/tasksmanager/tasksmanager-backend-api:latest"
330330
},
331331
"frontendWebAppServiceImage": {
332-
"value": "<CONTAINER_REGISTRY_NAME>.azurecr.io/tasksmanager/<BACKEND_SVC_NAME>:latest"
332+
"value": "<CONTAINER_REGISTRY_NAME>.azurecr.io/tasksmanager/tasksmanager-frontend-webapp:latest"
333333
}
334334
}
335335
```

docs/assets/gifs/azdo-delete.gif

898 KB
Loading
1.8 MB
Loading

docs/assets/gifs/azdo-trigger.gif

1.21 MB
Loading

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ nav:
2222
- aca/10-aca-iac-bicep/index.md
2323
- Build the Infrastructure as Code Using Bicep: aca/10-aca-iac-bicep/iac-bicep.md
2424
- Deploy infrastructure using GitHub Actions: aca/10-aca-iac-bicep/ci-cd-git-action.md
25+
- Deploy infrastructure using Azure Devops Pipeline: aca/10-aca-iac-bicep/ci-cd-azdo.md
2526
- About The Authors: aca/11-about-the-authors/index.md
2627
- Contributing:
2728
- Contribution Guide: aca/12-contributing/1-contribution-guide.md

0 commit comments

Comments
 (0)