Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible fix for CI permission #62

Merged
merged 1 commit into from
Apr 22, 2024
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
20 changes: 7 additions & 13 deletions infra/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@ param name string
@description('Primary location for all resources')
param location string

@description('Entra admin role name')
param postgresEntraAdministratorName string
@description('Id of the user or app to assign application roles')
param principalId string

@description('Entra admin role object ID (in Entra)')
param postgresEntraAdministratorObjectId string

@description('Entra admin user type')
@allowed([
'User'
'Group'
'ServicePrincipal'
])
param postgresEntraAdministratorType string = 'User'
@description('Whether the deployment is running on GitHub Actions')
param runningOnGh string = ''

var resourceToken = toLower(uniqueString(subscription().id, name, location))
var tags = { 'azd-env-name': name }
Expand All @@ -35,8 +27,10 @@ resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
var prefix = '${name}-${resourceToken}'

var postgresServerName = '${prefix}-postgresql'
var postgresAdminUser = 'admin${uniqueString(resourceGroup.id)}'
var postgresDatabaseName = 'flask'
var postgresEntraAdministratorObjectId = principalId
var postgresEntraAdministratorType = empty(runningOnGh) ? 'User' : 'ServicePrincipal'
var postgresEntraAdministratorName = 'admin${uniqueString(resourceGroup.id, principalId)}'

module postgresServer 'core/database/postgresql/flexibleserver.bicep' = {
name: 'postgresql'
Expand Down
9 changes: 3 additions & 6 deletions infra/main.parameters.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,11 @@
"location": {
"value": "${AZURE_LOCATION}"
},
"postgresEntraAdministratorName": {
"value": "useradmin"
},
"postgresEntraAdministratorObjectId": {
"principalId": {
"value": "${AZURE_PRINCIPAL_ID}"
},
"postgresEntraAdministratorType": {
"value": "User"
"runningOnGh": {
"value": "${GITHUB_ACTIONS}"
}
}
}
Loading