How to create a local copy of databse and app sources

Pepe López Rincón 1 Reputation point
2022-09-19T11:52:29.883+00:00

Hi,

I would like to create a local copy of my databases and applications source files. How can I do it?
Thanks in advance

Azure SQL Database
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,778 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Alberto Morillo 33,866 Reputation points MVP
    2022-09-19T16:09:16.417+00:00

    Let me know if remote debugging options is good enough for you.

    You can also have a local backup of your Azure SQL database by exporting the database as a bacpac to a local drive in your computer. You can use SqlPackage utility for that:

    SqlPackage /Action:Export /SourceServerName:SampleSQLServer.sample.net,1433  
      
    /SourceDatabaseName:SampleDatabase /TargetFile:"F:\Temp\SampleDatabase.bacpac"  
    

    You can use PowerShell also.

    $exportRequest = New-AzSqlDatabaseExport -ResourceGroupName $ResourceGroupName -ServerName $ServerName `  
      -DatabaseName $DatabaseName -StorageKeytype $StorageKeytype -StorageKey $StorageKey -StorageUri $BacpacUri `  
      -AdministratorLogin $creds.UserName -AdministratorLoginPassword $creds.Password  
    

    After that import that bacpac to a local SQL Server instance.

    0 comments No comments

  2. Oury Ba-MSFT 19,101 Reputation points Microsoft Employee
    2022-09-30T17:16:23.35+00:00

    Hi @Pepe López Rincón Thank you for your question. Please refer to this link. I think the same question was posted and the community provided an answer to that.
    https://learn.microsoft.com/en-us/answers/questions/1027791/index.html

    Or you can follow the blog here Export Azure SQL Database to local path to export an Azure SQL Database.

    Please let us know if that help

    Regards,
    Oury


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.