From 956675137dcd149dab950ebf304c694babed79e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 16:40:13 +0000 Subject: [PATCH 1/2] Initial plan From 71203529bffbe95940ac835a0acbad4817571068 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 17 Jul 2025 16:46:06 +0000 Subject: [PATCH 2/2] Fix storage account connection string configuration in main.bicep Co-authored-by: mrsharm <68247673+mrsharm@users.noreply.github.com> --- .gitignore | 5 ++++- main.bicep | 25 ++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 65ce944..29ecb70 100644 --- a/.gitignore +++ b/.gitignore @@ -291,4 +291,7 @@ __pycache__/ Properties/PublishProfiles/* Properties/ServiceDependencies/* -*Deploy.json \ No newline at end of file +*Deploy.json + +# Generated ARM templates from Bicep +main.json \ No newline at end of file diff --git a/main.bicep b/main.bicep index 3625799..f60d9e1 100644 --- a/main.bicep +++ b/main.bicep @@ -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 @@ -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