You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/tools/sqlpackage/sqlpackage.md
+15-4Lines changed: 15 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ ms.collection:
14
14
15
15
# SqlPackage
16
16
17
-
**SqlPackage** is a command-line utility that automates the database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs. The primary use cases for SqlPackage focus on database portability and deployments for the SQL Server, Azure SQL, and Azure Synapse Analytics family of databases. SqlPackage can be automated using [Azure Pipelines and GitHub actions](sqlpackage-pipelines.md) or other CI/CD tools.
17
+
**SqlPackage** is a command-line utility that automates the database development tasks by exposing some of the public Data-Tier Application Framework (DacFx) APIs. The primary use cases for SqlPackage focus on database portability and deployments for the SQL Server, Azure SQL, and Azure Synapse Analytics family of databases. SqlPackage can be automated using [Azure Pipelines and GitHub actions](sqlpackage-pipelines.md) or other CI/CD tools.
18
18
19
19
**[Download the latest version](sqlpackage-download.md)**. For details about the latest release, see the [release notes](release-notes-sqlpackage.md).
20
20
@@ -30,7 +30,7 @@ Database portability is the ability to move a database schema and data between d
30
30
31
31
## Deployments
32
32
33
-
Database deployments are the process of updating a database schema to match a desired state, such as adding columns to a table or changing the contents of a stored procedure. SqlPackage supports database deployments through the [Publish](sqlpackage-publish.md) and [Extract](sqlpackage-extract.md) actions. The Publish action updates a database schema to match the contents of a source .dacpac file, while the Extract action creates a data-tier application (.dacpac) file containing the schema or schema and user data from a connected SQL database. SqlPackage enables deployments against both new or existing databases from the same artifact (.dacpac) by automatically creating a deployment plan that will apply the necessary changes to the target database. The deployment plan can be reviewed before applying the changes to the target database with either the [Script](sqlpackage-script.md) or [DeployReport](sqlpackage-deploy-drift-report.md) actions.
33
+
Database deployments are the process of updating a database schema to match a desired state, such as adding columns to a table or changing the contents of a stored procedure. SqlPackage supports database deployments through the [Publish](sqlpackage-publish.md) and [Extract](sqlpackage-extract.md) actions. The Publish action updates a database schema to match the contents of a source .dacpac file, while the Extract action creates a data-tier application (.dacpac) file containing the schema or schema and user data from a connected SQL database. SqlPackage enables deployments against both new or existing databases from the same artifact (.dacpac) by automatically creating a deployment plan that applies the necessary changes to the target database. The deployment plan can be reviewed before applying the changes to the target database with either the [Script](sqlpackage-script.md) or [DeployReport](sqlpackage-deploy-drift-report.md) actions.
34
34
35
35
-[Extract](sqlpackage-extract.md): Creates a data-tier application (.dacpac) file containing the schema or schema and user data from a connected SQL database.
Alternatively, you can pass the service principal client ID and secret to SqlPackage in the connection string. The [connection string format](../../connect/ado-net/sql/azure-active-directory-authentication.md#using-service-principal-authentication) includes `Authentication=Active Directory Service Principal;` and `User Id=AppId; Password=<password>`. When passing the service principal credentials in the connection string, the `/at` parameter isn't required and SqlPackage will refresh the authentication as needed during the operation.
127
+
Alternatively, you can pass the service principal client ID and secret to SqlPackage in the connection string. The [connection string format](../../connect/ado-net/sql/azure-active-directory-authentication.md#using-service-principal-authentication) includes `Authentication=Active Directory Service Principal;` and `User Id=AppId; Password=<password>`. When the service principal credentials are passed in the connection string, the `/at` parameter isn't required and SqlPackage refreshes the authentication as needed during the operation.
128
128
129
129
Service principals are supported in both [Azure DevOps](/azure/devops/integrate/get-started/authentication/service-principal-managed-identity) and [GitHub actions](https://github.com/azure/login) CI/CD pipelines.
130
130
@@ -153,6 +153,17 @@ For Linux and macOS, if the path isn't specified in the `TMPDIR` environment var
153
153
154
154
[Contained database users](../../relational-databases/security/contained-database-users-making-your-database-portable.md) are included in SqlPackage operations. However, the password portion of the definition is set to a randomly generated string by SqlPackage, the existing value isn't transferred. It's recommended that the new user's password is reset to a secure value following the import of a `.bacpac` or the deployment of a `.dacpac`. In an automated environment the password values can be retrieved from a secure keystore, such as Azure Key Vault, in a step following SqlPackage.
155
155
156
+
## Extensibility
157
+
158
+
SqlPackage supports extensibility through the [Managed Extensibility Framework (MEF)](/dotnet/framework/mef/index), enabling advanced scenarios through custom components called **contributors**. These extensions can customize how SqlPackage publishes `.dacpac` files, allowing teams to enforce standards or automate project-specific logic. Deployment contributors are executed as part of the publish process, after the deployment plan is generated but before it's executed. These contributors can access and modify the deployment plan using a `DeploymentPlanModifier` class object to add, remove, or reorder steps. To get started with deployment extensibility, see [Use deployment contributors to customize database build and deployment](../../ssdt/use-deployment-contributors-to-customize-database-build-and-deployment.md).
159
+
160
+
SqlPackage discovers and loads contributor assemblies by scanning for dynamic-link libraries (`.dll` files) in the same directory as the SqlPackage executable as well as the locations specified through optional command-line property `/p:AdditionalDeploymentContributorPaths`. While this allows for flexible customization, it also introduces important security considerations.
161
+
162
+
> [!IMPORTANT]
163
+
> Because SqlPackage uses MEF to dynamically load dynamic-link libraries (`.dll` files) at runtime, any assemblies placed alongside the SqlPackage executable may be executed as part of the deployment process. A malicious actor could exploit this behavior by introducing tampered or unauthorized extensions that execute arbitrary code.
164
+
>
165
+
> **It is your responsibility to ensure that any compiled extension files used with SqlPackage are secure and come from trusted sources.** We recommend controlling access to the SqlPackage folder and validating the integrity of all custom or third-party components.
166
+
156
167
## Usage data collection
157
168
158
169
SqlPackage contains Internet-enabled features that can collect and send anonymous feature usage and diagnostic data to Microsoft.
@@ -169,7 +180,7 @@ To disable telemetry collection and reporting, update the environment variable `
169
180
170
181
## Support
171
182
172
-
The DacFx library and the SqlPackage CLI tool have adopted the [Microsoft Modern Lifecycle Policy](https://support.microsoft.com/help/30881/modern-lifecycle-policy). All security updates, fixes, and new features are released only in the latest point version of the major version. Maintaining your DacFx or SqlPackage installations to the current version helps ensure that you receive all applicable bug fixes in a timely manner.
183
+
The DacFx library and the SqlPackage CLI tool follow the [Microsoft Modern Lifecycle Policy](https://support.microsoft.com/help/30881/modern-lifecycle-policy). All security updates, fixes, and new features are released only in the latest point version of the major version. Maintaining your DacFx or SqlPackage installations to the current version helps ensure that you receive all applicable bug fixes in a timely manner.
173
184
174
185
Get help with SqlPackage, submit feature requests, and report issues in the [DacFx GitHub repository](https://github.com/microsoft/DacFx).
0 commit comments