Unity Catalog and External Locations

Gopinath Rajee 656 Reputation points
2022-12-01T02:06:29.867+00:00

All,

Looks like we need to create one External Location for each of the Containers in the Storage Account as per the documentation. Is this true?

I would think the easiest would be to create one location per storage account. But it looks like everytime we add a new container we need to create an External Location for this new container.

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,272 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KranthiPakala-MSFT 46,597 Reputation points Microsoft Employee
    2022-12-02T03:42:34.443+00:00

    Hello @Gopinath Rajee ,

    Thanks for the question and using MS Q&A platform.

    As per the product documentation statement each cloud storage path can be associated with only one external location and if you attempt to create a second external location that references the same path, the command fails. Which means you can have same container for multiple external locations, but the actual path should be different. For example:

    Example 1:

    -- Grant `finance` user permission to create external location on `my_azure_storage_cred` storage credential, and then create an external location on the specific path to which `my_azure_storage_cred` has access  
    > GRANT CREATE EXTERNAL LOCATION ON STORAGE CREDENTIAL `my_azure_storage_cred` TO `finance`  
    > CREATE EXTERNAL LOCATION `finance_loc` URL 'abfss://container@storageaccount.dfs.core.windows.net/depts/finance'  
        WITH (CREDENTIAL `my_azure_storage_cred`)  
        COMMENT 'finance';  
    

    Example 2:

    -- Grant `marketing` user permission to create external location on `my_azure_storage_cred` storage credential, and then create an external location on the specific path to which `my_azure_storage_cred` has access  
    > GRANT CREATE EXTERNAL LOCATION ON STORAGE CREDENTIAL `my_azure_storage_cred` TO `marketing`  
    > CREATE EXTERNAL LOCATION `marketing_loc` URL 'abfss://container@storageaccount.dfs.core.windows.net/depts/marketing'  
        WITH (CREDENTIAL `my_azure_storage_cred`)  
        COMMENT 'marketing';  
    

    Hope this info helps.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.