0

I read the following documentation.

Properties specific to the Import action

Looking at the switch description for DatabaseEdition, I do not see a choice for vCore Azure SQL Database purchase model.

Is it not possible to choose the vCore model while using the SqlPackage import feature?

SqlWorldWide
  • 13,687
  • 3
  • 30
  • 54

1 Answers1

1

The DatabaseEdition parameter does support the vCore model service tiers: GeneralPurpose, BusinessCritical and Hyperscale, as is documented in the original link you shared. We can also specify the service level objective (such as GP_Gen5_2, or HS_Gen5_8, etc.) in the DatabaseServiceObjective parameter.

Here is an example of how to import a BACPAC using SqlPackage, and also have the DB created as a Hyperscale database, with 4 vCores:

'C:\Program Files\Microsoft SQL Server\150\DAC\bin\sqlpackage' /action:import /sf:C:\temp\sometest.bacpac  /tsn:someserver.database.windows.net /tdn:testdb /tu:someadmin /tp:somepassword /p:DatabaseEdition=Hyperscale /p:DatabaseServiceObjective="HS_Gen5_4"

SqlPackage can, and will, use an existing empty database as the target. So, in certain cases, it may be preferable to explicitly create the database prior to importing the BACPAC. For example, if you wanted to import a BACPAC into a new database which will be in an elastic pool, a prior step (using PowerShell / Azure CLI / REST API / SDK, etc.) to create the database first, is needed. This example shows how to create a database inside a pool using Azure CLI.