Why a PowerShell script? You can use plan T-SQL to backup to / restore from Azure BLOB Storage, see
Please provide windows powershell commands to import a database backup file which is on azure blob storage account to my azure SQL vm in which sql image is installed
we have a windows sql vm where we have a preinstalled sql windows 2022 image in it. Now there is a database backup file that is stored in azure blob storage now we want to import that file into this azure sql vm
can we get any powershell commands for this?
Azure Blob Storage
Windows for business | Windows Server | User experience | PowerShell
SQL Server | Other
2 answers
Sort by: Most helpful
-
-
SSingh-MSFT 16,371 Reputation points Moderator
2024-11-05T06:54:41.84+00:00 Welcome to Microsoft Q&A forum.
As I understand, you want to perform import the backup to Azure SQL VM.
You may do this using Backup job.
Please refer to https://learn.microsoft.com/en-us/azure/backup/backup-azure-sql-automation
for complete detailed documentation.
Also refer https://gist.github.com/voxon2/be29a3fd6dabbb9155ca to ExportAzureDatabaseToBlobStorage as reference and modify it as per you usecase.
Let us know if you have more queries.
Thanks