Controlling the Order of Your Bicep Deployment Using Dependencies

45 minutes
  • 4 Learning Objectives

About this Hands-on Lab

In this lab, we will exercise the ability to make sure that dependent resources are deployed in the correct order in a Bicep file. We will do this by adding individual dependent resources and parent/child resources that are separate and nested.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Add Individual Dependent Resources
  • Create a Bicep file called deploy.bicep to add and deploy resources with.
  • Add a Web App resource with an implicit dependency to an App Service plan.
  • Add the App Service plan.
Add Nested Parent/Child Resources
  • Add a storage account to the Bicep file.
  • Add a blob resource within the storage account resource named default.
  • Add a storage container resource within the blob resource.
Add Separate Parent/Child Resources
  • Add a storage account to the Bicep file.
  • Separately add a blob resource referencing the parent storage account.
  • Separately add a storage container resource referencing the parent blob resource.
Deploy File
  • Save the Bicep file and deploy it.
  • Check to ensure that dependencies have been deployed successfully.

Additional Resources

You should be familiar with the following to use this hands-on lab:

  • Bicep files
  • Azure Web Apps
  • Azure Storage
  • Azure Cloud Shell
  • Azure PowerShell/Azure CLI

GitHub file for this lab.

Note about lab startup:

When starting up the lab environement, you may see an error such as:

    An error occured when trying to fetch resources. Additional details from the underlying API that might be helpful: Please provide below info when asking for support: timestamp = 2022-02-08T18:43:45.8593786Z, correlationId = 11343c5a-9f20-4ef0-a67d-614bbe889e37. (Code: AccessDenied) Access is denied to the requested resource. The user might not have enough permission. (Code: AccessDenied) Try refreshing the page. Your resources aren't affected by the issue, we're just having trouble showing this view right now. To see a list of resources, select Simplified View.

This is a known error and can be disregarded. It will not prevent you from working in the lab environment.

Note about environment limitations:

Due to some limitations in the Cloud Playground/hands-on lab environment, there are some actions that are not permitted. One of them is that there are only certain resource sizes/SKUs that are permitted to be deployed.

How does this apply to our scenario?

  • We will be adding a Web App Service-plan resource to a Bicep file. Due to the Cloud Playground/hands-on lab environments, only the SKUs listed in this article can be used: Azure Cloud Sandbox.

I understand that this is a bit confusing due to the unique limitations of the ACG environment, so please feel free to reach out if you are experiencing problems or if you have any other questions.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?