Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add comments and description to bicep-refactored file #183

Merged
merged 2 commits into from
Oct 29, 2024
Merged
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
13 changes: 11 additions & 2 deletions Pilot-project/decompile/bicep-refactored.bicep
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
// bicep-refactored.bicep

// Clean-up resource names
// Introduce App Name prefix
// Simplify tag declarations

// All the parameters are defined at the top of the file
param appNamePrefix string = uniqueString(resourceGroup().id)

param webappName string = '${appNamePrefix}-webapp'
param appServicePlanName string = '${appNamePrefix}-appplan'
param appInsightsName string = '${appNamePrefix}-appinsights'
param appStorageAccountName string = format('{0}stg35', replace(appNamePrefix, '-', ''))

@description('Azure resource tags')
var appTags = {
AppName: 'myKinetEcoTracking'
Environment: 'Test'
}

// Move deployment location into parameter
@description('Azure region to deploy all resources')
param region string = 'eastus2' // resourceGroup().location

// Create an App Insights resource
resource components_kinetEco35_appinsights_name_resource 'microsoft.insights/components@2020-02-02' = {
name: appInsightsName
location: region
Expand All @@ -31,6 +35,7 @@ resource components_kinetEco35_appinsights_name_resource 'microsoft.insights/com
}
}

// Create a storage account
resource storageAccounts_kinetecotracking35stg1_name_resource 'Microsoft.Storage/storageAccounts@2022-05-01' = {
name: appStorageAccountName
location: region
Expand Down Expand Up @@ -67,6 +72,7 @@ resource storageAccounts_kinetecotracking35stg1_name_resource 'Microsoft.Storage
}
}

// Create an App Service Plan
resource serverfarms_kinetEco35_appplan_name_resource 'Microsoft.Web/serverfarms@2022-03-01' = {
name: appServicePlanName
location: region
Expand All @@ -93,6 +99,7 @@ resource serverfarms_kinetEco35_appplan_name_resource 'Microsoft.Web/serverfarms
}
}

// Create a Blob Storage service
resource storageAccounts_kinetecotracking35stg1_name_default 'Microsoft.Storage/storageAccounts/blobServices@2022-05-01' = {
parent: storageAccounts_kinetecotracking35stg1_name_resource
name: 'default'
Expand All @@ -111,6 +118,7 @@ resource storageAccounts_kinetecotracking35stg1_name_default 'Microsoft.Storage/
}
}

// Create a web app
resource sites_kinetEco35_webapp_name_resource 'Microsoft.Web/sites@2022-03-01' = {
name: webappName
location: region
Expand Down Expand Up @@ -160,6 +168,7 @@ resource sites_kinetEco35_webapp_name_resource 'Microsoft.Web/sites@2022-03-01'
}
}

// Create a host name binding
resource sites_kinetEco35_webapp_name_sites_kinetEco35_webapp_name_azurewebsites_net 'Microsoft.Web/sites/hostNameBindings@2022-03-01' = {
parent: sites_kinetEco35_webapp_name_resource
name: '${webappName}.azurewebsites.net'
Expand Down
Loading