File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -61,6 +61,13 @@ SqlPackage /Action:Extract /TargetFile:"C:\AdventureWorksLT.dacpac" /UniversalAu
6161```
6262
6363``` powershell
64+ $ClientId = "<app-registration-client-id>"
65+ $ClientSecret = "<client-secret>"
66+
67+ # Convert the service principal client secret into a SecureString and create a PSCredential object for authentication.
68+ $SecureSecret = ConvertTo-SecureString $ClientSecret -AsPlainText -Force
69+ $Credential = New-Object System.Management.Automation.PSCredential($ClientId, $SecureSecret)
70+
6471# example extract to create a schema-only .dacpac file connecting using an access token associated with a service principal
6572$Account = Connect-AzAccount -ServicePrincipal -Tenant $Tenant -Credential $Credential
6673$AccessToken_Object = (Get-AzAccessToken -Account $Account -Resource "https://database.windows.net/")
You can’t perform that action at this time.
0 commit comments