Storage authentication methods
To interact with nonpublic external storage from Azure Data Explorer, you must specify authentication means as part of the external storage connection string. The connection string defines the resource to access and its authentication information.
Azure Data Explorer supports the following authentication methods:
- Impersonation
- Managed identity
- Shared Access (SAS) key
- Azure AD access token
- Storage account access key
- Amazon Web Services Programmatic Access Keys
Authentication by storage type
The following table summarizes the available authentication methods for different external storage types.
| Authentication method | Available in Blob storage? | Available in Azure Data Lake Storage Gen 2? | Available in Azure Data Lake Storage Gen 1? | Available in Amazon S3? | When should you use this method? |
|---|---|---|---|---|---|
| Impersonation | ✔️ | ✔️ | ✔️ | ❌ | Use for attended flows when you need complex access control over the external storage. For example, in continuous export flows. You can also restrict storage access at the user level. |
| Managed identity | ✔️ | ✔️ | ✔️ | ❌ | Use in unattended flows, where no Azure Active Directory (Azure AD) principal can be derived to execute queries and commands. Managed identities are the only authentication solution. |
| Shared Access (SAS) key | ✔️ | ✔️ | ❌ | ❌ | SAS tokens have an expiration time. Use when accessing storage for a limited time. |
| Azure AD access token | ✔️ | ✔️ | ✔️ | ❌ | Azure AD tokens have an expiration time. Use when accessing storage for a limited time. |
| Storage account access key | ✔️ | ✔️ | ❌ | ❌ | When you need to access resources on an ongoing basis. |
| Amazon Web Services Programmatic Access Keys | ❌ | ❌ | ❌ | ✔️ | When you need to access Amazon S3 resources on an ongoing basis. |
Impersonation
Azure Data Explorer impersonates the requestor's principal identity to access the resource. To use impersonation, append ;impersonate to the connection string.
| Example |
|---|
"https://fabrikam.blob.core.windows.net/container/path/to/file.csv;impersonate" |
The principal must have the necessary permissions to perform the operation. For example in Azure Blob Storage, to read from the blob the principal needs the Storage Blob Data Reader role and to export to the blob the principal needs the Storage Blob Data Contributor role. To learn more, see Azure Blob Storage / Data Lake Storage Gen2 access control or Data Lake Storage Gen1 access control.
Managed identity
Azure Data Explorer makes requests on behalf of a managed identity and uses its identity to access resources. For a system-assigned managed identity, append ;managed_identity=system to the connection string. For a user-assigned managed identity, append ;managed_identity={object_id} to the connection string.
| Managed identity type | Example |
|---|---|
| System-assigned | "https://fabrikam.blob.core.windows.net/container/path/to/file.csv;managed_identity=system" |
| User-assigned | "https://fabrikam.blob.core.windows.net/container/path/to/file.csv;managed_identity=9ca5bb85-1c1f-44c3-b33a-0dfcc7ec5f6b" |
The managed identity must have the necessary permissions to perform the operation. For example in Azure Blob Storage, to read from the blob the managed identity needs the Storage Blob Data Reader role and to export to the blob the managed identity needs the Storage Blob Data Contributor role. To learn more, see Azure Blob Storage / Data Lake Storage Gen2 access control or Data Lake Storage Gen1 access control.
Note
Managed identity is only supported in specific Azure Data Explorer flows and requires setting up the managed identity policy. For more information, see Managed identities overview.
Shared Access (SAS) token
In the Azure portal, generate a SAS token with the required permissions.
For example, to read from the external storage specify the Read and List permissions and to export to the external storage specify the Write permissions. To learn more, see delegate access by using a shared access signature.
Use the SAS URL as the connection string.
| Example |
|---|
"https://fabrikam.blob.core.windows.net/container/path/to/file.csv?sv=...&sp=rwd" |
Azure AD access token
To add a base-64 encoded Azure AD access token, append ;token={AadToken} to the connection string. The token must be for the resource https://storage.azure.com/.
For more information on how to generate an Azure AD access token, see get an access token for authorization.
| Example |
|---|
"https://fabrikam.blob.core.windows.net/container/path/to/file.csv;token=eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Im..." |
Storage account access key
To add a storage account access key, append the key to the connection string. In Azure Blob Storage, append ;{key} to the connection string. For Azure Data Lake Storage Gen 2, append ;sharedkey={key} to the connection string.
| Storage account | Example |
|---|---|
| Azure Blob Storage | "https://fabrikam.blob.core.windows.net/container/path/to/file.csv;ljkAkl...==" |
| Azure Data Lake Storage Gen2 | "abfss://fs@fabrikam.dfs.core.windows.net/path/to/file.csv;sharedkey=sv=...&sp=rwd" |
Amazon Web Services programmatic access keys
To add Amazon Web Services access keys, append ;AwsCredentials={ACCESS_KEY_ID},{SECRET_ACCESS_KEY} to the connection string.
| Example |
|---|
"https://yourbucketname.s3.us-east-1.amazonaws.com/path/to/file.csv;AwsCredentials=AKIAIOSFODNN7EXAMPLE,wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY" |