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
More information on the SqlPackage command-line syntax is detailed in the [SqlPackage CLI reference](cli-reference.md) and individual action pages.
51
52
52
53
## Utility commands
@@ -86,7 +87,6 @@ SqlPackage authenticates using methods available in [SqlClient](/dotnet/api/micr
86
87
-**Managed identity**
87
88
- Service principal
88
89
89
-
90
90
### Managed identity
91
91
92
92
[!INCLUDE [entra-id](../../includes/entra-id.md)]
@@ -107,7 +107,7 @@ Managed identities are supported in both [Azure DevOps](/azure/devops/integrate/
107
107
108
108
[Microsoft Entra application service principals](/azure/azure-sql/database/authentication-aad-service-principal) are security objects within a Microsoft Entra application that define what an application can do in a given tenant. They're set up in the Azure portal during the application registration process and configured to access Azure resources, like Azure SQL. For more information on configuring a service principal for your environment, see the [Service principal documentation](/entra/architecture/service-accounts-principal).
109
109
110
-
When using SqlPackage with a service principal, it may be required to retrieve the access token and pass it to SqlPackage. The access token can be retrieved using the [Azure PowerShell module](/powershell/azure) or the [Azure CLI](/cli/azure). The access token can be passed to SqlPackage using the `/at` parameter.
110
+
When using SqlPackage with a service principal, you may retrieve an access token and pass it to SqlPackage. The access token can be retrieved using the [Azure PowerShell module](/powershell/azure) or the [Azure CLI](/cli/azure). In this process, the invoking system maintains control over token refresh or invalidation. The access token can be passed to SqlPackage using the `/at` parameter.
111
111
112
112
```powershell
113
113
# example export connecting using an access token associated with a service principal
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.
126
+
125
127
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.
126
128
127
129
## Environment variables
@@ -130,14 +132,14 @@ Service principals are supported in both [Azure DevOps](/azure/devops/integrate/
130
132
131
133
Connection pooling can be enabled for all connections made by SqlPackage by setting the `CONNECTION_POOLING_ENABLED` environment variable to `True`. This setting is recommended for operations with Microsoft Entra username and password connections to avoid throttling by the Microsoft Authentication Library (MSAL).
132
134
133
-
134
135
### Temporary files
135
136
136
137
During SqlPackage operations, the table data is written to temporary files before compression or after decompression. For large databases these temporary files can take up a significant amount of disk space but their location can be specified. The export and extract operations include an optional property to specify `/p:TempDirectoryForTableData` to override the SqlPackage's default value.
137
138
138
139
The .NET API [GetTempPath](/dotnet/api/system.io.path.gettemppath) is used to determine the default value within SqlPackage.
139
140
140
141
For Windows, the following environment variables are checked in the following order and the first path that exists is used:
142
+
141
143
1. The path specified by the `TMP` environment variable.
142
144
2. The path specified by the `TEMP` environment variable.
143
145
3. The path specified by the `USERPROFILE` environment variable.
@@ -149,7 +151,6 @@ For Linux and macOS, if the path isn't specified in the `TMPDIR` environment var
149
151
150
152
[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.
151
153
152
-
153
154
## Usage data collection
154
155
155
156
SqlPackage contains Internet-enabled features that can collect and send anonymous feature usage and diagnostic data to Microsoft.
0 commit comments