Skip to content
Merged
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
9 changes: 7 additions & 2 deletions Infrastructure/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ param websitePassword string
@secure()
param sessionSecret string

@description('Custom name for the App Service. If not provided, defaults to wa-{solutionId}')
param appServiceName string = ''

param adoOrganizationUrl string = ''
param adoProjectName string = ''
param adoRepositoryName string = ''
Expand All @@ -28,6 +31,7 @@ param entraIdAllowedGroups string = ''
param disablePasswordAuth bool = false

var location = resourceGroup().location
var resolvedAppServiceName = empty(appServiceName) ? 'wa-${solutionId}' : appServiceName

@description('Create an App Service Plan')
resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
Expand All @@ -44,7 +48,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {

@description('Create a Web App')
resource webApp 'Microsoft.Web/sites@2021-02-01' = {
name: 'wa-${solutionId}'
name: resolvedAppServiceName
location: location
identity: {
type: 'SystemAssigned'
Expand All @@ -70,7 +74,7 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
}
{
name: 'NEXTAUTH_URL'
value: 'https://wa-${solutionId}.azurewebsites.net'
value: 'https://${resolvedAppServiceName}.azurewebsites.net'
}
{
name: 'WEBSITE_NODE_DEFAULT_VERSION'
Expand Down Expand Up @@ -119,5 +123,6 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {

@description('Output the web app name and managed identity info')
output webAppName string = webApp.name
output webAppUrl string = 'https://${webApp.properties.defaultHostName}'
output managedIdentityPrincipalId string = webApp.identity.principalId
output managedIdentityClientId string = webApp.identity.tenantId
4 changes: 4 additions & 0 deletions Setup/azure-pipelines-deploy-jobs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ parameters:
- name: websiteName
type: string
default: ''
- name: appServiceName
type: string
default: ''
- name: adoOrganizationUrl
type: string
default: ''
Expand Down Expand Up @@ -69,6 +72,7 @@ steps:
--parameters websitePassword="${{ parameters.websitePassword }}" `
--parameters sessionSecret="${{ parameters.websiteSessionSecret }}" `
--parameters solutionId="${{ parameters.websiteName }}" `
--parameters appServiceName="${{ parameters.appServiceName }}" `
--parameters adoOrganizationUrl="${{ parameters.adoOrganizationUrl }}" `
--parameters adoProjectName="${{ parameters.adoProjectName }}" `
--parameters adoRepositoryName="${{ parameters.adoRepositoryName }}" `
Expand Down
4 changes: 4 additions & 0 deletions Setup/azure-pipelines-external.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
# - EnableEntraIdAuth (string: 'true' or 'false', default: 'false')
# - DisablePasswordAuth (string: 'true' or 'false', default: 'false')
# - EntraIdAllowedGroups (comma-separated list of Entra ID group object IDs)
#
# Optional variables (for custom naming):
# - AppServiceName (custom App Service name, defaults to wa-{WebsiteName} if not provided)

trigger: none
pr: none
Expand Down Expand Up @@ -97,6 +100,7 @@ stages:
websitePassword: $(WebsitePassword)
websiteSessionSecret: $(WebsiteSessionSecret)
websiteName: $(WebsiteName)
appServiceName: ${{ coalesce(variables.AppServiceName, '') }}
adoOrganizationUrl: $(System.CollectionUri)
adoProjectName: $(System.TeamProject)
adoRepositoryName: ${{ coalesce(variables.AdoRepositoryName, '') }}
Expand Down
4 changes: 2 additions & 2 deletions Website/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Website/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "website",
"version": "2.3.1",
"version": "2.3.3",
"private": true,
"scripts": {
"dev": "next dev",
Expand Down
Loading