Skip to content

Commit

Permalink
Added necessary flags so the app can run without needing key vault an…
Browse files Browse the repository at this point in the history
…d sql server
  • Loading branch information
yashints committed Feb 18, 2024
1 parent f324ef0 commit 4020df0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 11 deletions.
28 changes: 21 additions & 7 deletions infra/aci.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ param memoryInGb int = 2
param restartPolicy string = 'Always'

@secure()
param password string
param password string

param username string

param server string
param server string

resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01' = {
name: name
Expand All @@ -44,11 +44,11 @@ resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01'
{
port: port
protocol: 'TCP'

}
{
port: 80
protocol: 'TCP'
protocol: 'TCP'
}
]
resources: {
Expand All @@ -57,6 +57,20 @@ resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01'
memoryInGB: memoryInGb
}
}
environmentVariables: [
{
name: 'ASPNETCORE_ENVIRONMENT'
value: 'Docker'
}
{
name: 'UseOnlyInMemoryDatabase'
value: 'true'
}
{
name: 'ASPNETCORE_HTTP_PORTS'
value: '80'
}
]
}
}
]
Expand All @@ -67,11 +81,11 @@ resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01'
ports: [
{
port: port
protocol: 'TCP'
protocol: 'TCP'
}
{
port: 80
protocol: 'TCP'
protocol: 'TCP'
}
]
}
Expand All @@ -85,4 +99,4 @@ resource containerGroup 'Microsoft.ContainerInstance/containerGroups@2021-09-01'
}
}

output containerIPv4Address string = containerGroup.properties.ipAddress.ip
output containerIPv4Address string = containerGroup.properties.ipAddress.ip
21 changes: 17 additions & 4 deletions infra/webapp-docker.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2022-03-01' = {
kind: 'linux'
properties: {
reserved: true
}
sku: {
name: 'B1'
}
sku: {
name: 'B1'
}
}

Expand All @@ -27,7 +27,20 @@ resource webApp 'Microsoft.Web/sites@2022-03-01' = {
properties: {
siteConfig: {
acrUseManagedIdentityCreds: true
appSettings: []
appSettings: [
{
name: 'UseOnlyInMemoryDatabase'
value: 'true'
}
{
name: 'ASPNETCORE_ENVIRONMENT'
value: 'Docker'
}
{
name: 'ASPNETCORE_HTTP_PORTS'
value: '80'
}
]
linuxFxVersion: 'DOCKER|${acr.properties.loginServer}/eshoponweb/web:latest'
}
serverFarmId: appServicePlan.id
Expand Down

0 comments on commit 4020df0

Please sign in to comment.