Total Page Preview:   000000024315

Azure Powershall - Take or get azure database back in backpack file using powershell command

In this article I am going to explain how to Take or get azure database back in backpack file using powershell command.

Get or Take Azure Database back into .bacpac Powershell Scripts :

param([string]$ConnectionString , 

      [string]$DatabaseName ,


      [string]$SqlInstallationFolder = "C:\Program Files (x86)\Microsoft SQL Server")


$ConnectionString="Server =;Initial Catalog = ITHUBCITY;Persist Security Info=False;User ID = dbuser;Password = admin@123;



$DatabaseName = "db_ITHUBCITY"


$OutputFile = "F:\db_ITHUBCITY.bacpac"


# Load DAC assembly.

$DacAssembly = "$SqlInstallationFolder\110\DAC\bin\Microsoft.SqlServer.Dac.dll"

Write-Host "Loading Dac Assembly: $DacAssembly"

Add-Type -Path $DacAssembly

Write-Host "Dac Assembly loaded."


# Initialize Dac service.

$now = $(Get-Date).ToString("HH:mm:ss")

$Services = new-object Microsoft.SqlServer.Dac.DacServices $ConnectionString

if ($Services -eq $null





# Start the actual export.

Write-Host "Starting backup at $DatabaseName at $now

$Watch = New-Object System.Diagnostics.StopWatch




Write-Host "Backup completed in" $Watch.Elapsed.ToString()



Take Azure Database Backup Into Backpack Using Powershell
By Brijesh Kumar

Thank You

About Author

Brijesh Kumar

Database Developer

I have more then 6 years Experience in Microsoft Technologies - SQL Server Database, ETL Azure Cloud - Azure SQL Database, CosmosDB, Azure Data Factory, PowerBI, Web Job, Azure Function, Azure Storage, Web Apps, Powershall and Database Migration On-Premise to Azure Cloud.
LinkedIn :





Facebook User: