Skip to content
Draft
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
3 changes: 3 additions & 0 deletions appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,8 @@
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"ConnectionStrings": {
"StorageAccount": "UseDevelopmentStorage=true"
}
}
2 changes: 1 addition & 1 deletion appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
},
"AllowedHosts": "*",
"ConnectionStrings": {
"StorageAccount": ""
"StorageAccount": "UseDevelopmentStorage=true"
}
}
23 changes: 22 additions & 1 deletion main.bicep
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// main.bicep
// Deploys an Azure App Service Plan and a Web App
// Deploys an Azure App Service Plan, Web App, and Storage Account

param location string = resourceGroup().location
param appServicePlanName string = 'cpu-app20250714124552Plan'
param webAppName string = 'test_webapp'
param storageAccountName string = 'cpuapp${uniqueString(resourceGroup().id)}'

resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
name: appServicePlanName
Expand All @@ -15,11 +16,31 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
kind: 'app'
}

resource storageAccount 'Microsoft.Storage/storageAccounts@2022-09-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
accessTier: 'Hot'
}
}

resource webApp 'Microsoft.Web/sites@2022-03-01' = {
name: webAppName
location: location
properties: {
serverFarmId: appServicePlan.id
siteConfig: {
appSettings: [
{
name: 'ConnectionStrings__StorageAccount'
value: 'DefaultEndpointsProtocol=https;AccountName=${storageAccount.name};AccountKey=${storageAccount.listKeys().keys[0].value};EndpointSuffix=${environment().suffixes.storage}'
}
]
}
}
}

Expand Down