<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: issues creating a foreign catalog in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172933#M56690</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266041"&gt;@DaveCh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The hyphen in the server name is valid for hostnames and IP addresses, so that isn't triggering this issue. The underlying issue here is likely the exact value being returned by secret('scope-kv-key-vault', 'ip-dagrbs-dr01'). The `DATA_SOURCE_OPTION_CONTAINS_INVALID_CHARACTERS` error SQLSTATE 42602 specifically calls out the host option. Databricks validates these connection options at the point you attempt to create the foreign catalog, which is why the initial CREATE CONNECTION statement succeeded but the catalog creation is throwing the error.&lt;/P&gt;&lt;P&gt;Typically, this occurs because the secret stored in Azure Key Vault includes extra formatting or contains invalid characters. The host option expects a plain hostname or IP address. If the secret contains a protocol prefix like tcp://, a port suffix like 10.0.0.1:1433, or any query string syntax, validation will typically fail. Since you've already defined the port correctly as a separate option, make sure the host secret doesn't duplicate it. Check if any trailing whitespace or hidden newline characters are pasted into the Key Vault entry.&lt;/P&gt;&lt;P&gt;Run below and check&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DESCRIBE CONNECTION `dagrbs-dr01`&lt;/LI-CODE&gt;&lt;P&gt;If you don't have the permissions to view the option values in it, you want to first temporarily recreate the connection using a hardcoded host string instead of the secret function. If the catalog creation succeeds with the hardcoded host, you can be sure that the Key Vault secret's payload needs to be cleaned up.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Oct 2026 10:17:46 GMT</pubDate>
    <dc:creator>balajij8</dc:creator>
    <dc:date>2026-10-13T10:17:46Z</dc:date>
    <item>
      <title>issues creating a foreign catalog</title>
      <link>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172923#M56689</link>
      <description>&lt;P&gt;I've created a foreign connection to an on prem sql server...&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CREATE&lt;/SPAN&gt; &lt;SPAN&gt;CONNECTION&lt;/SPAN&gt; &lt;SPAN&gt;IF&lt;/SPAN&gt; &lt;SPAN&gt;NOT&lt;/SPAN&gt; &lt;SPAN&gt;EXISTS&lt;/SPAN&gt; &lt;SPAN&gt;`&lt;/SPAN&gt;&lt;SPAN&gt;dagrbs-dr01&lt;/SPAN&gt;&lt;SPAN&gt;`&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;TYPE&lt;/SPAN&gt;&lt;SPAN&gt; SQLSERVER&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;OPTIONS&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; host &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;secret&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'scope-kv-key-vault'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'ip-dagrbs-dr01'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; port &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;'1433'&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;user&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;secret&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'scope-kv-key-vault'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'username-dagrbs-dr01'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; password &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;secret&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'scope-kv-key-vault'&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;'password-dagrbs-dr01'&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;next step to create the foreign catalog returns...&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;summary: [DATA_SOURCE_OPTION_CONTAINS_INVALID_CHARACTERS] Option host must not be empty and should not contain invalid characters, query strings, or parameters. SQLSTATE: 42602&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;the schema and tables are compliant with databricks naming conventions, but the server name (not specified in the connection) does include a hyphen.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Is this the issue, or am I missing something else?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 13 Oct 2026 09:28:15 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172923#M56689</guid>
      <dc:creator>DaveCh</dc:creator>
      <dc:date>2026-10-13T09:28:15Z</dc:date>
    </item>
    <item>
      <title>Re: issues creating a foreign catalog</title>
      <link>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172933#M56690</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266041"&gt;@DaveCh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The hyphen in the server name is valid for hostnames and IP addresses, so that isn't triggering this issue. The underlying issue here is likely the exact value being returned by secret('scope-kv-key-vault', 'ip-dagrbs-dr01'). The `DATA_SOURCE_OPTION_CONTAINS_INVALID_CHARACTERS` error SQLSTATE 42602 specifically calls out the host option. Databricks validates these connection options at the point you attempt to create the foreign catalog, which is why the initial CREATE CONNECTION statement succeeded but the catalog creation is throwing the error.&lt;/P&gt;&lt;P&gt;Typically, this occurs because the secret stored in Azure Key Vault includes extra formatting or contains invalid characters. The host option expects a plain hostname or IP address. If the secret contains a protocol prefix like tcp://, a port suffix like 10.0.0.1:1433, or any query string syntax, validation will typically fail. Since you've already defined the port correctly as a separate option, make sure the host secret doesn't duplicate it. Check if any trailing whitespace or hidden newline characters are pasted into the Key Vault entry.&lt;/P&gt;&lt;P&gt;Run below and check&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;DESCRIBE CONNECTION `dagrbs-dr01`&lt;/LI-CODE&gt;&lt;P&gt;If you don't have the permissions to view the option values in it, you want to first temporarily recreate the connection using a hardcoded host string instead of the secret function. If the catalog creation succeeds with the hardcoded host, you can be sure that the Key Vault secret's payload needs to be cleaned up.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2026 10:17:46 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172933#M56690</guid>
      <dc:creator>balajij8</dc:creator>
      <dc:date>2026-10-13T10:17:46Z</dc:date>
    </item>
    <item>
      <title>Re: issues creating a foreign catalog</title>
      <link>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172937#M56691</link>
      <description>&lt;P&gt;The hyphen almost certainly isn’t the problem. Hyphens are valid in hostnames, and the connection name dagrbs-dr01 is fine because it’s backticked. The error is about the value that secret() resolves to for host.&lt;/P&gt;&lt;P&gt;Most likely causes, in order:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Trailing newline or whitespace in the Key Vault secret. This is the most common cause. If the secret was created with echo, a CLI pipe, or pasted with a line break, the stored value is 10.x.x.x\n. It looks fine in the portal but fails the character validation.&lt;/LI&gt;&lt;LI&gt;The secret contains more than a bare host. Anything like 10.1.2.3,1433, 10.1.2.3:1433, tcp:10.1.2.3, server\instance, or a JDBC-style string with ; or ? parameters will trip this check. host must be just the hostname or IP, with the port in the separate port option.&lt;/LI&gt;&lt;LI&gt;The secret resolves to an empty string. This can happen if the key name or scope is slightly off, depending on how the scope is backed.&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Tue, 13 Oct 2026 10:35:07 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172937#M56691</guid>
      <dc:creator>aayush_410</dc:creator>
      <dc:date>2026-10-13T10:35:07Z</dc:date>
    </item>
    <item>
      <title>Re: issues creating a foreign catalog</title>
      <link>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172950#M56695</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266041"&gt;@DaveCh&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I did a quick validation of this with SQL Server federation in my workspace, and one thing stood out: &lt;STRONG&gt;CREATE CONNECTION&lt;/STRONG&gt; and even &lt;STRONG&gt;CREATE FOREIGN CATALOG&lt;/STRONG&gt; can succeed with a malformed host value. The stricter validation only showed up when I actually queried the foreign catalog.&lt;/P&gt;&lt;P&gt;For example, these were accepted initially:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host = x.x.x.x:1433
host = x.x.x.x?foo=bar&lt;/LI-CODE&gt;&lt;P&gt;but SHOW SCHEMAS on the Foreign Catalog then failed with:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[DATA_SOURCE_OPTION_CONTAINS_INVALID_CHARACTERS] Option host must not be empty and should not contain invalid characters, query strings, or parameters. SQLSTATE: 42602&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Using a clean host/IP with the port supplied separately:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;host 'x.x.x.x',
port '1433'&lt;/LI-CODE&gt;&lt;P&gt;got past that validation. In my test it then failed later with &lt;STRONG&gt;FAILED_JDBC_CONNECTION&lt;/STRONG&gt;, but that was a separate networking issue because the SQL Server was running on my laptop and was not reachable from Databricks serverless.&lt;/P&gt;&lt;P&gt;So for the issue you encountered, just inspect the exact value returned by the &lt;STRONG&gt;secret&lt;/STRONG&gt; used for &lt;STRONG&gt;host&lt;/STRONG&gt;. Make sure it contains only the hostname/IP, with no :1433, query string, protocol prefix, instance syntax, or hidden whitespace/newline. Keep the port in the separate port option.&lt;/P&gt;&lt;P&gt;A simple way to isolate it is to temporarily hardcode the plain hostname/IP. If the error changes from DATA_SOURCE_OPTION_CONTAINS_INVALID_CHARACTERS to a connectivity/login error, that confirms the secret value itself was the first problem.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2026 12:07:20 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172950#M56695</guid>
      <dc:creator>data_pulse</dc:creator>
      <dc:date>2026-10-13T12:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: issues creating a foreign catalog</title>
      <link>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172975#M56696</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/266041"&gt;@DaveCh&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The error message is a strong c&lt;/SPAN&gt;lue here: "Option host must not be empty and should not contain invalid characters" points to the value being resolved bysecret(), not to the server name itself.&lt;/P&gt;
&lt;P&gt;As per this &lt;A href="https://learn.microsoft.com/en-us/azure/databricks/query-federation/sql-server" target="_blank"&gt;documentation&lt;/A&gt;, the recommended pattern uses&amp;nbsp;secret()&amp;nbsp;for credentials (user&amp;nbsp;and&amp;nbsp;password) but a plain string literal for&amp;nbsp;host.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CREATE CONNECTION &amp;lt;connection-name&amp;gt; TYPE sqlserver
OPTIONS (
  host '&amp;lt;hostname&amp;gt;',
  port '&amp;lt;port&amp;gt;',
  user secret('&amp;lt;secret-scope&amp;gt;', '&amp;lt;secret-key-user&amp;gt;'),
  password secret('&amp;lt;secret-scope&amp;gt;', '&amp;lt;secret-key-password&amp;gt;')
)&lt;/LI-CODE&gt;
&lt;P&gt;The most likely cause is that your&amp;nbsp;secret('scope-kv-key-vault', 'ip-dagrbs-dr01')&amp;nbsp;call is resolving to an empty string or a value with unexpected characters. This can happen if the secret key doesn't exist in the scope, if there's a permissions issue reading from the Key Vault, or if the stored value contains trailing whitespace or hidden characters. Because&amp;nbsp;secret()&amp;nbsp;failures in SQL are often silent (returning empty rather than throwing), the connection creation just sees an empty&amp;nbsp;host&amp;nbsp;and gives you that&amp;nbsp;DATA_SOURCE_OPTION_CONTAINS_INVALID_CHARACTERS&amp;nbsp;error.&lt;/P&gt;
&lt;P&gt;Can you&amp;nbsp;verify whether the secret is actually returning a value. You can test this in a notebook cell with&amp;nbsp;dbutils.secrets.get(scope='scope-kv-key-vault', key='ip-dagrbs-dr01'). The output will be redacted, but if the key doesn't exist or you lack permissions, you'll get an explicit error there that the SQL&amp;nbsp;secret()&amp;nbsp;function swallows.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Second, as &lt;/SPAN&gt;a quick sanity check, try hardcoding the host IP directly as a plain string to confirm the connection works withoutsecret():&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CREATE CONNECTION IF NOT EXISTS `dagrbs-dr01`
  TYPE SQLSERVER
  OPTIONS (
    host '10.x.x.x',
    port '1433',
    user secret('scope-kv-key-vault', 'username-dagrbs-dr01'),
    password secret('scope-kv-key-vault', 'password-dagrbs-dr01')
  )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN&gt;If that succ&lt;/SPAN&gt;eeds, you know the issue is specifically with the secret resolution forhost. You can still use&amp;nbsp;secret()&amp;nbsp;for&amp;nbsp;host&amp;nbsp;if you need to keep the IP out of the DDL, but you'll want to make sure the Key Vault secret name is exactly right and that the value stored there is a clean hostname or IP with no extra whitespace or special characters.&lt;/P&gt;
&lt;P&gt;The hyphen in the server name itself shouldn't be the problem here since it's not part of the connection options. The error is about the resolved value of the&amp;nbsp;host&amp;nbsp;option.&lt;/P&gt;
&lt;P class="p1"&gt;&lt;FONT size="2" color="#FF6600"&gt;&lt;STRONG&gt;&lt;I&gt;If this answer resolves your question, could you mark it as “Accept as Solution”? That helps other users quickly find the correct fix.&lt;/I&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;I&gt;&lt;/I&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2026 13:45:00 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/issues-creating-a-foreign-catalog/m-p/172975#M56696</guid>
      <dc:creator>Ashwin_DSA</dc:creator>
      <dc:date>2026-10-13T13:45:00Z</dc:date>
    </item>
  </channel>
</rss>

