24
24
using Microsoft . Identity . Client ;
25
25
using Microsoft . SqlServer . Server ;
26
26
using System . Security . Authentication ;
27
+ using System . Linq ;
28
+
27
29
28
30
#if NETFRAMEWORK
29
31
using System . Reflection ;
@@ -762,16 +764,6 @@ internal static Version GetAssemblyVersion()
762
764
private const string AZURE_SQL_CHINA = ".database.chinacloudapi.cn" ;
763
765
private const string AZURE_SQL_FABRIC = ".database.fabric.microsoft.com" ;
764
766
765
- internal static bool IsAzureSynapseOnDemandEndpoint ( string dataSource )
766
- {
767
- return IsEndpoint ( dataSource , s_azureSqlServerOnDemandEndpoints )
768
- || dataSource . Contains ( AZURE_SYNAPSE )
769
- || dataSource . Contains ( FABRIC_DATAWAREHOUSE )
770
- || dataSource . Contains ( PBI_DATAWAREHOUSE )
771
- || dataSource . Contains ( PBI_DATAWAREHOUSE2 )
772
- || dataSource . Contains ( PBI_DATAWAREHOUSE3 ) ;
773
- }
774
-
775
767
/// <summary>
776
768
/// Represents a collection of Azure SQL Server endpoint URLs for various regions and environments.
777
769
/// </summary>
@@ -794,7 +786,25 @@ internal static bool IsAzureSynapseOnDemandEndpoint(string dataSource)
794
786
ONDEMAND_PREFIX + AZURE_SQL_USGOV ,
795
787
ONDEMAND_PREFIX + AZURE_SQL_CHINA ,
796
788
ONDEMAND_PREFIX + AZURE_SQL_FABRIC } ;
797
-
789
+ /// <summary>
790
+ /// Represents a collection of endpoint identifiers for Azure Synapse and related services.
791
+ /// </summary>
792
+ /// <remarks>This array contains predefined endpoint strings used to identify Azure Synapse and
793
+ /// associated services, such as Fabric Data Warehouse and Power BI Data Warehouse.</remarks>
794
+ internal static readonly string [ ] s_azureSynapseEndpoints = { AZURE_SYNAPSE ,
795
+ FABRIC_DATAWAREHOUSE ,
796
+ PBI_DATAWAREHOUSE ,
797
+ PBI_DATAWAREHOUSE2 ,
798
+ PBI_DATAWAREHOUSE3 } ;
799
+
800
+ internal static readonly string [ ] s_azureSynapseOnDemandEndpoints = s_azureSqlServerOnDemandEndpoints
801
+ . Concat ( s_azureSynapseEndpoints )
802
+ . ToArray ( ) ;
803
+ internal static bool IsAzureSynapseOnDemandEndpoint ( string dataSource )
804
+ {
805
+ return IsEndpoint ( dataSource , s_azureSynapseOnDemandEndpoints ) ;
806
+ }
807
+
798
808
internal static bool IsAzureSqlServerEndpoint ( string dataSource )
799
809
{
800
810
return IsEndpoint ( dataSource , s_azureSqlServerEndpoints ) ;
0 commit comments