Skip to content

Commit fe8040f

Browse files
committed
refactor: iac deployment
1 parent 63b0383 commit fe8040f

6 files changed

Lines changed: 44 additions & 313 deletions

File tree

.mise/config.toml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ node = { version = "24.14.1", postinstall = "mise tasks run tools:yarn" }
44
pre-commit = "4.5.1"
55
uv = "0.11.6"
66

7+
[env]
8+
# Application name, used for naming resources and app registrations. Change to your application name.
9+
APPLICATION_NAME = "template-fastapi-react"
10+
# Entra group that should be added as owner to the app registration.
11+
# Required for iac:deploy:appreg. Change to your team's owners group or leave empty to be prompted by iac:deploy:appreg.
12+
ENTRA_APP_OWNERS_GROUP = ""
13+
# ServiceNow Business Application ID. Required by Equinor IAM compliance for
14+
# production app registrations. Leave empty to be prompted by iac:deploy:appreg.
15+
SERVICE_MANAGEMENT_REFERENCE = ""
16+
# Guard against accidental deploys into the wrong subscription. Compared against
17+
# the active subscription's name and id.
18+
EXPECTED_SUBSCRIPTION = ""
19+
720
[task_config]
821
includes = [".mise/tasks/*.toml"]
922

IaC/app-registration.bicep

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ param productionHostnames string[] = []
2929

3030
var apiAccessScopeId = guid('api-access-${applicationName}')
3131
var adminRoleId = guid('admin-role-${applicationName}')
32+
var defaultRoleId = guid('default-role-${applicationName}')
3233

3334
var productionRedirectUris = [for host in productionHostnames: 'https://${host}/oauth2/callback']
3435
var productionSwaggerRedirectUris = [for host in productionHostnames: 'https://${host}/api/docs/oauth2-redirect']
@@ -93,11 +94,19 @@ resource apiApp 'Microsoft.Graph/applications@v1.0' = {
9394
]
9495
}
9596
appRoles: [
97+
{
98+
id: defaultRoleId
99+
allowedMemberTypes: ['User']
100+
description: 'Default User Role'
101+
displayName: 'default'
102+
isEnabled: true
103+
value: 'default'
104+
}
96105
{
97106
id: adminRoleId
98-
allowedMemberTypes: ['User', 'Application']
99-
description: '${applicationName} administrators.'
100-
displayName: 'Admin'
107+
allowedMemberTypes: ['User']
108+
description: 'Administrator Role'
109+
displayName: 'admin'
101110
isEnabled: true
102111
value: 'admin'
103112
}
@@ -167,6 +176,24 @@ resource oauth2App 'Microsoft.Graph/applications@v1.0' = {
167176
]
168177
}
169178
]
179+
appRoles: [
180+
{
181+
id: defaultRoleId
182+
allowedMemberTypes: ['User']
183+
description: 'Default User Role'
184+
displayName: 'default'
185+
isEnabled: true
186+
value: 'default'
187+
}
188+
{
189+
id: adminRoleId
190+
allowedMemberTypes: ['User']
191+
description: 'Administrator Role'
192+
displayName: 'admin'
193+
isEnabled: true
194+
value: 'admin'
195+
}
196+
]
170197
}
171198

172199
resource oauth2AppSP 'Microsoft.Graph/servicePrincipals@v1.0' = {

IaC/deploy-app-registration.sh

Lines changed: 0 additions & 201 deletions
This file was deleted.

IaC/deploy-resources.sh

Lines changed: 0 additions & 40 deletions
This file was deleted.

IaC/exceptionEmailNotification.bicep

Lines changed: 0 additions & 68 deletions
This file was deleted.

IaC/main.bicep

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
targetScope='subscription'
22

3-
@allowed([ 'dev', 'staging', 'prod' ])
3+
@allowed([ 'dev', 'test', 'prod' ])
44
param environment string
55
@description('Specifies the location for resources.')
66
param resourceGroupLocation string = 'norwayeast'

0 commit comments

Comments
 (0)