mirror of
https://github.com/ckaczor/sqltoolsservice.git
synced 2026-02-16 10:58:30 -05:00
Add Schema Compare support for AAD (#853)
* pass AzureAcountToken if there is one * Addressing comments * formatting * more formatting and moving getting connectionstring from constructor to CreateSchemaCompareEndpoint()
This commit is contained in:
@@ -7,6 +7,7 @@ using Microsoft.SqlServer.Dac.Compare;
|
||||
using Microsoft.SqlServer.Dac.Model;
|
||||
using Microsoft.SqlTools.ServiceLayer.Connection;
|
||||
using Microsoft.SqlTools.ServiceLayer.SchemaCompare.Contracts;
|
||||
using Microsoft.SqlTools.ServiceLayer.Utility;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -107,7 +108,7 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
|
||||
}
|
||||
}
|
||||
|
||||
internal static SchemaCompareEndpoint CreateSchemaCompareEndpoint(SchemaCompareEndpointInfo endpointInfo, string connectionString)
|
||||
internal static SchemaCompareEndpoint CreateSchemaCompareEndpoint(SchemaCompareEndpointInfo endpointInfo, ConnectionInfo connInfo)
|
||||
{
|
||||
switch (endpointInfo.EndpointType)
|
||||
{
|
||||
@@ -117,7 +118,10 @@ namespace Microsoft.SqlTools.ServiceLayer.SchemaCompare
|
||||
}
|
||||
case SchemaCompareEndpointType.Database:
|
||||
{
|
||||
return new SchemaCompareDatabaseEndpoint(connectionString);
|
||||
string connectionString = GetConnectionString(connInfo, endpointInfo.DatabaseName);
|
||||
return connInfo.ConnectionDetails?.AzureAccountToken != null
|
||||
? new SchemaCompareDatabaseEndpoint(connectionString, new AccessTokenProvider(connInfo.ConnectionDetails.AzureAccountToken))
|
||||
: new SchemaCompareDatabaseEndpoint(connectionString);
|
||||
}
|
||||
default:
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user