You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error while deplying postgesql flex server with georeplica - An unexpected error occurred while processing the request. Tracking ID: '05fecac6-97a0-4732-adea-0a54d4fc1fc4' (Code: InternalServerError)
#11602
I'm getting this error while deploying a geo-replication-enabled PostgreSQL flex server.
Deployment runs fine for the primary server and creates all the resources defined on the below bicep file except the replica server deployment fails with the error: An unexpected error occurred while processing the request. Tracking ID: '05fecac6-97a0-4732-adea-0a54d4fc1fc4' (Code: InternalServerError)
`
//name of the primary server @description('Name of the new PostgreSQL primary server')
param serverNamePrimary string
//name of the secondary server @description('Name of the replica server')
param serverNameSecondary string
// name of the existing key vault @description('Name of the existing azure key vault, admin user name and password will be added during the deployment)
param existingkeyVaultName string
//resource group name of the existing azure key vault specified above @description('name of the existing azure key vault resource group')
param existingKVResGrpName string
//This parameter is define to trigger the Powershell script to generate a random password on each deployment @description('Changing this value between Bicep file deployments forces the deployment script to re-execute, this used by the PS script')
param utcValue string = utcNow()
//This parameter is used to create the DB server username key vault secret name @description('Server administrators username')
param adminUserSecretName string = 'psqlserver--${serverNamePrimary}--UserName'
//This parameter is use to create the DB server username key vault secret value @secure()
param adminUserSecretValue string
//This parameter is used to create the DB password serect value @description('Server administrators Password')
param adminPasswordSecretName string = 'psqlserver01--${serverNamePrimary}--Password'
//deployment location for the primary server @description('resource group location')
param locationPrimary string = resourceGroup().location
// //deployment location for secondary server @description('Deployment location for secondary location')
param locationSecondary string = 'eastus'
//passing name of the extension
param azureExtensionSetValue string = 'POSTGIS'
// define the name for your database, if you need to create multiple DBs under the same server add the DB names inside of single quotes separated by comma @description('Name of the DB')
param databaseNames array = [
'devx'
]
// allowed IP addresses to connect to DB are defined in an array
// HQ-88.88.88.88
// app01- 99.99.99.99 @description('Allowed IPs')
param firewallRules array = [
{
name:'HQ'
startIpAddress:'88.88.88.88'
endIpAddress:'88.88.88.88'
}
{
name: 'Server_app01'
startIpAddress: '99.99.99.99'
endIpAddress: '99.99.99.99'
}
]
#disable-next-line BCP081
module addSecretAdminUserName './addSecretToKeyVault.bicep' = {
//adding server admin user name to key vault
name: 'secretModAdminUserName'
scope: resourceGroup(existingKVResGrpName)
params:{
existingkeyVaultName: existingkeyVaultName
secretName: adminUserSecretName
passwordText: adminUserSecretValue
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm getting this error while deploying a geo-replication-enabled PostgreSQL flex server.
Deployment runs fine for the primary server and creates all the resources defined on the below bicep file except the replica server deployment fails with the error:
An unexpected error occurred while processing the request. Tracking ID: '05fecac6-97a0-4732-adea-0a54d4fc1fc4' (Code: InternalServerError)
`
//name of the primary server
@description('Name of the new PostgreSQL primary server')
param serverNamePrimary string
//name of the secondary server
@description('Name of the replica server')
param serverNameSecondary string
// name of the existing key vault
@description('Name of the existing azure key vault, admin user name and password will be added during the deployment)
param existingkeyVaultName string
//resource group name of the existing azure key vault specified above
@description('name of the existing azure key vault resource group')
param existingKVResGrpName string
//This parameter is define to trigger the Powershell script to generate a random password on each deployment
@description('Changing this value between Bicep file deployments forces the deployment script to re-execute, this used by the PS script')
param utcValue string = utcNow()
//This parameter is used to create the DB server username key vault secret name
@description('Server administrators username')
param adminUserSecretName string = 'psqlserver--${serverNamePrimary}--UserName'
//This parameter is use to create the DB server username key vault secret value
@secure()
param adminUserSecretValue string
//This parameter is used to create the DB password serect value
@description('Server administrators Password')
param adminPasswordSecretName string = 'psqlserver01--${serverNamePrimary}--Password'
//deployment location for the primary server
@description('resource group location')
param locationPrimary string = resourceGroup().location
// //deployment location for secondary server
@description('Deployment location for secondary location')
param locationSecondary string = 'eastus'
//passing name of the extension
param azureExtensionSetValue string = 'POSTGIS'
// define the name for your database, if you need to create multiple DBs under the same server add the DB names inside of single quotes separated by comma
@description('Name of the DB')
param databaseNames array = [
'devx'
]
// allowed IP addresses to connect to DB are defined in an array
// HQ-88.88.88.88
// app01- 99.99.99.99
@description('Allowed IPs')
param firewallRules array = [
{
name:'HQ'
startIpAddress:'88.88.88.88'
endIpAddress:'88.88.88.88'
}
{
name: 'Server_app01'
startIpAddress: '99.99.99.99'
endIpAddress: '99.99.99.99'
}
]
#disable-next-line BCP081
module addSecretAdminUserName './addSecretToKeyVault.bicep' = {
//adding server admin user name to key vault
name: 'secretModAdminUserName'
scope: resourceGroup(existingKVResGrpName)
params:{
existingkeyVaultName: existingkeyVaultName
secretName: adminUserSecretName
passwordText: adminUserSecretValue
}
}
#disable-next-line BCP081
module addSecretAdminPassword './addSecretToKeyVault.bicep' = {
//adding server password to keyvault
name: 'secretModAdminPassword'
scope: resourceGroup(existingKVResGrpName)
params:{
existingkeyVaultName: existingkeyVaultName
secretName: adminPasswordSecretName
passwordText: passwordGenerator.properties.outputs.password
}
}
// Primary Server deployment
#disable-next-line BCP081
resource pgsqlPrimary 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = {
name: serverNamePrimary
location: locationPrimary
sku: {
name: 'Standard_D2ds_v5'
tier: 'GeneralPurpose'
// tier: 'Burstable'
}
properties: {
createMode: 'Default'
version: '14'
administratorLogin: adminUserSecretValue
administratorLoginPassword: passwordGenerator.properties.outputs.password
storage: {
storageSizeGB: 128
}
}
var sourceServerID = pgsqlPrimary.id
// creating the georeplica of the primary
resource pgsqlSecondary 'Microsoft.DBforPostgreSQL/flexibleServers@2022-12-01' = {
name: serverNameSecondary
location: locationSecondary
sku: {
name: 'Standard_D2ds_v5'
tier: 'GeneralPurpose'
// tier: 'Burstable'
}
properties: {
createMode: 'Replica'
sourceServerResourceId: sourceServerID
}
dependsOn:[
pgsqlPrimary
]
}
//Generate password using the script
resource passwordGenerator 'Microsoft.Resources/deploymentScripts@2020-10-01' ={
name:'password-gen'
location: locationPrimary
kind: 'AzurePowerShell'
properties:{
forceUpdateTag: utcValue
azPowerShellVersion:'7.5.0'
retentionInterval: 'P1D'
scriptContent: loadTextContent('./createPassword.ps1')
cleanupPreference: 'OnSuccess'
}
}
`
Beta Was this translation helpful? Give feedback.
All reactions