Connecting to Azure Data Lake Storage
Connecting to Azure Data Lake Storage
Set AzureStorageAccount to your Azure Data Lake Storage account name.
Authenticating to Azure Data Lake Storage
You can authenticate to Azure Data Lake Storage via Access Key, Shared Access Signature (SAS), AzureAD user, Azure MSI, or Azure Service Principal.
Access Key
Set the following to authenticate with an Azure Access Key:
- AuthScheme: Set this to AccessKey.
- AzureAccessKey: Set this to the storage key associated with your Azure Data Lake Storage account.
Shared Access Signature (SAS)
Set the following to authenticate with an Shared Access Signature (SAS):- AuthScheme: Set this to AzureStorageSAS.
- AzureSharedAccessSignature: Set this to the SAS associated with your Azure Blob Storage account.
- Sign into the Azure Portal with the credentials for your root account. (https://portal.azure.com/)
- Click storage accounts and select the storage account you want to use.
- Under settings, click Shared Access Signature.
- Set the permissions.
- Specify when you want the token to expire.
- Click Generate SAS and copy the shared access signature it generates.
- Set AzureSharedAccessSignature to the shared access signature from the previous step.
AzureAD User
AuthScheme must be set to AzureAD in all user account flows.
Desktop Applications
CData provides an embedded OAuth application that simplifies OAuth desktop Authentication. Alternatively, you can create a custom OAuth application. See Creating a Custom OAuth App for information about creating custom applications and reasons for doing so.Get and Refresh the OAuth Access Token
After setting the following, you are ready to connect:
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- OAuthClientId (custom applications only): Set this to the client Id assigned when you registered your app.
- OAuthClientSecret (custom applications only): Set this to the client secret assigned when you registered your app.
- CallbackURL (custom application only): Set this to the redirect URI defined when you registered your app. For example: http://localhost:33333
- The connector obtains an access token from the Microsoft identity platform and uses it to request data.
- The OAuth values are saved in the location specified in OAuthSettingsLocation, to be persisted across connections.
Azure Service Principal
The authentication as an Azure Service Principal is handled via the OAuth Client Credentials flow. It does not involve direct user authentication. Instead, credentials are created for just the application itself. All tasks taken by the app are done without a default user context, but based on the assigned roles. The application access to the resources is controlled through the assigned roles' permissions.
Create an AzureAD App and an Azure Service Principal
When authenticating using an Azure Service Principal, you must create and register an Azure AD application with an Azure AD tenant. See Creating an Azure AD Application for more details.
In your App Registration in portal.azure.com, navigate to API Permissions and select the Microsoft Graph permissions. There are two distinct sets of permissions: Delegated permissions and Application permissions. The permissions used during client credential authentication are under Application Permissions.
Assign a role to the application
To access resources in your subscription, you must assign a role to the application.
- Open the Subscriptions page by searching and selecting the Subscriptions service from the search bar.
- Select the subscription to assign the application to.
- Open the Access control (IAM) and select Add > Add role assignment to open the Add role assignment page.
- Select Owner as the role to assign to your created Azure AD app.
Client Secret
Set these connection properties:
- AuthScheme: AzureServicePrincipal to use a client secret.
- InitiateOAuth: GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- AzureTenant: The tenant you want to connect to.
- OAuthClientId: The client Id in your application settings.
- OAuthClientSecret: The client secret in your application settings.
Certificate
Set these connection properties:
- AuthScheme: AzureServicePrincipalCert to use a certificate.
- InitiateOAuth: GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- AzureTenant: The tenant you want to connect to.
- OAuthJWTCert: The JWT Certificate store.
- OAuthJWTCertType: The type of the certificate store specified by OAuthJWTCert.
You are now ready to connect. Authentication with client credentials takes place automatically like any other connection, except there is no window opened prompting the user. Because there is no user context, there is no need for a browser popup. Connections take place and are handled internally.
Azure MSI
If you are connecting from an Azure VM with permissions for Azure Data Lake Storage, set AuthScheme to AzureMSI.
Azure Service Principal
If you would like to authenticate with a service principal instead of a client secret, it is also possible to authenticate with a client certificate. Set the following to authenticate:
- InitiateOAuth: Set this to GETANDREFRESH. You can use InitiateOAuth to avoid repeating the OAuth exchange and manually setting the OAuthAccessToken.
- AuthScheme: Set this to AzureServicePrincipal.
- AzureTenant: Set this to the tenant you wish to connect to.
- OAuthGrantType: Set this to CLIENT.
- OAuthClientId: Set this to the Client Id in your app settings.
- OAuthJWTCert: Set this to the JWT Certificate store.
- OAuthJWTCertType: Set this to the type of the certificate store specified by OAuthJWTCert.