You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/aca/10-aca-iac-bicep/index.md
+16-19Lines changed: 16 additions & 19 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -30,16 +30,12 @@ Within Azure there are two ways to create IaC. We can either use the [JSON ARM t
30
30
### Build the Infrastructure as Code Using Bicep
31
31
32
32
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.
To simplify the execution of the module, we will assume that you have already created latest images of three services and pushed them to a container registry. [This section](#deploy-the-infrastructure-and-create-the-components) below guides you through
37
38
different options of getting images pushed to either Azure Container Registry (ACR) or GitHub Container Registry (GHCR).
38
-
39
-
If we created and deployed container registery as part of the Bicep scripts, then we can't build and push images to the created ACR in an automated way because creating the three ACA container apps is reliant on ACR's images.
40
-
41
-
In a production setting, a DevOps pipeline would be in place to automate the whole process - commencing with ACR creation, followed by building and pushing docker images, and concluding with executing the
42
-
Bicep script to establish the remaining resources. As it is outside the scope of this workshop, we will not delve into the creation of a DevOps pipeline here.
43
39
44
40
#### 1. Add the Needed Extension to VS Code
45
41
To proceed, you must install an extension called [Bicep](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-bicep). This extension will simplify building Bicep files as it offers IntelliSense, Validation, listing all available resource types, etc..
@@ -300,7 +296,7 @@ This will result in creating a file named `main.parameters.json` similar to the
300
296
301
297
To use this file, you need to edit this generated file and provide values for the parameters. You can use the same values shown above in sample file.
302
298
303
-
You only need to replace parameter values between the angle brackets `<>` with values related to your container registry and SendGrid. Values for container registry and container images can be dervied by following
299
+
You only need to replace parameter values between the angle brackets `<>` with values related to your container registry and SendGrid. Values for container registry and container images can be derived by following
304
300
one of the three options in next step.
305
301
306
302
Next, we will prepare container images for the three container apps and update the values in `main.parameters.json` file. You can do so by any of the three options below:
@@ -311,37 +307,38 @@ Next, we will prepare container images for the three container apps and update t
311
307
312
308
```Powershell
313
309
$CONTAINER_REGISTRY_NAME="<your ACR name>"
310
+
314
311
315
312
az acr create `
316
313
--resource-group $RESOURCE_GROUP `
317
314
--name $CONTAINER_REGISTRY_NAME `
318
315
--sku Basic
319
316
```
320
317
321
-
2. Build and push the images to ACR as guided in [this section](../../aca/08-aca-monitoring/index.md#2-build-new-images-and-push-them-to-acr). Make sure you are at the root project directory when executing the following commands:
318
+
2. Build and push the images to ACR. Make sure you are at the root project directory when executing the following commands:
322
319
323
320
```Powershell
324
321
325
322
## Build Backend API on ACR and Push to ACR
326
323
327
324
az acr build --registry $CONTAINER_REGISTRY_NAME `
3. Update the `main.parameters.jsonc` file with the container registry name and the container images names as shown below:
397
+
3. Update the `main.parameters.json` file with the container registry name and the container images names as shown below:
401
398
402
399
```json hl_lines="3 6 9 12"
403
400
{
@@ -420,7 +417,7 @@ Next, we will prepare container images for the three container apps and update t
420
417
421
418
All the container image are available in a public image repository. If you do not wish to build the container images from code directly, you can use the pre-built images from the public repository as shown below.
422
419
423
-
The public images can be set directly in the `main.parameters.jsonc` file:
420
+
The public images can be set directly in the `main.parameters.json` file:
0 commit comments