Until now there was one environment, dev, and in 3.2.5 test once, briefly. From module 3.7 on, the pipeline delivers to dev, after an approval to prod, and test sits in between. All three are supposed to come from the same template. What differs between them is in exactly one place and is visible in review.

In this lesson, you set up dev and test side by side, in different sizes, and make sure that nothing that exists only on your machine matters for the result.

azd environments

An azd environment is a name with a few values: subscription, region and everything a deployment returns. The commands for it:

PowerShell
azd env new dev --location germanywestcentral
azd env new test --location germanywestcentral
azd env list
NAME      DEFAULT   LOCAL     REMOTE
dev       false     true      false
test      true      true      false

azd env new makes the new environment the default environment. You switch with azd env select dev; a single command takes another environment with --environment (-e for short) without changing the default, for example azd provision -e test. LOCAL means the values are on your machine; with a remote store, a team shares its environments, which the Kladde doesn't need.

You read and set values with azd env get-value, azd env get-values and azd env set:

PowerShell
azd env get-value AZURE_RESOURCE_GROUP -e test
rg-kladde-test

That works after the first azd provision of this environment, because only then does azd write the outputs of main.bicep into it.