Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: Azure CI
name: Azure Bicep - Plan & Deploy

# Controls when the action will run.
on:
Expand All @@ -25,18 +25,13 @@ jobs:
uses: azure/login@v1
with:
creds: ${{ secrets.AZURE_CREDENTIALS }}

- name: Azure CLI - Show Status
uses: azure/CLI@v1
with:
azcliversion: 2.20.0
inlineScript: |
az account show

- name: Azure CLI - Plan
if: github.event_name == 'pull_request'
uses: azure/CLI@v1
with:
azcliversion: 2.20.0
inlineScript: |
az deployment sub what-if --location 'West Europe' --no-prompt --template-file $GITHUB_WORKSPACE/Templates/main.bicep
az account show
az bicep install
az bicep --help
az deployment sub what-if --location 'Switzerland North' -f $GITHUB_WORKSPACE/Templates/main.bicep -p location='switzerlandnorth'
23 changes: 23 additions & 0 deletions Templates/Modules/network.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
param location string = resourceGroup().location
param vnetName string
param vnetRange string
param subnetAdresses array
param subnetNames array

resource vnet 'Microsoft.Network/virtualNetworks@2020-08-01' = {
name : vnetName
location : location
properties : {
addressSpace : {
addressPrefixes : [
vnetRange
]
}
subnets : [for (adress, i) in subnetAdresses: {
name : subnetNames[i]
properties : {
addressPrefix : adress
}
}]
}
}
3 changes: 0 additions & 3 deletions Templates/Modules/sessionHost.bicep

This file was deleted.

44 changes: 43 additions & 1 deletion Templates/main.bicep
Original file line number Diff line number Diff line change
@@ -1,7 +1,49 @@
targetScope = 'subscription'

// General parameter
@allowed([
'switzerlandnorth'
'westeurope'
'centralus'
'centralindia'
])
param location string = 'switzerlandnorth'

@allowed([
'production'
'development'
'test'
])
param environment string

// Virtual network parameter
param vnet1Name string = 'network1'
param vnet1Range string = '10.100.0.0/16'
param vnet1SubnetAdresses array = [
'10.100.1.0/24'
'10.100.2.0/24'
'10.100.3.0/24'
]
param vnet1SubnetNames array = [
'GatewaySubnet'
'BastionSubnet'
'FirewallSubnet'
]

param vnet2Name string = 'network2'
param vnet2Range string = '10.101.0.0/16'
param vnet2SubnetAdresses array = [
'10.101.1.0/24'
'10.101.2.0/24'
'10.101.3.0/24'
]
param vnet2SubnetNames array = [
'GatewaySubnet'
'BastionSubnet'
'FirewallSubnet'
]

// Resource Group variables
var rgName_Network = 'rg-network-sn-01'
var rgName_Storage = 'rg-storage-sn-01'
var rgName_Vault = 'rg-vault-sn-01'
Expand Down Expand Up @@ -33,4 +75,4 @@ resource rg_wvd 'Microsoft.Resources/resourceGroups@2020-06-01' = {
resource rg_hosts 'Microsoft.Resources/resourceGroups@2020-06-01' = {
name: rgName_WvdHosts
location: location
}
}
4 changes: 4 additions & 0 deletions plan.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Script for What-If deployments

echo 'Start evaluating deployment...'
az deployment sub what-if --name 'bicep-development' --location 'Switzerland North' -f ./Templates/main.bicep -p location='switzerlandnorth'