Back to Browse

Export Azure SQL Database using PowerShell and Azure CLI as Bacpac

1.2K views
Oct 12, 2023
11:06

Export Azure SQL Database using PowerShell and Azure CLI as Bacpac. The New-AzSqlDatabaseExport cmdlet exports an Azure SQL Database as a .bacpac file to a storage account. The get export database status request may be sent to retrieve status information for this request. This cmdlet is also supported by the SQL Server Stretch Database service on Azure. Example 1: Create an export request for a database Open Cloudshell New-AzSqlDatabaseExport -ResourceGroupName "RG01" -ServerName "Server01" -DatabaseName "Database01" -StorageKeyType "StorageAccessKey" -StorageKey "StorageKey01" -StorageUri "http://account01.blob.core.contoso.net/bacpacs/database01.bacpac" -AdministratorLogin "User" -AdministratorLoginPassword "secure password" ResourceGroupName : RG01 ServerName : Server01 DatabaseName : Database01 StorageKeyType : StorageAccessKey StorageKey : StorageUri : http://account01.blob.core.contoso.net/bacpacs/database01.bacpac AdministratorLogin : User AdministratorLoginPassword : AuthenticationType : None OperationStatusLink : https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resource01/providers/Microsoft.Sql/servers/server01/databases/database01/importExportOperationResults/00000000-00 0-0000-0000-000000000000?api-version=2014-04-01 Status : InProgress ErrorMessage : In Azure CLI, az sql db export Export a database to a bacpac. az sql db export --admin-password --admin-user --storage-key --storage-key-type {SharedAccessKey, StorageAccessKey} --storage-uri [--auth-type {ADPassword, SQL}] [--ids] [--name] [--no-wait] [--resource-group] [--server] [--subscription] #cloudknowledge #bacpac #azuresql #azureforbeginners #cloudcomputing

Download

0 formats

No download links available.

Export Azure SQL Database using PowerShell and Azure CLI as Bacpac | NatokHD