@@ -14,15 +14,15 @@ public static class KustoExtensions
1414 NullValueHandling = NullValueHandling . Ignore ,
1515 Formatting = Formatting . Indented ,
1616 ContractResolver = new Newtonsoft . Json . Serialization . CamelCasePropertyNamesContractResolver ( )
17-
17+
1818
1919 } ;
2020
2121 public static string BracketIfIdentifier ( this string name )
2222 {
23- return reservedKustoWords . Contains ( name )
24- ? $ "['{ name } ']"
25- : name . StartsWith ( "[" )
23+ return reservedKustoWords . Contains ( name )
24+ ? $ "['{ name } ']"
25+ : name . StartsWith ( "[" )
2626 ? name
2727 : KustoFacts . BracketNameIfNecessary ( name ) ;
2828 }
@@ -65,8 +65,21 @@ public static JObject AsDynamic(this DataTable table)
6565
6666 public static string ToKustoClusterUrl ( this string cluster , bool ingest = false )
6767 {
68- var ingestPrefix = ingest ? "ingest-" : "" ;
69- return cluster . StartsWith ( "https" ) ? cluster : $ "https://{ ingestPrefix } { cluster } .kusto.windows.net";
68+ if ( string . IsNullOrWhiteSpace ( cluster ) )
69+ return cluster ?? string . Empty ;
70+
71+ // Full URL passed → return as-is
72+ if ( cluster . StartsWith ( "https" , StringComparison . OrdinalIgnoreCase ) )
73+ return cluster ;
74+
75+ var ingestPrefix = ingest ? "ingest-" : string . Empty ;
76+
77+ // Fabric support
78+ if ( cluster . EndsWith ( ".fabric.microsoft.com" , StringComparison . OrdinalIgnoreCase ) )
79+ return $ "https://{ ingestPrefix } { cluster } ";
80+
81+ // Original mapping: shorthand → *.kusto.windows.net
82+ return $ "https://{ ingestPrefix } { cluster } .kusto.windows.net";
7083 }
7184
7285 public static bool IsFinal ( this ScriptExecuteCommandResult command )
@@ -685,4 +698,3 @@ public static string UseHtmlLineBreaks(this string query)
685698
686699 }
687700}
688-
0 commit comments