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

[AVM Module Issue]: PSQL Deployment often fails when enabling EntraID Auth #3257

Closed
1 task done
GregorLauritz opened this issue Sep 12, 2024 · 4 comments · Fixed by #3355
Closed
1 task done

[AVM Module Issue]: PSQL Deployment often fails when enabling EntraID Auth #3257

GregorLauritz opened this issue Sep 12, 2024 · 4 comments · Fixed by #3355
Assignees
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Bug 🐛 Something isn't working

Comments

@GregorLauritz
Copy link

Check for previous/existing GitHub issues

  • I have checked for previous/existing GitHub issues

Issue Type?

Bug

Module Name

avm/res/db-for-postgre-sql/flexible-server

(Optional) Module Version

0.3.0

Description

For us, the Bicep deployment often fails when enabling Password Auth and EntraID Auth on our PSQL Server.
4 out of 5 times it will fail with The server '<<server_name>>' is not in an accessible state to perform Azure AD Principal operation. Please make sure the server is accessible before executing Azure AD Principal operations. (Code: AadAuthOperationCannotBePerformedWhenServerIsNotAccessible).
I tried playing around with the deployment order locally but couldn't find a reliable order that resolves this issue...

Code Snippet:

module flexiServer 'br/public:avm/res/db-for-postgre-sql/flexible-server:0.3.0' = {
  name: 'psql-flexi-${deploymentNameVar}'
  scope: resourceGroup
  params: {
    name: names.outputs.psqlName
    location:'westeurope'
    administratorLogin: names.outputs.psqlAdminUserName
    administratorLoginPassword: psqlAdminPassword
    administrators: [
      {
        objectId: managedIdentityContainerInstance.outputs.principalId
        principalName: managedIdentityContainerInstance.outputs.name
        principalType: 'ServicePrincipal'
      }
      {
        objectId: adminGroupPrincipalId
        principalName: 'sg-pace-resource-access-smc-admin'
        principalType: 'Group'
      }
    ]
    tier: psqlTier
    skuName:'Standard_D2s_v3'
    availabilityZone: '2'
    backupRetentionDays: 7
    geoRedundantBackup: 'Disabled'
    createMode: 'Create'
    highAvailability: 'Disabled'
    passwordAuth: 'Enabled'
    activeDirectoryAuth: 'Enabled'
    delegatedSubnetResourceId: psqlSubnetId
    privateDnsZoneArmResourceId: getPrivateDnsZoneResourceId(
      connectivityHubSubscriptionId,
      connectivityHubResourceGroupName,
      postgresPrivateDnsZoneName
    )
    storageSizeGB: 512
    version: '14'
    configurations: [
      {
        name: 'lock_timeout'
        value: '1500'
        source: 'user-override'
      }
      {
        name: 'shared_preload_libraries'
        value: 'pg_stat_statements'
        source: 'user-override'
      }
      {
        name: 'temp_tablespaces'
        value: 'temptblspace'
        source: 'user-override'
      }
      {
        name: 'log_line_prefix'
        value: '%t-%c %d'
        source: 'user-override'
      }
      {
        name: 'max_wal_size'
        value: '32768'
        source: 'user-override'
      }
    ]
    diagnosticSettings: [
      {
        storageAccountResourceId: dseStorageAccountResourceId
        logCategoriesAndGroups: [
          {
            categoryGroup: 'audit'
            enabled: true
          }
          {
            categoryGroup: 'allLogs'
            enabled: true
          }
        ]
        metricCategories: [
          {
            category: 'AllMetrics'
            enabled: false
          }
        ]
      }
    ]
    enableTelemetry: true
  }
}

(Optional) Correlation Id

80fb0d4c-d51d-4803-9be3-d79be922e709

@GregorLauritz GregorLauritz added Needs: Triage 🔍 Maintainers need to triage still Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue labels Sep 12, 2024

Important

The "Needs: Triage 🔍" label must be removed once the triage process is complete!

Tip

For additional guidance on how to triage this issue/PR, see the BRM Issue Triage documentation.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Type: Bug 🐛 Something isn't working label Sep 12, 2024
@avm-team-linter avm-team-linter bot added the Class: Resource Module 📦 This is a resource module label Sep 12, 2024
@github-project-automation github-project-automation bot moved this to Needs: Triage in AVM - Module Issues Sep 12, 2024
Copy link

@GregorLauritz, thanks for submitting this issue for the avm/res/db-for-postgre-sql/flexible-server module!

Important

A member of the @Azure/avm-res-dbforpostgresql-flexibleserver-module-owners-bicep or @Azure/avm-res-dbforpostgresql-flexibleserver-module-contributors-bicep team will review it soon!

@arnoldna arnoldna removed the Needs: Triage 🔍 Maintainers need to triage still label Sep 12, 2024
@arnoldna
Copy link
Contributor

Thanks @GregorLauritz for submitting the issue. Let me take a look to see if I can identify an issue.

@arnoldna
Copy link
Contributor

Contacted product group concerning issue and they were able to recreate in their environment.

arnoldna added a commit that referenced this issue Sep 24, 2024
…e server` (#3346)

## Description

Closes #3257 

## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.db-for-postgre-sql.flexible-server](https://github.com/arnoldna/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.yml/badge.svg?branch=avm%2Fres%2Fdb-for-postgre-sql%2Fflexible-server)](https://github.com/arnoldna/bicep-registry-modules/actions/workflows/avm.res.db-for-postgre-sql.flexible-server.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [X] Azure Verified Module updates:
- [X] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [X] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [X] Update to documentation

## Checklist

- [X] I'm sure there are no other open Pull Requests for the same
update/change
- [X] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [X] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Alexander Sehr <[email protected]>
Co-authored-by: Axel B. Andersen <[email protected]>
Co-authored-by: Javier Cevallos <[email protected]>
Co-authored-by: John <[email protected]>
Co-authored-by: Máté Barabás <[email protected]>
Co-authored-by: hundredacres <[email protected]>
Co-authored-by: Rainer Halanek <[email protected]>
Co-authored-by: JFolberth <[email protected]>
Co-authored-by: René Hézser <[email protected]>
Co-authored-by: Fabio Masciotra <[email protected]>
Co-authored-by: Erika Gressi <[email protected]>
Co-authored-by: Peter Budai <[email protected]>
@github-project-automation github-project-automation bot moved this from Needs: Triage to Done in AVM - Module Issues Sep 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Class: Resource Module 📦 This is a resource module Type: AVM 🅰️ ✌️ Ⓜ️ This is an AVM related issue Type: Bug 🐛 Something isn't working
Projects
Development

Successfully merging a pull request may close this issue.

2 participants