Skip to content

Commit 60532dc

Browse files
committed
fix: Update default instance number and refactor container image parameters in Bicep files
1 parent 1fcaabb commit 60532dc

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

.github/workflows/cicd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ permissions:
3434
security-events: write
3535

3636
env:
37-
DEFAULT_INSTANCE_NUMBER: "005" # default instance number if not provided
37+
DEFAULT_INSTANCE_NUMBER: "007" # default instance number if not provided
3838
DEFAULT_AZURE_LOCATION: "canadacentral" # default Azure region if not provided
3939
SRC_PROJECT_PATH: "/webapp01/webapp01.csproj"
4040
AZURE_WEBAPP_PACKAGE_PATH: "./src" # set this to the path to your web app project, defaults to the repository root
@@ -74,7 +74,7 @@ jobs:
7474
$appServicePlanName = "asp-gh-aspnet-webapp-$instanceNumber"
7575
$webAppName = "app-gh-aspnet-webapp-$instanceNumber"
7676
$resourceGroupName = "rg-gh-aspnet-webapp-$instanceNumber"
77-
$containerImage = "$acrName.azurecr.io/webapp01:latest"
77+
$containerImageName = "webapp01:latest"
7878
7979
# Deployment name based only on instance number for idempotence
8080
$deploymentName = "deploy-infra-$instanceNumber"
@@ -98,7 +98,7 @@ jobs:
9898
--parameters appServicePlanName=$appServicePlanName `
9999
--parameters webAppName=$webAppName `
100100
--parameters location=$location `
101-
--parameters containerImage=$containerImage `
101+
--parameters containerImageName=$containerImageName `
102102
--parameters resourceGroupName=$resourceGroupName `
103103
--query "properties.outputs" -o json
104104

blueprints/gh-aspnet-webapp/bicep/main.bicep

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ param webAppName string
1515
@description('The location for all resources')
1616
param location string
1717

18-
@description('The container image to deploy')
19-
param containerImage string
18+
@description('The container image name without registry prefix (e.g., webapp01:latest)')
19+
param containerImageName string = 'webapp01:latest'
2020

2121
@description('The name of the Resource Group')
2222
param resourceGroupName string = 'rg-webapp01-dev'
@@ -42,7 +42,7 @@ module resourcesInRG './resources.bicep' = {
4242
appServicePlanName: '${appServicePlanName}-${uniqueSuffix}'
4343
webAppName: '${webAppName}-${uniqueSuffix}'
4444
location: location
45-
containerImage: containerImage
45+
containerImageName: containerImageName
4646
}
4747
}
4848

blueprints/gh-aspnet-webapp/bicep/resources.bicep

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ param webAppName string
1313
@description('The location for all resources')
1414
param location string
1515

16-
@description('The container image to deploy')
17-
param containerImage string
16+
@description('The container image name without registry prefix (e.g., webapp01:latest)')
17+
param containerImageName string = 'webapp01:latest'
1818

1919
// Deploy the Azure Container Registry
2020
resource acr 'Microsoft.ContainerRegistry/registries@2023-01-01-preview' = {
@@ -58,18 +58,18 @@ resource webApp 'Microsoft.Web/sites@2024-04-01' = {
5858
appSettings: [
5959
{
6060
name: 'DOCKER_REGISTRY_SERVER_URL'
61-
value: 'https://${acr.name}.azurecr.io'
61+
value: 'https://${acr.properties.loginServer}'
6262
}
6363
{
6464
name: 'WEBSITES_ENABLE_APP_SERVICE_STORAGE'
6565
value: 'false'
6666
}
6767
{
6868
name: 'DOCKER_CUSTOM_IMAGE_NAME'
69-
value: containerImage
69+
value: '${acr.properties.loginServer}/${containerImageName}'
7070
}
7171
]
72-
linuxFxVersion: 'DOCKER|${containerImage}' // Specify the container image
72+
linuxFxVersion: 'DOCKER|${acr.properties.loginServer}/${containerImageName}'
7373
}
7474
}
7575
}

0 commit comments

Comments
 (0)