-
Notifications
You must be signed in to change notification settings - Fork 124
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add bicep templates for the beginner bicep tutorials
- Loading branch information
Showing
12 changed files
with
479 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
param projectName string { | ||
minLength: 3 | ||
maxLength: 11 | ||
metadata: { | ||
description: 'Specify a project name that is used to generate resource names.' | ||
} | ||
} | ||
param location string { | ||
metadata: { | ||
description: 'Specify a location for the resources.' | ||
} | ||
default: resourceGroup().location | ||
} | ||
param linuxFxVersion string { | ||
metadata: { | ||
description: 'Specify the Runtime stack of current web app' | ||
} | ||
default: 'php|7.0' | ||
} | ||
param linkedTemplateUri string{ | ||
metadata: { | ||
description: 'The Uri of the linked template.' | ||
} | ||
} | ||
var storageAccountName_var = concat(projectName, uniqueString(resourceGroup().id)) | ||
var webAppName_var = '${projectName}WebApp' | ||
var appServicePlanName_var = '${projectName}Plan' | ||
|
||
resource linkedTemplate 'Microsoft.Resources/deployments@2018-05-01' = { | ||
name: linkedTemplateUri | ||
|
||
} | ||
|
||
resource appServicePlanName 'Microsoft.Web/serverfarms@2020-09-01' = { | ||
name: appServicePlanName_var | ||
location: location | ||
sku: { | ||
name: 'B1' | ||
tier: 'Basic' | ||
size: 'B1' | ||
family: 'B' | ||
capacity: 1 | ||
} | ||
kind: 'linux' | ||
properties: { | ||
perSiteScaling: false | ||
reserved: true | ||
targetWorkerCount: 0 | ||
targetWorkerSizeId: 0 | ||
} | ||
} | ||
|
||
resource webAppName 'Microsoft.Web/sites@2020-09-01' = { | ||
name: webAppName_var | ||
location: location | ||
kind: 'app' | ||
properties: { | ||
serverFarmId: appServicePlanName.id | ||
siteConfig: { | ||
linuxFxVersion: linuxFxVersion | ||
} | ||
} | ||
} | ||
|
||
output storageEndpoint object = reference(storageAccountName_var).primaryEndpoints |
40 changes: 40 additions & 0 deletions
40
get-started-deployment/linked-template/linkedStorageAcceount.bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
param storageAccountName string { | ||
metadata: { | ||
description: 'Specify the storage account name.' | ||
} | ||
} | ||
param location string { | ||
metadata: { | ||
description: 'Specify a location for the resources.' | ||
} | ||
} | ||
param storageSKU string { | ||
allowed: [ | ||
'Standard_LRS' | ||
'Standard_GRS' | ||
'Standard_RAGRS' | ||
'Standard_ZRS' | ||
'Premium_LRS' | ||
'Premium_ZRS' | ||
'Standard_GZRS' | ||
'Standard_RAGZRS' | ||
] | ||
metadata: { | ||
description: 'Specify the storage account type.' | ||
} | ||
default: 'Standard_LRS' | ||
} | ||
|
||
resource storageAccountName_resource 'Microsoft.Storage/storageAccounts@2019-04-01' = { | ||
name: storageAccountName | ||
location: location | ||
sku: { | ||
name: storageSKU | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} | ||
|
||
output storageEndpoint object = reference(storageAccountName).primaryEndpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
param storageName string { | ||
minLength: 3 | ||
maxLength: 24 | ||
} | ||
param storageSKU string { | ||
allowed: [ | ||
'Standard_LRS' | ||
'Standard_GRS' | ||
'Standard_RAGRS' | ||
'Standard_ZRS' | ||
'Premium_LRS' | ||
'Premium_ZRS' | ||
'Standard_GZRS' | ||
'Standard_RAGZRS' | ||
] | ||
default: 'Standard_LRS' | ||
} | ||
param location string = resourceGroup().location | ||
|
||
resource storageName_resource 'Microsoft.Storage/storageAccounts@2019-04-01' = { | ||
name: storageName | ||
location: location | ||
sku: { | ||
name: storageSKU | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
param storageName string { | ||
minLength: 3 | ||
maxLength: 24 | ||
} | ||
|
||
resource provide_unique_name 'Microsoft.Storage/storageAccounts@2019-06-01' = { | ||
name: storageName | ||
location: 'eastus' | ||
sku: { | ||
name: 'Standard_LRS' | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
param storagePrefix string { | ||
minLength: 3 | ||
maxLength: 11 | ||
} | ||
param storageSKU string { | ||
allowed: [ | ||
'Standard_LRS' | ||
'Standard_GRS' | ||
'Standard_RAGRS' | ||
'Standard_ZRS' | ||
'Premium_LRS' | ||
'Premium_ZRS' | ||
'Standard_GZRS' | ||
'Standard_RAGZRS' | ||
] | ||
default: 'Standard_LRS' | ||
} | ||
param location string = resourceGroup().location | ||
|
||
var uniqueStorageName_var = concat(storagePrefix, uniqueString(resourceGroup().id)) | ||
|
||
resource uniqueStorageName 'Microsoft.Storage/storageAccounts@2019-04-01' = { | ||
name: uniqueStorageName_var | ||
location: location | ||
sku: { | ||
name: storageSKU | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} | ||
|
||
output storageEndpoint object = reference(uniqueStorageName_var).primaryEndpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
param storageName string { | ||
minLength: 3 | ||
maxLength: 24 | ||
} | ||
param storageSKU string { | ||
default: 'Standard_LRS' | ||
allowed:[ | ||
'Standard_LRS' | ||
'Standard_GRS' | ||
'Standard_RAGRS' | ||
'Standard_ZRS' | ||
'Premium_LRS' | ||
'Premium_ZRS' | ||
'Standard_GZRS' | ||
'Standard_RAGZRS' | ||
] | ||
} | ||
|
||
resource provide_unique_name 'Microsoft.Storage/storageAccounts@2019-06-01' = { | ||
name: storageName | ||
location: 'eastus' | ||
sku: { | ||
name: storageSKU | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
resource provide_unique_name 'Microsoft.Storage/storageAccounts@2019-06-01' = { | ||
name: '{provide-unique-name}' | ||
location: 'eastus' | ||
sku: { | ||
name: 'Standard_LRS' | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
param storagePrefix string { | ||
minLength: 3 | ||
maxLength: 11 | ||
} | ||
param storageSKU string { | ||
allowed: [ | ||
'Standard_LRS' | ||
'Standard_GRS' | ||
'Standard_RAGRS' | ||
'Standard_ZRS' | ||
'Premium_LRS' | ||
'Premium_ZRS' | ||
'Standard_GZRS' | ||
'Standard_RAGZRS' | ||
] | ||
default: 'Standard_LRS' | ||
} | ||
param location string = resourceGroup().location | ||
param appServicePlanName string = 'exampleplan' | ||
param webAppName string { | ||
minLength: 2 | ||
metadata: { | ||
description: 'Base name of the resource such as web app name and app service plan ' | ||
} | ||
} | ||
param linuxFxVersion string { | ||
metadata: { | ||
description: 'The Runtime stack of current web app' | ||
} | ||
default: 'php|7.0' | ||
} | ||
param resourceTags object = { | ||
Environment: 'Dev' | ||
Project: 'Tutorial' | ||
} | ||
|
||
var uniqueStorageName_var = concat(storagePrefix, uniqueString(resourceGroup().id)) | ||
var webAppPortalName_var = concat(webAppName, uniqueString(resourceGroup().id)) | ||
|
||
resource uniqueStorageName 'Microsoft.Storage/storageAccounts@2019-04-01' = { | ||
name: uniqueStorageName_var | ||
location: location | ||
tags: resourceTags | ||
sku: { | ||
name: storageSKU | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} | ||
|
||
resource appServicePlanName_resource 'Microsoft.Web/serverfarms@2016-09-01' = { | ||
name: appServicePlanName | ||
location: location | ||
tags: resourceTags | ||
sku: { | ||
name: 'B1' | ||
tier: 'Basic' | ||
size: 'B1' | ||
family: 'B' | ||
capacity: 1 | ||
} | ||
kind: 'linux' | ||
properties: { | ||
perSiteScaling: false | ||
reserved: true | ||
targetWorkerCount: 0 | ||
targetWorkerSizeId: 0 | ||
} | ||
} | ||
|
||
resource webAppPortalName 'Microsoft.Web/sites@2016-08-01' = { | ||
name: webAppPortalName_var | ||
location: location | ||
tags: resourceTags | ||
kind: 'app' | ||
properties: { | ||
serverFarmId: appServicePlanName_resource.id | ||
siteConfig: { | ||
linuxFxVersion: linuxFxVersion | ||
} | ||
} | ||
} | ||
|
||
output storageEndpoint object = reference(uniqueStorageName_var).primaryEndpoints |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
param storagePrefix string { | ||
minLength: 3 | ||
maxLength: 11 | ||
} | ||
param storageSKU string { | ||
allowed: [ | ||
'Standard_LRS' | ||
'Standard_GRS' | ||
'Standard_RAGRS' | ||
'Standard_ZRS' | ||
'Premium_LRS' | ||
'Premium_ZRS' | ||
'Standard_GZRS' | ||
'Standard_RAGZRS' | ||
] | ||
default: 'Standard_LRS' | ||
} | ||
param location string = resourceGroup().location | ||
|
||
var uniqueStorageName_var = concat(storagePrefix, uniqueString(resourceGroup().id)) | ||
|
||
resource uniqueStorageName 'Microsoft.Storage/storageAccounts@2019-04-01' = { | ||
name: uniqueStorageName_var | ||
location: location | ||
sku: { | ||
name: storageSKU | ||
} | ||
kind: 'StorageV2' | ||
properties: { | ||
supportsHttpsTrafficOnly: true | ||
} | ||
} |
Oops, something went wrong.