<?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: Databricks Azure Cross-Tenant connection to storage account in Administration &amp; Architecture</title>
    <link>https://community.databricks.com/t5/administration-architecture/databricks-azure-cross-tenant-connection-to-storage-account/m-p/90731#M1821</link>
    <description>&lt;P&gt;Have you tried connecting to the storage account from the compute plane itself?&lt;/P&gt;&lt;P&gt;I've used this in a notebook to confirm that i can access a storage account over the private endpoint, even when i can't add it as an external data source in the UI.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from azure.storage.blob import BlobServiceClient

# Define the storage account connection string
connection_string = "DefaultEndpointsProtocol=https;AccountName=storageaccountname;AccountKey=storageaccountkey;EndpointSuffix=core.windows.net"

# Create a BlobServiceClient using the connection string
blob_service_client = BlobServiceClient.from_connection_string(connection_string)

# List all containers in the storage account
try:
    containers = blob_service_client.list_containers()
    print("Containers in the storage account:")
    for container in containers:
        print(container['name'])
except Exception as e:
    print(f"Failed to list containers: {e}")&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 17 Sep 2024 14:11:21 GMT</pubDate>
    <dc:creator>Kaib</dc:creator>
    <dc:date>2024-09-17T14:11:21Z</dc:date>
    <item>
      <title>Databricks Azure Cross-Tenant connection to storage account</title>
      <link>https://community.databricks.com/t5/administration-architecture/databricks-azure-cross-tenant-connection-to-storage-account/m-p/82491#M1537</link>
      <description>&lt;P&gt;I'm currently facing a challenge with establishing a cross-tenant connection between Azure Databricks in Tenant A and a Storage Account in Tenant B. Below is the detailed setup of both tenants:&lt;/P&gt;&lt;P&gt;| Tenant A | Tenant B |&lt;BR /&gt;| -------- | -------- |&lt;BR /&gt;| Azure Databricks, Disabled Networking | Storage Account (Hierarchical Namespace) - DFS, Disabled Networking |&lt;BR /&gt;| 2 Private Endpoints to Databricks - API and Auth | |&lt;BR /&gt;| Private Endpoint to Storage Account on Tenant B | Accepted PE Connection |&lt;BR /&gt;| Storage Credential with Service Principal from Tenant B | Service Principal with Reader/Explorer Role on SA |&lt;BR /&gt;| Test WinVM to Access Databricks | |&lt;BR /&gt;| Private DNS Zones for blob &amp;amp; dfs &amp;amp; databricks peered to one VNET | |&lt;/P&gt;&lt;P&gt;I tested the connection to the Storage Account in Tenant B using a curl -X GET command from a Linux VM within the same network and subnet where all resources in Tenant A are deployed. The connection works perfectly when tested from this VM. When the connection is attempted from outside this VM, as expected, it fails.&lt;/P&gt;&lt;P&gt;The issue arises when trying to establish an external location (Unity Catalog) within Databricks (Tenant A). The process fails with the following error:&lt;/P&gt;&lt;P&gt;`Failed to access cloud storage: [AbfsRestOperationException] () exceptionTraceId=9ecf1f01-3b05-42e8-b3e9-1a04edaa8db9`&lt;/P&gt;&lt;P&gt;I would like to mention also that Databricks Public Connection and access to Databricks is disabled, so Im running it from WindowsVM, and address is within the same VNET `10.0.0.0/24` like others resources, through PE for Databricks.&lt;/P&gt;&lt;P&gt;So nslookup resolve this from WinVM:&lt;BR /&gt;```&lt;BR /&gt;nslookup adb-123.azuredatabricks.net&lt;BR /&gt;Server: UnKnown&lt;BR /&gt;Address: 168.63.129.16&lt;/P&gt;&lt;P&gt;Non-authoritative answer:&lt;BR /&gt;Name: adb-123.privatelink.azuredatabricks.net&lt;BR /&gt;Address: 10.0.0.6&lt;BR /&gt;Aliases: adb-123.azuredatabricks.net&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;nslookup to StorageAccount on Tenant B, from WinVM on Tenant A&lt;BR /&gt;```&lt;BR /&gt;nslookup teststorageaccount.dfs.core.windows.net&lt;BR /&gt;Server: UnKnown&lt;BR /&gt;Address: 168.63.129.16&lt;/P&gt;&lt;P&gt;Non-authoritative answer:&lt;BR /&gt;Name: teststorageaccount.privatelink.dfs.core.windows.net&lt;BR /&gt;Address: 10.0.0.4&lt;BR /&gt;Aliases: teststorageaccount.dfs.core.windows.net&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;Given these results, the configuration in both Tenant A and Tenant B seems to be correct. However, there's an issue with the connection from Databricks to the Storage Account.&lt;/P&gt;&lt;P&gt;**When I enable Networking (public to all) on Storage Account then there is connection from Databricks External Location to Storage Account**, but it's not a solution.&lt;/P&gt;&lt;P&gt;I whitelisted Databricks addresses on SA, but doesn't work either.&lt;/P&gt;&lt;P&gt;| Location | Description | IP Addresses |&lt;BR /&gt;| -------- | ----------- | ------------ |&lt;BR /&gt;| West Europe | Control Plane IPs | 52.232.19.246/32, 40.74.30.80/32, 20.103.219.240/28, 4.150.168.160/28 |&lt;/P&gt;&lt;P&gt;Tested also Outbound, but didn't help. Ping to my Databricks outside of VNET was to: `40.74.30.80`&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Besides that the whole configuration was done via Terraform, but even when I add `skip_validation = true` then from Databricks UI there is still no connection to CrossTenant Storage Account&lt;/P&gt;&lt;P&gt;```hcl&lt;BR /&gt;resource "databricks_storage_credential" "crosstenant" {&lt;BR /&gt;name = "crosstenant"&lt;BR /&gt;azure_service_principal {&lt;BR /&gt;application_id = "&amp;lt;snip&amp;gt;"&lt;BR /&gt;client_secret = "&amp;lt;snip&amp;gt;"&lt;BR /&gt;directory_id = "&amp;lt;snip&amp;gt;"&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;resource "databricks_external_location" "crosstenant" {&lt;BR /&gt;credential_name = databricks_storage_credential.crosstenant.id&lt;BR /&gt;name = "ext-test-crosstenant"&lt;BR /&gt;url = "abfss://test@teststorageaccount.dfs.core.windows.net"&lt;BR /&gt;# skip_validation = true&lt;BR /&gt;}&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;The issue does not appear to be related to Terraform, as it also persists in manual way.&lt;/P&gt;&lt;P&gt;I have tested the setup with and without a Network Security Group (NSG), where NSG rules were configured to allow all traffic (Any Any Allow).&lt;/P&gt;&lt;P&gt;## Storage Account Logging:&lt;BR /&gt;I enabled logging on the Storage Account and analyzed the `StorageBlobLogs` for insights. Here’s what I observed:&lt;/P&gt;&lt;P&gt;When I clicked "Test Connection" in Databricks (deployed with skip_validation)&lt;BR /&gt;the logs show URI: `&lt;A href="https://test-storageaccount.dfs.core.windows.net/test/?upn=false&amp;amp;action=getAccessControl&amp;amp;timeout=90" target="_blank" rel="noopener"&gt;https://test-storageaccount.dfs.core.windows.net/test/?upn=false&amp;amp;action=getAccessControl&amp;amp;timeout=90&lt;/A&gt;`.&lt;/P&gt;&lt;P&gt;These requests (`callerIP`) originate from IP addresses within the `10.120.x.x` private network range, which is outside the VNETs of both Tenant A and Tenant B, e.g.:&lt;BR /&gt;```&lt;BR /&gt;10.120.254.135; 10.120.252.170; 10.120.252.215; 10.120.252.173; 10.120.254.207; 10.120.252.131; 10.120.254.163&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;When Public Networking on the Storage Account is Enabled:&lt;BR /&gt;The same private IP addresses (10.120.x.x) appear in the logs. However, it is not possible to whitelist these addresses, such as 10.120.252.0/24, as private IP ranges.&lt;/P&gt;&lt;P&gt;I tried also recommended way to use Access Connector Databricks, which is MSI, however, there is no available option to add a Storage Credential using MSI in a cross-tenant scenario. Therefore, I switched to using a Service Principal, which successfully works—but only when public networking is enabled on the Storage Account.&lt;BR /&gt;&lt;BR /&gt;So question is: How to establish Cross Tenant configuration through PE, and keep destination Storage Account without Public Networking (Disabled with PE)?&lt;/P&gt;&lt;P&gt;Any insights or suggestions on what might be going wrong or potential steps to troubleshoot further would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you in advance for your help!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2024 07:44:26 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/databricks-azure-cross-tenant-connection-to-storage-account/m-p/82491#M1537</guid>
      <dc:creator>Behwar</dc:creator>
      <dc:date>2024-08-09T07:44:26Z</dc:date>
    </item>
    <item>
      <title>Re: Databricks Azure Cross-Tenant connection to storage account</title>
      <link>https://community.databricks.com/t5/administration-architecture/databricks-azure-cross-tenant-connection-to-storage-account/m-p/90731#M1821</link>
      <description>&lt;P&gt;Have you tried connecting to the storage account from the compute plane itself?&lt;/P&gt;&lt;P&gt;I've used this in a notebook to confirm that i can access a storage account over the private endpoint, even when i can't add it as an external data source in the UI.&lt;/P&gt;&lt;LI-CODE lang="python"&gt;from azure.storage.blob import BlobServiceClient

# Define the storage account connection string
connection_string = "DefaultEndpointsProtocol=https;AccountName=storageaccountname;AccountKey=storageaccountkey;EndpointSuffix=core.windows.net"

# Create a BlobServiceClient using the connection string
blob_service_client = BlobServiceClient.from_connection_string(connection_string)

# List all containers in the storage account
try:
    containers = blob_service_client.list_containers()
    print("Containers in the storage account:")
    for container in containers:
        print(container['name'])
except Exception as e:
    print(f"Failed to list containers: {e}")&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 17 Sep 2024 14:11:21 GMT</pubDate>
      <guid>https://community.databricks.com/t5/administration-architecture/databricks-azure-cross-tenant-connection-to-storage-account/m-p/90731#M1821</guid>
      <dc:creator>Kaib</dc:creator>
      <dc:date>2024-09-17T14:11:21Z</dc:date>
    </item>
  </channel>
</rss>

