Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/your-azure-coach/bicep-azdevops
Automating your Azure infrastructure with Bicep and Azure DevOps!
https://github.com/your-azure-coach/bicep-azdevops
Last synced: about 2 months ago
JSON representation
Automating your Azure infrastructure with Bicep and Azure DevOps!
- Host: GitHub
- URL: https://github.com/your-azure-coach/bicep-azdevops
- Owner: your-azure-coach
- Created: 2021-09-21T18:19:14.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-03-30T08:13:02.000Z (almost 3 years ago)
- Last Synced: 2024-08-03T17:11:23.802Z (5 months ago)
- Language: C#
- Size: 1.11 MB
- Stars: 10
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AWESOME-Azure-Bicep - your-azure-coach/bicep-azdevops
README
# Bicep
This demo showcases how you can create an Azure PaaS solution with Bicep.
## Prerequisites
* Have Azure CLI installed
* Visual Studio Extension for Bicep language support
* Install Bicep```
az bicep install
```## Create bicep file
* Create an `infra.bicep` file
* Open in Visual Studio Code
* Use often `Ctrl + Space` to get some intellisense
* Configure the targetScope
```
targetScope = 'subscription'
```## Configure parameters
* Configure the parameters as provided in the `infra.bicep` file
## Configure variables
* Configure the variables as provided in the `infra.bicep` file
## Configure resource group
* Create a resource group with the `required properties` intellisense
* Complete like in the `infra.bicep` file
## Deploy the template
* Open PowerShell
* Login with Azure CLi and select the right subscription
```cli
az logout
az login --tenant
az account set --subscription
cd infra
```* Deploy the Bicep template without passing parameters
```cli
az deployment sub create --location 'westeurope' --template-file infra.bicep
```* Provide the mandatory parameters inline:
* **env:** dev
* **storageAccountSku:** Standard_LRS
* **appServicePlanSku:** F1* Deploy the Bicep template with inline **incorrect** parameters
```cli
az deployment sub create --location 'westeurope' --template-file infra.bicep --parameters env=develop
```* Deploy the Bicep template with inline **correct** parameters
```cli
az deployment sub create --location 'westeurope' --template-file infra.bicep --parameters env=dev storageAccountSku=Standard_LRS appServicePlanSku=F1
```* Create an ARM parameter file `infra.parameters.dev.json`
```json
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentParameters.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"env": {
"value": "dev"
},
"storageAccountSku": {
"value": "Standard_LRS"
},
"appServicePlanSku": {
"value": "F1"
},
"location": {
"value": "westeurope"
}
}
}
```* Deploy the Bicep template with the parameter file
```cli
az deployment sub create --location 'westeurope' --template-file infra.bicep --parameters ./infra.parameters.dev.json
```## Create Storage Account
* Create new module in `modules` subfolder, named `storageaccount.bicep`
* This showcases loop
* This showcases parents
* This showcases outputs* Consume this module from within the `infra.bicep` file
## Show complete example
* Visualize the Bicep file via `F1 > bicep: Open Visualizer `