Search code examples
c#azureazure-data-lake

Use constant for Azure Datalake domain name


Is there a way to use a constant from the Microsoft.Azure.DataLake.Store Nuget package (or elsewhere) to specify the Azure Data Lake Store domain name without hardcoding {dataLakeName}.azuredatalakestore.net into the codebase ?

I'm using AdlsClient.CreateClient(dataLakeFqdn, serviceCredentials);


Solution

  • Update:

    You can go through the source code.

    For method AdlsClient.CreateClient(dataLakeFqdn, serviceCredentials);, it's here. And inside the method, it calls the constuctor method new AdlsClient(accountFqdn, Interlocked.Increment(ref _atomicClientId), creds);.

    When you nav to the constructor mentioned above, it's listed here in source code. And inside the constructor method, you can see it calls IsValidAccount method. And IsValidAccount method only do a regular expression match operation: return Regex.IsMatch(accnt, @"^[a-zA-Z0-9\-]+\.[a-zA-Z0-9\-][a-zA-Z0-9.\-]*$");.

    Or you can just directly search azuredatalakestore.net in source code here, and set search scope to "in this repository". In the search result, no azuredatalakestore.net is defined by sdk. You can follow this screenshot for search:

    enter image description here


    No.

    Since the dataLakeName is provided by you, how does SDK or other methods know the dataLakeName without your input or hard-code it there?

    And I'm not sure why you're going to avoid hard-coding the {dataLakeName}.azuredatalakestore.net, and here the hard-coding should be the easiest / simple way.

    If you have any concerns, please let me know.