Infrastructure as Code (IaC)
I am sure you have noticed by now that some projects have a weird infra/ directoy with some *.json files and a README.md.
Structure
- <Project-name>/
|- <Project-name>.csproj
|- infra/
| |- azuredeploy.json
| |- parameters.dev.json
| |- parameters.prod.json
| |- ... <immediate dependencies>
|- ... <the project's source code>
Parameters
Regarding the parameters' files, the naming convention is simple:
parameters.(<project-name>.)<environment>.json
E.g.
parameters.dev.jsonparameters.talos.dev.json
Usage
-
Make sure you are logged in to the correct tenant/subscription.
az login -
Go to the project's
infra/directory inside of a terminal.cd <Project's path> -
Deploy the script.
az deployment group create --resource-group <resource-group> --template-file infra/azuredeploy.json --parameters 'infra/parameters.<environment>.json'