Home
%3CLINGO-SUB%20id%3D%22lingo-sub-1011669%22%20slang%3D%22en-US%22%3ELesson%20Learned%20%23111%3A%20Running%20the%20Web%20App%20backup%20service%20for%20Azure%20Database%20for%20PostgreSQL%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1011669%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E1)%20The%20connection%20string%20format%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EWhen%20you%20define%20the%20connection%20string%20in%20the%20WebApp%20connection%20string%20to%20use%20by%20the%20backup%20service%2C%20please%2C%20use%20this%20string%26nbsp%3B%3CSTRONG%3EDatabase%3DDatabaseName%3BServer%3Dservername.postgres.database.azure.com%3B%20User%20Id%3Djmjurado%40servername%3B%20Password%3DPassword123!%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E2)%20Why%20when%20I%20changed%20the%20connection%20string%20Web%20App%20service%20backup%20is%20using%20the%20previous%20connection%20string%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EI%20found%20that%20even%20when%20I%20changed%20the%20connection%20string%2C%20Web%20App%20Service%20backup%20is%20using%20the%20previous%20one.%20All%20points%20to%20Web%20App%20Service%20backup%20saves%20the%20connection%20string%20in%20another%20place%20and%20will%20use%20this%20always%2C%20even%20if%20you%20performend%20any%20change.%20So%2C%20my%20suggesion%20is%20to%20reset%20the%20backup%20configuration%2C%20apply%20the%20modifications%20in%20the%20connection%20string%20and%20configure%20it%20again.%20Web%20App%20Service%20backup%20will%20use%20the%20latest%20one.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E3)%20In%20the%20connection%20string%2C%20the%20database%20name%20is%20sensitive%20case%3A%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EFor%20this%20reason%2C%20use%20lower%20and%20upper%20depending%20on%20the%20name%20of%20the%20database.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E4)%20I%20have%20found%20that%20when%20the%20version%20of%20Azure%20Database%20for%20PostgreSQL%20is%2011%2C%20you%20are%20going%20to%20have%20the%20following%20error%20message%3A%20%22PostgreSQL%20backup%20exited%20with%20code%201%20for%20db%3Apostgres.%20Exception%3Apg_dump%3A%20aborting%20because%20of%20server%20version%20mismatch.%22%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EThis%20points%20to%20that%20the%20version%20of%20pg_dump%20that%20Web%20App%20Backup%20Services%20is%20using%20is%20not%20compatible%20nowadays%20with%20the%20version%2011%20of%20Azure%20Database%20for%20PostgreSQL.%20Others%20previous%20versions%20like%209.6%20works%20correctly%20with%20Web%20App%20Backup%20Services.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMy%20suggestion%20in%20this%20type%20of%20situation%20is%20to%20use%20the%20inbuilt%20backup%20service%20that%20Azure%20Database%20for%20PostgreSQL%20because%20besides%20that%20is%20compatible%20with%20all%20versions%2C%20is%20performing%20transactional%20backups%20every%205-10%20minutes%20and%20it%20is%20possible%20to%20restore%20a%20instance%20at%20any%20point%20in%20time%20within%20the%20retention%20period.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EEnjoy!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1011669%22%20slang%3D%22en-US%22%3E%3CP%3EI%20would%20like%20to%20share%20my%20lessons%20learned%20working%20with%20a%20customer%20that%20wants%20to%20use%20the%20WebApp%20backup%20service%20for%20Azure%20Database%20for%20PostgreSQL%20instead%20of%20the%20native%20backup%20that%20is%20included%20by%20Azure%20Database%20service%20itself.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E

1) The connection string format:

 

  • When you define the connection string in the WebApp connection string to use by the backup service, please, use this string Database=DatabaseName;Server=servername.postgres.database.azure.com; User Id=jmjurado@servername; Password=Password123!

 

2) Why when I changed the connection string Web App service backup is using the previous connection string:

 

  • I found that even when I changed the connection string, Web App Service backup is using the previous one. All points to Web App Service backup saves the connection string in another place and will use this always, even if you performend any change. So, my suggesion is to reset the backup configuration, apply the modifications in the connection string and configure it again. Web App Service backup will use the latest one. 

 

3) In the connection string, the database name is sensitive case:

 

  • For this reason, use lower and upper depending on the name of the database. 

 

4) I have found that when the version of Azure Database for PostgreSQL is 11, you are going to have the following error message: "PostgreSQL backup exited with code 1 for db:postgres. Exception:pg_dump: aborting because of server version mismatch."

 

  • This points to that the version of pg_dump that Web App Backup Services is using is not compatible nowadays with the version 11 of Azure Database for PostgreSQL. Others previous versions like 9.6 works correctly with Web App Backup Services. 

 

My suggestion in this type of situation is to use the inbuilt backup service that Azure Database for PostgreSQL because besides that is compatible with all versions, is performing transactional backups every 5-10 minutes and it is possible to restore a instance at any point in time within the retention period. 

 

Enjoy!