This repository contains a PowerShell script designed to automate the cloning of a database from a production environment to a homologation environment in Azure SQL. The script utilizes Azure PowerShell commands to achieve the database cloning process and includes additional steps to modify sensitive production data in the cloned database.
-
Scripts:
- clone-database.ps1: The main PowerShell script for cloning the database.
-
Documentation:
- README.md: Provides an overview of the script, instructions on usage, and any prerequisites.
- LICENSE: Specifies the terms under which the script is distributed.
-
Configuration:
- config.ps1: Configuration file containing variables such as server names, database names, and resource group names. Users can customize these variables based on their environment.
-
Credentials:
- credentials.ps1: Placeholder for credentials required for database authentication. Users need to fill in their credentials securely.
- Clone the repository to your local machine.
git clone https://github.com/BillPelegrini/cloneazuresql.git
- Navigate to the repository directory.
cd database-cloning-script
- Update the config.ps1 file with your Azure SQL and resource group details.
- Populate the credentials.ps1 file with the necessary login credentials securely.
- Run the script using PowerShell.
.\Scripts\clone-database.ps1
- Monitor the script output for success or any encountered errors.
- Ensure you have the required permissions and Azure PowerShell modules installed.
- Exercise caution when handling sensitive information such as login credentials.
- This script is intended for educational and demonstration purposes. Modify it according to your production requirements.
Feel free to contribute, report issues, or suggest improvements. Happy cloning!