Skip to content

Instantly share code, notes, and snippets.

@Bemesko
Created June 13, 2023 21:17
Show Gist options
  • Save Bemesko/d596c874e68c86b74add9df6141d2b6f to your computer and use it in GitHub Desktop.
Save Bemesko/d596c874e68c86b74add9df6141d2b6f to your computer and use it in GitHub Desktop.
Clone a template database in Azure using the Azure CLI
$resourceGroupName = "poc-database-script-rg"
$serverName = "berb-database-poc"
$databaseName = "source-database"
$newDatabaseName = "copy-database-cli"
az sql db copy `
--dest-name $newDatabaseName `
--dest-resource-group $resourceGroupName `
--dest-server $serverName `
--name $databaseName `
--resource-group $resourceGroupName `
--server $serverName `
--debug
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment