Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/keyvault-re…
Browse files Browse the repository at this point in the history
…ference-in-module-parameters-1028
  • Loading branch information
miqm committed Mar 8, 2021
2 parents c7d1d59 + 30cb620 commit 5069644
Show file tree
Hide file tree
Showing 15 changed files with 440 additions and 163 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/update-baselines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ jobs:

- name: Commit baselines
run: |
git config --global user.email "[email protected]"
git config --global user.name "Bicep Automation"
git add .
if ! git diff-index --quiet HEAD --; then
git commit -m "Update test baselines"
git push
Expand Down
184 changes: 92 additions & 92 deletions docs/examples/101/aks/main.json
Original file line number Diff line number Diff line change
@@ -1,93 +1,93 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsPrefix": {
"type": "string"
},
"linuxAdminUsername": {
"type": "string"
},
"sshRSAPublicKey": {
"type": "string"
},
"servicePrincipalClientId": {
"type": "string"
},
"servicePrincipalClientSecret": {
"type": "secureString"
},
"clusterName": {
"type": "string",
"defaultValue": "aks101cluster"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"osDiskSizeGB": {
"type": "int",
"defaultValue": 0,
"maxValue": 1023,
"minValue": 0
},
"agentCount": {
"type": "int",
"defaultValue": 3,
"maxValue": 50,
"minValue": 1
},
"agentVMSize": {
"type": "string",
"defaultValue": "Standard_DS2_v2"
}
},
"functions": [],
"resources": [
{
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-09-01",
"name": "[parameters('clusterName')]",
"location": "[parameters('location')]",
"properties": {
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
{
"name": "agentpool",
"osDiskSizeGB": "[parameters('osDiskSizeGB')]",
"count": "[parameters('agentCount')]",
"vmSize": "[parameters('agentVMSize')]",
"osType": "Linux"
}
],
"linuxProfile": {
"adminUsername": "[parameters('linuxAdminUsername')]",
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "[parameters('servicePrincipalClientId')]",
"secret": "[parameters('servicePrincipalClientSecret')]"
}
}
}
],
"outputs": {
"controlPlaneFQDN": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))).fqdn]"
}
},
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "4675384475882014116"
}
}
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"dnsPrefix": {
"type": "string"
},
"linuxAdminUsername": {
"type": "string"
},
"sshRSAPublicKey": {
"type": "string"
},
"servicePrincipalClientId": {
"type": "string"
},
"servicePrincipalClientSecret": {
"type": "secureString"
},
"clusterName": {
"type": "string",
"defaultValue": "aks101cluster"
},
"location": {
"type": "string",
"defaultValue": "[resourceGroup().location]"
},
"osDiskSizeGB": {
"type": "int",
"defaultValue": 0,
"maxValue": 1023,
"minValue": 0
},
"agentCount": {
"type": "int",
"defaultValue": 3,
"maxValue": 50,
"minValue": 1
},
"agentVMSize": {
"type": "string",
"defaultValue": "Standard_DS2_v2"
}
},
"functions": [],
"resources": [
{
"type": "Microsoft.ContainerService/managedClusters",
"apiVersion": "2020-09-01",
"name": "[parameters('clusterName')]",
"location": "[parameters('location')]",
"properties": {
"dnsPrefix": "[parameters('dnsPrefix')]",
"agentPoolProfiles": [
{
"name": "agentpool",
"osDiskSizeGB": "[parameters('osDiskSizeGB')]",
"count": "[parameters('agentCount')]",
"vmSize": "[parameters('agentVMSize')]",
"osType": "Linux"
}
],
"linuxProfile": {
"adminUsername": "[parameters('linuxAdminUsername')]",
"ssh": {
"publicKeys": [
{
"keyData": "[parameters('sshRSAPublicKey')]"
}
]
}
},
"servicePrincipalProfile": {
"clientId": "[parameters('servicePrincipalClientId')]",
"secret": "[parameters('servicePrincipalClientSecret')]"
}
}
}
],
"outputs": {
"controlPlaneFQDN": {
"type": "string",
"value": "[reference(resourceId('Microsoft.ContainerService/managedClusters', parameters('clusterName'))).fqdn]"
}
},
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "4675384475882014116"
}
}
}
61 changes: 61 additions & 0 deletions docs/examples/101/app-service-regional-vnet-integration/main.bicep
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
param location string
param nameprefix string

param vnetAddressPrefix string = '10.0.0.0/16'
param subnetAddressPrefix string = '10.0.0.0/24'

resource appsvc 'Microsoft.Web/serverfarms@2020-06-01' = {
name: '${nameprefix}asp'
location: location
sku: {
name: 'S1'
}
}

resource vnet 'Microsoft.Network/virtualNetworks@2020-06-01' = {
name: '${nameprefix}vnet'
location: location
properties: {
addressSpace: {
addressPrefixes: [
vnetAddressPrefix
]
}
subnets: [
{
name: '${nameprefix}sn'
properties: {
addressPrefix: subnetAddressPrefix
delegations: [
{
name: 'delegation'
properties: {
serviceName: 'Microsoft.Web/serverFarms'
}
}
]
}
}
]
}
}

resource webapp1 'Microsoft.Web/sites@2020-06-01' = {
name: '${nameprefix}wa'
location: location
kind: 'app'
dependsOn: [
appsvc
vnet
]
properties: {
serverFarmId: appsvc.id
}
}

resource webapp1vnet 'Microsoft.Web/sites/networkConfig@2020-06-01' = {
name: '${webapp1.name}/virtualNetwork'
properties: {
subnetResourceId: vnet.properties.subnets[0].id
}
}
94 changes: 94 additions & 0 deletions docs/examples/101/app-service-regional-vnet-integration/main.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"location": {
"type": "string"
},
"nameprefix": {
"type": "string"
},
"vnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/16"
},
"subnetAddressPrefix": {
"type": "string",
"defaultValue": "10.0.0.0/24"
}
},
"functions": [],
"resources": [
{
"type": "Microsoft.Web/serverfarms",
"apiVersion": "2020-06-01",
"name": "[format('{0}asp', parameters('nameprefix'))]",
"location": "[parameters('location')]",
"sku": {
"name": "S1"
}
},
{
"type": "Microsoft.Network/virtualNetworks",
"apiVersion": "2020-06-01",
"name": "[format('{0}vnet', parameters('nameprefix'))]",
"location": "[parameters('location')]",
"properties": {
"addressSpace": {
"addressPrefixes": [
"[parameters('vnetAddressPrefix')]"
]
},
"subnets": [
{
"name": "[format('{0}sn', parameters('nameprefix'))]",
"properties": {
"addressPrefix": "[parameters('subnetAddressPrefix')]",
"delegations": [
{
"name": "delegation",
"properties": {
"serviceName": "Microsoft.Web/serverFarms"
}
}
]
}
}
]
}
},
{
"type": "Microsoft.Web/sites",
"apiVersion": "2020-06-01",
"name": "[format('{0}wa', parameters('nameprefix'))]",
"location": "[parameters('location')]",
"kind": "app",
"properties": {
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', format('{0}asp', parameters('nameprefix')))]"
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', format('{0}asp', parameters('nameprefix')))]",
"[resourceId('Microsoft.Network/virtualNetworks', format('{0}vnet', parameters('nameprefix')))]"
]
},
{
"type": "Microsoft.Web/sites/networkConfig",
"apiVersion": "2020-06-01",
"name": "[format('{0}/virtualNetwork', format('{0}wa', parameters('nameprefix')))]",
"properties": {
"subnetResourceId": "[reference(resourceId('Microsoft.Network/virtualNetworks', format('{0}vnet', parameters('nameprefix')))).subnets[0].id]"
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', format('{0}vnet', parameters('nameprefix')))]",
"[resourceId('Microsoft.Web/sites', format('{0}wa', parameters('nameprefix')))]"
]
}
],
"metadata": {
"_generator": {
"name": "bicep",
"version": "dev",
"templateHash": "12140943735656405647"
}
}
}
4 changes: 2 additions & 2 deletions docs/examples/101/web-app-windows/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var appServicePlanName = toLower('asp-${appName}')
var webSiteName = toLower('wapp-${appName}')

resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
name: appServicePlanName // Globally unique storage account name
name: appServicePlanName // app serivce plan name
location: location // Azure Region
sku: {
name: skuName
Expand All @@ -20,7 +20,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2020-06-01' = {
}

resource appService 'Microsoft.Web/sites@2020-06-01' = {
name: webSiteName
name: webSiteName // Globally unique app serivce name
location: location
identity: {
type: 'SystemAssigned'
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"filePath": "101/app-config/main.bicep",
"description": "101/app-config"
},
{
"filePath": "101/app-service-regional-vnet-integration/main.bicep",
"description": "101/app-service-regional-vnet-integration"
},
{
"filePath": "101/application-gateway-v2-autoscale-create/main.bicep",
"description": "101/application-gateway-v2-autoscale-create"
Expand Down
Loading

0 comments on commit 5069644

Please sign in to comment.