Skip to content

Instructions 00 Azure Services

Christian Nagel edited this page Sep 28, 2023 · 2 revisions

Azure Services

The following Azure Service are used in the CodeBreaker Light solution:

  • Cosmos DB
  • Container Registry
  • Container Apps
  • Log Analytics
  • Application Insights

Codebreaker Azure services

To create this resources, we can use bicep-scripts.

Bicep scripts

In /infrastructure/bicep you can find the bicep-scripts for the resources listed above. The bicep-script _main.bicep combines the other bicep-scripts and is responsible for deploying all necessary Azure resources.

_main.bicep requires the following parameters:

  • userPrincipalIds (array) - The principal-ids (GUIDs) of the developer-accounts needing access to Azure resources from their local machine.
    To get the principal-id of your account run az ad signed-in-user show --query id in your commandline.
  • applyFreeTiers (bool) - Whether free tiers should be applied or not.
    Some Azure services only allow one free instance per subscription.
  • suffix (string) - The suffix used for resources, where a name collision might occur.

A bicep script can be deployed using different ways.

Azure CLI

https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deploy-cli

Login to Azure CLI (if not already).

az login

Deploy a bicep script to a resource group with default parameter values.

az deployment group create --resource-group <resource-group-name> --template-file <path-to-bicep>

Parameters can be specified using the --parameters flag.

az deployment group create --resource-group <resource-group-name> --template-file <path-to-bicep> --parameters parameter1=value1 parameter2=value2

Example _main.bicep

PowerShell: az deployment group create --resource-group <resource-group-name> --template-file _main.bicep --parameters userPrincipalIds="['00000000-0000-0000-0000-000000000000']" applyFreeTiers=true suffix=mysuffix43921

Visual Studio Code

https://learn.microsoft.com/en-us/azure/azure-resource-manager/bicep/deploy-vscode

In VS Code we can deploy a bicep script by right clicking a bicep script and clicking on Deploy bicep file....

VS Code will ask for input necessary to deploy the bicep script.

Clone this wiki locally