oh22is/RhinoBackup
A solution to backup, restore and deploy an Azure Synapse Analytics Serverless SQL Pool with all dependent objects.
Rhino Backup
********************************************************************************
********************************************************************************
********************************************************************************
********************************************************************************
***************************,****************************************************
**************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@#****************************
*****************%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@/**********************
**********************%@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*******************
*************************#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*****************
***************************(@@@@**@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@***************
*********************************@***@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**************
**********************************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*************
***********************************#@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@%************
*****************************#@****@@@@@**@@@@@@@@@@@@@@@@@@@@@@@@@@************
*****************************@@/*********@@@@@@@@@@**@@@@@@@@@@@@@@@************
****************************************@@@@@&*****@@@@@@@@@@@@@@@@(************
************************************************@@@@@@@@@@@@@@@@@@@*************
*******************************************#@@@@@@@@@@@@@@@@@@@@@@**************
*****************/@@@@@@@@@****************@@@@@@@@@@@@@@@@@@@@@****************
***************#@@@@@@@@@@@@@@@&*********&@@@@@@@@@@@@@@@@@@@@#*****************
**************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@********************
**************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@************************
**************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*****************************
**************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@***************************
**************@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@**************************
**************@@@@@@@@@@@@@@@@@@@@&@@@@@@@@@@@@@@@@@@@@&************************
**************@@@@@@@@@@@@@@@@@@@@&*@@@@@@@@@@@@@@@@@@@@@***********************
**************@@@@@@@@@@@@@@@@@@@@&***@@@@@@@@@@@@@@@@@@@@%*********************
**************@@@@@@@@@@@@@@@@@@@@&****@@@@@@@@@@@@@@@@@@@@@********************
**************@@@@@@@@@@@@@@@@@@@@&******@@@@@@@@@@@@@@@@@@@@(******************
**************@@@@@@@@@@@@@@@@@@@@&*******@@@@@@@@@@@@@@@@@@@@@*****************
**************@@@@@@@@@@@@@@@@@@@@&********/@@@@@@@@@@@@@@@@@@@@/***************
**************@@@@@@@@@@@@@@@@@@@@&**********@@@@@@@@@@@@@@@@@@@@@**************
**************@@@@@@@@@@@@@@@@@@@@&***********%@@@@@@@@@@@@@@@@@@@@*************
********************************************************************************
********************************************************************************
********************************************************************************
RhinoBackup was developed by our team within oh22 based on our experience in various Azure Synapse Analytics projects.
We would be happy if our solution is used in other projects and we can incorporate the collected experiences, improvement suggestions and new requirements into one of the next versions.
App Start
Use either --export or --import
Optional:
Definition of output types, which are mutual exclusive:
--AsDirectory={Path}-> defaults toexport--AsFile={Path}
Example:
dotnet run --export
Config Options
MsSql Config Settings
Configures where to Export or Import from
Options Settings
Configures what to Export
{
"Options": {
"DoExternalDataSources": true,
"DoExternalFileFormats": true,
"DoExternalTables": true,
"DoFunctions": true,
"DoSchemas": true,
"DoStoredProcedures": true,
"DoViews": true,
"AreSystemObjects": false,
"ExcludedSchemas": [] // String Array of SchemaNames
}
}Serilog Settings
Included Sinks: Console and File
Example:
{
"Serilog": {
"MinimumLevel": "Debug",
"WriteTo": [
{ "Name": "Console" }
]
}
}Config Types
The config can be set in different stages. They are consecutive and if present override the previous stage.
appsettings.json > appsettings.{Environment}.json > Environment Variables > CommandLine
Dotnet Config
Use appsettings.json or appsettings.{Environment}.json
{
"Sql": {/*...*/}, // MsSql Settings
"Options": {/*...*/}, // Options Settings
"SeriLog": {/*...*/} // Serilog Settings
}Environment Config
Config can also be achieved or overridden through environment variables prefixed with RHINO_
Eg. RHINO_sql:Database=Test or RHINO_Serilog:MinimumLevel=Information
Command Line Config
Config can also be achieved or overridden through command line.
Eg. --sql:Password=P4$$w0rd or --Options:ExcludedSchemas:0=obsolete
{ "Sql": { "SqlConnection": "", // Connection String, Either this or rest "SqlEndpoint": "", //Host "Database": "", "Username": "", "Password": "" } }