@@ -4,6 +4,9 @@ param websitePassword string
44@secure ()
55param sessionSecret string
66
7+ @description ('Custom name for the App Service. If not provided, defaults to wa-{solutionId}' )
8+ param appServiceName string = ''
9+
710param adoOrganizationUrl string = ''
811param adoProjectName string = ''
912param adoRepositoryName string = ''
@@ -28,6 +31,7 @@ param entraIdAllowedGroups string = ''
2831param disablePasswordAuth bool = false
2932
3033var location = resourceGroup ().location
34+ var resolvedAppServiceName = empty (appServiceName ) ? 'wa-${solutionId }' : appServiceName
3135
3236@description ('Create an App Service Plan' )
3337resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
@@ -44,7 +48,7 @@ resource appServicePlan 'Microsoft.Web/serverfarms@2021-02-01' = {
4448
4549@description ('Create a Web App' )
4650resource webApp 'Microsoft.Web/sites@2021-02-01' = {
47- name : 'wa-${ solutionId }'
51+ name : resolvedAppServiceName
4852 location : location
4953 identity : {
5054 type : 'SystemAssigned'
@@ -70,7 +74,7 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
7074 }
7175 {
7276 name : 'NEXTAUTH_URL'
73- value : 'https://wa-${ solutionId }.azurewebsites.net'
77+ value : 'https://${ resolvedAppServiceName }.azurewebsites.net'
7478 }
7579 {
7680 name : 'WEBSITE_NODE_DEFAULT_VERSION'
@@ -119,5 +123,6 @@ resource webApp 'Microsoft.Web/sites@2021-02-01' = {
119123
120124@description ('Output the web app name and managed identity info' )
121125output webAppName string = webApp .name
126+ output webAppUrl string = 'https://${webApp .properties .defaultHostName }'
122127output managedIdentityPrincipalId string = webApp .identity .principalId
123128output managedIdentityClientId string = webApp .identity .tenantId
0 commit comments