Skip to content

Commit 0081582

Browse files
Wael Kdouhpankajagrawal16
authored andcommitted
devops docs refactoring
1 parent 9a70e29 commit 0081582

File tree

6 files changed

+49
-43
lines changed

6 files changed

+49
-43
lines changed

.github/workflows/infra-deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ jobs:
137137
az acr import --name ${{ vars.CONTAINER_REGISTRY_NAME }} --source ${{ env.REGISTRY }}/${{ env.BACKEND_API_IMAGE_NAME }}:latest --image tasksmanager/tasksmanager-backend-api --force
138138
az acr import --name ${{ vars.CONTAINER_REGISTRY_NAME }} --source ${{ env.REGISTRY }}/${{ env.FRONTEND_APP_IMAGE_NAME }}:latest --image tasksmanager/tasksmanager-frontend-webapp --force
139139
140-
# This job deploys the bicep template to Azure subscription either using ACR images
140+
# This job deploys the bicep template to Azure subscription using ACR images
141141
deploy-with-acr-images:
142142
runs-on: ubuntu-latest
143143
if : ${{ github.event.inputs.teardown != 'true' }}

docs/aca/10-aca-iac-bicep/ci-cd-azdo.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11

2-
# Deploy infrastructure using GitHub Actions
2+
# Deploy Infrastructure Using Azure DevOps
33

44
!!! info "Module Duration"
55
30 minutes
66

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.
7+
In the [previous section](../../aca/10-aca-iac-bicep/iac-bicep.md), we demonstrated how Bicep scripts can be used to automate the deployment of infrastructure components. However, creating the container registry and deploying the Bicep scripts using the Azure CLI still required manual effort. For a more efficient and streamlined process, it's preferable to use automation. Azure DevOps is a great solution for automating workflows, and in this section, we'll explain how to create a Azure DevOps pipeline for deploying the infrastructure components of our application.
98

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.
9+
The workshop repository contains a Azure Devops Pipeline yaml file that will be used to deploy the infrastructure components of our application. Follow the steps below to create a devops pipeline to deploy the infrastructure components of our application.
10+
11+
!!! note
12+
The following instructions assume that you will utilize the forked Github repository both as the host for your YAML pipeline and the source code. However, it is possible to host the same assets in your Azure DevOps repository instead, if that is your preference. It is important to remember that if you choose to store your assets in your Azure DevOps repository, you will have to direct your Azure DevOps pipeline towards the Azure DevOps repository instead of the Github repository.
1313

1414
### Fork the GitHub repository
1515

@@ -20,14 +20,13 @@ Start by forking the workshop repository to your GitHub account. Follow the step
2020
3. Select your GitHub account to fork the repository to.
2121
4. Wait for the repository to be forked.
2222

23-
### Configure Service Connection for GitHub and Azure Subscription
23+
### Configure a Service Connection for GitHub and Azure Subscription
2424

2525
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.
2626

27-
#### Create Service Connection for GitHub
27+
#### Create a Service Connection for GitHub
2828

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}.
29+
Provide access to the repository forked above by creating a service connection to GitHub. You create a new pipeline 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}.
3130

3231
The repository in which the YAML file is present is called self repository. By default, this is the repository that your pipeline builds.
3332

@@ -40,16 +39,28 @@ to create service connection for GitHub.
4039

4140
#### Create Service Connection for Azure Subscription
4241

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}
42+
Create a new service connection to your azure subscription by following the 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}.
4443

4544
!!! 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.
45+
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. This is required for pipeline to be able to perform role assignments in the infrastructure components deployed. To update the role of a service connection in Azure DevOps to have the User Access Administrator role, you can follow these steps:
46+
47+
- Navigate to the Azure portal and select the subscription where the service connection is created.
48+
49+
- Click on **Access control (IAM)** in the left-hand menu.
50+
51+
- Click on **Add role assignment**.
4852

49-
### Configure Variable group under Library
53+
- For the **Assignment type** choose **Privileged administrator roles**.
5054

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**.
55+
- In the **Role** section choose **User Access Administrator**.
56+
57+
- In the **Members** section, search for the name of the service connection that you want to update and select it.
58+
59+
- Click **Save** to apply the changes.
60+
61+
### Configure Variable Group under Azure DevOps Library Section
62+
63+
Create a variable group named **AcaApp** under Library in your Azure Devops project. Make sure the pipeline has permissions to access the created variable group under **Pipeline permissions**.
5364

5465
This variable group will be used to store below details:
5566

@@ -60,7 +71,7 @@ AZURE_SUBSCRIPTION=<service connection name>
6071
# LOCATION: Azure region where resources will be deployed
6172
LOCATION=<location>
6273

63-
# RESOURCE_GROUP: Name of the resource group which will be created and resources will be deployed
74+
# RESOURCE_GROUP: Name of the resource group which will be created and where the resources will be deployed
6475
RESOURCE_GROUP=<resource group name>
6576

6677
# (OPTIONAL)CONTAINER_REGISTRY_NAME: Unique name of the container registry which will be created and where images will be imported
@@ -69,9 +80,7 @@ CONTAINER_REGISTRY_NAME=<container registry name>
6980

7081
!!! note
7182

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.
83+
Repository variable `CONTAINER_REGISTRY_NAME` is only needed by pipeline if you intend to deploy images from a private Azure Container Registry (ACR). 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.
7584

7685
### Trigger Azure Devops Pipeline
7786

docs/aca/10-aca-iac-bicep/ci-cd-git-action.md

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11

2-
# Deploy infrastructure using GitHub Actions
2+
# Deploy Infrastructure Using GitHub Actions
33

44
!!! info "Module Duration"
55
30 minutes
66

7-
GitHub Actions is a great way to automate your workflow. In this section, we will create a GitHub Action workflow to
8-
deploy the infrastructure components of our application.
7+
In the [previous section](../../aca/10-aca-iac-bicep/iac-bicep.md), we demonstrated how Bicep scripts can be used to automate the deployment of infrastructure components. However, creating the container registry and deploying the Bicep scripts using the Azure CLI still required manual effort. For a more efficient and streamlined process, it's preferable to use automation. GitHub Actions is a great solution for automating workflows, and in this section, we'll explain how to create a GitHub Action workflow for deploying the infrastructure components of our application.
98

10-
The workshop repository contains a GitHub Action workflow file that will be used to deploy the infrastructure
11-
components of our application. Follow the steps below to create a GitHub Action workflow to deploy the
12-
infrastructure components of our application.
9+
The workshop repository contains a GitHub Action workflow file that will be used to deploy the infrastructure components of our application. Follow the steps below to create a GitHub Action workflow to deploy the infrastructure components of our application.
1310

1411
### Fork the GitHub repository
1512

@@ -109,8 +106,7 @@ locally, follow the steps below to configure the repository for OIDC authenticat
109106

110107
### Configure GitHub Repository Secrets
111108

112-
Configure secrets details in GitHub repo as described here in [create GitHub secrets](https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-cli%2Clinux#create-github-secrets).
113-
Use below values mapped to relevant secrets in GitHub.
109+
Configure secrets details in GitHub repo as described here in [create GitHub secrets](https://learn.microsoft.com/en-us/azure/developer/github/connect-from-azure?tabs=azure-cli%2Clinux#create-github-secrets). Use below values mapped to relevant secrets in GitHub.
114110

115111
```bash
116112
# AZURE_SUBSCRIPTION_ID
@@ -123,11 +119,11 @@ echo $APP_ID
123119

124120
### Configure GitHub Repository Variables
125121

126-
Configure repository variables as shown below:
122+
Configure repository variables in GitHub repo as described here in [create GitHub variables](https://docs.github.com/en/actions/learn-github-actions/variables). Use below values mapped to relevant variables in GitHub.
127123

128124
```bash
129125
# LOCATION: Azure region where resources will be deployed
130-
LOCATION=<location>
126+
LOCATION=<location. e.g. eastus>
131127

132128
# RESOURCE_GROUP: Name of the resource group which will be created and resources will be deployed
133129
RESOURCE_GROUP=<resource group name>
@@ -144,9 +140,7 @@ CONTAINER_REGISTRY_NAME=<container registry name>
144140

145141
### Trigger GitHub Actions Workflow
146142

147-
With these steps completed, you are now ready to trigger the GitHub Actions workflow name **Build and deploy
148-
infrastructure as code to Azure** using **workflow dispatch** to deploy the infrastructure components of our
149-
application.
143+
With these steps completed, you are now ready to trigger the GitHub Actions workflow named **Build and deploy infrastructure as code to Azure** using **workflow dispatch** to deploy the infrastructure components of the application.
150144

151145
!!! success
152146

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ canonical_url: https://bitoftech.net/2022/09/16/use-bicep-to-deploy-dapr-microse
77
!!! info "Module Duration"
88
30 minutes
99

10+
!!! note
11+
If you're not interested in manually deploying the Bicep files or creating the container registry yourself, and prefer not to delve into the details of how they work, then you can skip this section and head directly to either [Build the Infrastructure as Code Using Bicep and Github](../../aca/10-aca-iac-bicep/ci-cd-git-action.md) or [Build the Infrastructure as Code Using Bicep and Azure DevOps](../../aca/10-aca-iac-bicep/ci-cd-azdo.md) depending on your DevOps tool of choice.
12+
1013
To begin, we need to define the Bicep modules that will be required to generate the Infrastructure code. Our goal for this module is to have a freshly created resource group that encompasses all the necessary resources and configurations - such as connection strings, secrets, environment variables, and Dapr components - which we utilized to construct our solution. By the end, we will have a new resource group that includes the following resources.
1114

1215
![aca-resources](../../assets/images/10-aca-iac-bicep/aca-rescources.jpg)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
canonical_url: https://bitoftech.net/2022/09/16/use-bicep-to-deploy-dapr-microservices-apps-to-azure-container-apps-part-10/
33
---
44

5-
# Module 10 - Deployment Via Bicep
5+
# Module 10 - Deployment Via Bicep and DevOps
66

77
Throughout the various modules, we have utilized various Azure CLI commands to provision different resources. While this approach is suitable for this workshop, in a production environment, you will likely require a more automated process to deploy the same resources. In this module, we will be working on defining the proper process to automate the infrastructure provisioning by creating the scripts/templates to provision the resources. This process is known as IaC (Infrastructure as Code).
88

mkdocs.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,22 @@ nav:
1515
- Module 4 - ACA State Store With Dapr State Management API: aca/04-aca-dapr-stateapi/index.md
1616
- Module 5 - ACA Async Communication with Dapr Pub/Sub API: aca/05-aca-dapr-pubsubapi/index.md
1717
- Module 6 - ACA with Dapr Bindings Building Block: aca/06-aca-dapr-bindingsapi/index.md
18-
- Module 7 - ACA scheduled jobs with Dapr Cron Binding: aca/07-aca-cron-bindings/index.md
18+
- Module 7 - ACA Scheduled Jobs with Dapr Cron Binding: aca/07-aca-cron-bindings/index.md
1919
- Module 8 - ACA Monitoring and Observability with Application Insights: aca/08-aca-monitoring/index.md
2020
- Module 9 - ACA Auto Scaling with KEDA: aca/09-aca-autoscale-keda/index.md
21-
- Module 10 - Use Bicep to Deploy Dapr Microservices Apps to ACA:
21+
- Module 10 - Deployment Via Bicep and DevOps:
2222
- aca/10-aca-iac-bicep/index.md
23-
- Build the Infrastructure as Code Using Bicep: aca/10-aca-iac-bicep/iac-bicep.md
24-
- Deploy infrastructure using GitHub Actions: aca/10-aca-iac-bicep/ci-cd-git-action.md
23+
- Deploy Infrastructure using Bicep: aca/10-aca-iac-bicep/iac-bicep.md
24+
- Deploy Infrastructure using Bicep via GitHub Actions: aca/10-aca-iac-bicep/ci-cd-git-action.md
2525
- Deploy infrastructure using Azure Devops Pipeline: aca/10-aca-iac-bicep/ci-cd-azdo.md
2626
- About The Authors: aca/11-about-the-authors/index.md
2727
- Contributing:
2828
- Contribution Guide: aca/12-contributing/1-contribution-guide.md
29-
- Submit an issue or suggestion: aca/12-contributing/2-Submit-issue-suggestion.md
30-
- Minor update or fix, new challenge: aca/12-contributing/3-minor-update-fix.md
29+
- Submit An Issue or Suggestion: aca/12-contributing/2-Submit-issue-suggestion.md
30+
- Minor Update or fix, New Challenge: aca/12-contributing/3-minor-update-fix.md
3131
- Appendix:
32-
- Debug and launch Dapr applications in VSCode: aca/13-appendix/01-run-debug-dapr-app-vscode.md
33-
- Testing changes locally or with GitHub Codespaces: aca/13-appendix/02-github-local-codespaces.md
32+
- Debug and Launch Dapr Applications in VSCode: aca/13-appendix/01-run-debug-dapr-app-vscode.md
33+
- Testing Changes Locally or with GitHub Codespaces: aca/13-appendix/02-github-local-codespaces.md
3434

3535
theme:
3636
name: material

0 commit comments

Comments
 (0)