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
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -291,4 +291,7 @@ __pycache__/
Properties/PublishProfiles/*
Properties/ServiceDependencies/*

*Deploy.json
*Deploy.json

# Generated ARM templates from Bicep
main.json
25 changes: 24 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, a Web App, and a 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,12 +16,34 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
kind: 'app'
}

resource storageAccount 'Microsoft.Storage/storageAccounts@2023-01-01' = {
name: storageAccountName
location: location
sku: {
name: 'Standard_LRS'
}
kind: 'StorageV2'
properties: {
supportsHttpsTrafficOnly: true
minimumTlsVersion: 'TLS1_2'
}
}

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=core.windows.net'
}
]
}
}
}

output webAppUrl string = 'https://${webApp.name}.azurewebsites.net'
output storageAccountName string = storageAccount.name