Skip to content

Commit 02dc4bf

Browse files
Update content
1 parent b5a38c4 commit 02dc4bf

7 files changed

Lines changed: 148 additions & 25 deletions

File tree

bicep/README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# main.bicep
2+
3+
## Usage
4+
5+
Here is a basic example of how to use this Bicep module:
6+
7+
```bicep
8+
module reference_name 'path_to_module | container_registry_reference' = {
9+
name: 'deployment_name'
10+
params: {
11+
// Required parameters
12+
environment:
13+
location:
14+
location_abbreviation:
15+
workload:
16+
17+
// Optional parameters
18+
rg_tags: {}
19+
}
20+
}
21+
```
22+
23+
> Note: In the default values, strings enclosed in square brackets (e.g. '[resourceGroup().location]' or '[__bicep.function_name(args...)']) represent function calls or references.
24+
25+
## Modules
26+
27+
| Symbolic Name | Source | Description |
28+
| --- | --- | --- |
29+
| compute | modules/compute/main.bicep | |
30+
31+
## Resources
32+
33+
| Symbolic Name | Type | Description |
34+
| --- | --- | --- |
35+
| rg | [Microsoft.Resources/resourceGroups](https://learn.microsoft.com/en-us/azure/templates/microsoft.resources/resourcegroups) | |
36+
37+
## Parameters
38+
39+
| Name | Type | Description | Default |
40+
| --- | --- | --- | --- |
41+
| environment | string | Name of the workloads environment | |
42+
| location | string | Azure region used for the deployment of all resources | |
43+
| location_abbreviation | string | Abbreviation fo the location | |
44+
| rg_tags | object | Tags to be applied on the resource group | {} |
45+
| workload | string | Name of the workload that will be deployed | |
46+
47+
## Variables
48+
49+
| Name | Description |
50+
| --- | --- |
51+
| rg_name | |
52+
| suffix | |
53+
| tags | |
54+
| webapp_name | |
55+
56+
## Outputs
57+
58+
| Name | Type | Description |
59+
| --- | --- | --- |
60+
| resource_groups | array | |
61+
| webapp_name | string | |

bicep/azure.deploy.parameters.json

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using '../main.bicep'
2+
3+
param location = 'northeurope'
4+
param location_abbreviation = 'ne'
5+
6+
param workload = 'dwg'
7+
param environment = 'dev'
8+
9+
param rg_tags = {}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
using '../main.bicep'
2+
3+
param location = 'northeurope'
4+
param location_abbreviation = 'ne'
5+
6+
param workload = 'dwg'
7+
param environment = 'prod'
8+
9+
param rg_tags = {}
Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// File: bicep/main.bicep
2+
13
targetScope = 'subscription'
24

35
/// Parameters ///
@@ -19,24 +21,27 @@ param rg_tags object = {}
1921

2022
/// Variables ///
2123

22-
var tags = union({
24+
var tags = union(
25+
{
2326
workload: workload
2427
environment: environment
25-
}, rg_tags)
28+
},
29+
rg_tags
30+
)
2631

2732
var rg_name = 'rg-${suffix}'
2833
var webapp_name = 'app-${suffix}'
2934
var suffix = '${workload}-${environment}-${location_abbreviation}'
3035

3136
/// Resources ///
3237

33-
resource rg 'Microsoft.Resources/resourceGroups@2022-09-01' = {
38+
resource rg 'Microsoft.Resources/resourceGroups@2024-07-01' = {
3439
name: rg_name
3540
location: location
3641
tags: tags
3742
}
3843

39-
module compute 'modules/compute.bicep' = {
44+
module compute 'modules/compute/main.bicep' = {
4045
scope: resourceGroup(rg_name)
4146
name: 'compute-deployment'
4247
params: {
@@ -55,6 +60,7 @@ module compute 'modules/compute.bicep' = {
5560
webapp_health_check_path: '/health'
5661
webapp_linux_fx_version: 'DOCKER|mcr.microsoft.com/appsvc/staticsite:latest'
5762
}
63+
5864
dependsOn: [
5965
rg
6066
]
@@ -63,4 +69,4 @@ module compute 'modules/compute.bicep' = {
6369
/// Outputs ///
6470

6571
output webapp_name string = webapp_name
66-
output resource_groups array = [ rg.name ]
72+
output resource_groups array = [rg.name]

bicep/modules/compute/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# modules/compute/main.bicep
2+
3+
## Usage
4+
5+
Here is a basic example of how to use this Bicep module:
6+
7+
```bicep
8+
module reference_name 'path_to_module | container_registry_reference' = {
9+
name: 'deployment_name'
10+
params: {
11+
// Required parameters
12+
location:
13+
plan_kind:
14+
plan_name:
15+
plan_reserved:
16+
plan_sku_capacity:
17+
plan_sku_name:
18+
plan_sku_tier:
19+
webapp_always_on:
20+
webapp_health_check_path:
21+
webapp_linux_fx_version:
22+
webapp_min_tls_version:
23+
webapp_name:
24+
25+
// Optional parameters
26+
}
27+
}
28+
```
29+
30+
> Note: In the default values, strings enclosed in square brackets (e.g. '[resourceGroup().location]' or '[__bicep.function_name(args...)']) represent function calls or references.
31+
32+
## Resources
33+
34+
| Symbolic Name | Type | Description |
35+
| --- | --- | --- |
36+
| app_svc_plan | [Microsoft.Web/serverfarms](https://learn.microsoft.com/en-us/azure/templates/microsoft.web/serverfarms) | |
37+
| webapp | [Microsoft.Web/sites](https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites) | |
38+
39+
## Parameters
40+
41+
| Name | Type | Description | Default |
42+
| --- | --- | --- | --- |
43+
| location | string | Location of all resources | |
44+
| plan_kind | string | Kind of the App Service Plan | |
45+
| plan_name | string | Name of the App Service Plan | |
46+
| plan_reserved | bool | Specifies whether the App Service Plan will be Linux (true) or Windows (false) | |
47+
| plan_sku_capacity | int | SKU capacity of the App Service Plan | |
48+
| plan_sku_name | string | SKU name of the App Service Plan | |
49+
| plan_sku_tier | string | SKU tier of the App Service Plan | |
50+
| webapp_always_on | bool | Specifies whether always on is enabled | |
51+
| webapp_health_check_path | string | Specifies the health check path | |
52+
| webapp_linux_fx_version | string | Linux App Framework and version | |
53+
| webapp_min_tls_version | string | Specifies the minimum TLS version | |
54+
| webapp_name | string | Name of the Webapp | |
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// File: compute/main.bicep
2+
13
/// Parameters ///
24

35
@description('Location of all resources')
@@ -38,7 +40,7 @@ param webapp_health_check_path string
3840

3941
/// Resources ///
4042

41-
resource app_svc_plan 'Microsoft.Web/serverfarms@2022-03-01' = {
43+
resource app_svc_plan 'Microsoft.Web/serverfarms@2024-04-01' = {
4244
name: plan_name
4345
location: location
4446
kind: plan_kind
@@ -52,7 +54,7 @@ resource app_svc_plan 'Microsoft.Web/serverfarms@2022-03-01' = {
5254
}
5355
}
5456

55-
resource webapp 'Microsoft.Web/sites@2022-03-01' = {
57+
resource webapp 'Microsoft.Web/sites@2024-04-01' = {
5658
name: webapp_name
5759
location: location
5860
properties: {

0 commit comments

Comments
 (0)