Configure Azure Data Share ADLS Gen2 File System Datasets

The azure-native:datashare:ADLSGen2FileSystemDataSet resource, part of the Pulumi Azure Native provider, registers an ADLS Gen2 file system as a data set within an Azure Data Share share. This guide focuses on one capability: adding ADLS Gen2 file systems to existing shares.

Data sets belong to shares within Data Share accounts. The examples reference these parent resources by name. The examples are intentionally small. Combine them with your own Data Share infrastructure and storage account references.

Add an ADLS Gen2 file system to a share

Data providers building shares start by adding data sets that point to source storage, with ADLS Gen2 file systems being a common choice for hierarchical data.

import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const adlsGen2FileSystemDataSet = new azure_native.datashare.ADLSGen2FileSystemDataSet("adlsGen2FileSystemDataSet", {
    accountName: "Account1",
    dataSetName: "Dataset1",
    resourceGroupName: "SampleResourceGroup",
    shareName: "Share1",
});
import pulumi
import pulumi_azure_native as azure_native

adls_gen2_file_system_data_set = azure_native.datashare.ADLSGen2FileSystemDataSet("adlsGen2FileSystemDataSet",
    account_name="Account1",
    data_set_name="Dataset1",
    resource_group_name="SampleResourceGroup",
    share_name="Share1")
package main

import (
	datashare "github.com/pulumi/pulumi-azure-native-sdk/datashare/v3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := datashare.NewADLSGen2FileSystemDataSet(ctx, "adlsGen2FileSystemDataSet", &datashare.ADLSGen2FileSystemDataSetArgs{
			AccountName:       pulumi.String("Account1"),
			DataSetName:       pulumi.String("Dataset1"),
			ResourceGroupName: pulumi.String("SampleResourceGroup"),
			ShareName:         pulumi.String("Share1"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var adlsGen2FileSystemDataSet = new AzureNative.DataShare.ADLSGen2FileSystemDataSet("adlsGen2FileSystemDataSet", new()
    {
        AccountName = "Account1",
        DataSetName = "Dataset1",
        ResourceGroupName = "SampleResourceGroup",
        ShareName = "Share1",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.datashare.ADLSGen2FileSystemDataSet;
import com.pulumi.azurenative.datashare.ADLSGen2FileSystemDataSetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var adlsGen2FileSystemDataSet = new ADLSGen2FileSystemDataSet("adlsGen2FileSystemDataSet", ADLSGen2FileSystemDataSetArgs.builder()
            .accountName("Account1")
            .dataSetName("Dataset1")
            .resourceGroupName("SampleResourceGroup")
            .shareName("Share1")
            .build());

    }
}
resources:
  adlsGen2FileSystemDataSet:
    type: azure-native:datashare:ADLSGen2FileSystemDataSet
    properties:
      accountName: Account1
      dataSetName: Dataset1
      resourceGroupName: SampleResourceGroup
      shareName: Share1

The accountName, shareName, and dataSetName properties identify where this data set lives in the Data Share hierarchy. The resourceGroupName specifies the Azure resource group containing the Data Share account. This minimal configuration registers the data set; additional properties (fileSystem, storageAccountName, subscriptionId, resourceGroup) specify which ADLS Gen2 file system to share.

Beyond these examples

These snippets focus on data set registration within shares. They’re intentionally minimal rather than complete data sharing workflows.

The examples reference pre-existing infrastructure such as Azure Data Share accounts and shares, and ADLS Gen2 storage accounts and file systems. They focus on registering the data set rather than provisioning the surrounding infrastructure.

To keep things focused, common data set patterns are omitted, including:

  • Storage account identification (fileSystem, storageAccountName, subscriptionId, resourceGroup)
  • Cross-subscription or cross-region sharing configuration
  • Data set synchronization schedules
  • Consumer-side data set mappings

These omissions are intentional: the goal is to illustrate how data set registration is wired, not provide drop-in data sharing modules. See the ADLS Gen2 File System Data Set resource reference for all available configuration options.

Let's configure Azure Data Share ADLS Gen2 File System Datasets

Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.

Try Pulumi Cloud for FREE

Frequently Asked Questions

Configuration & Requirements
What properties are required to create an ADLS Gen2 file system data set?
You must provide five properties: fileSystem (the file system name), kind (must be ‘AdlsGen2FileSystem’), resourceGroup (resource group of the storage account), storageAccountName (storage account name), and subscriptionId (subscription id of the storage account).
What value should I use for the kind property?
The kind property must be set to AdlsGen2FileSystem.
Can I reference a storage account in a different Azure subscription?
Yes, use the subscriptionId property to specify the subscription id of the storage account you want to reference.
Immutability & Updates
Which properties can't be changed after creating the data set?
Four properties are immutable after creation: accountName, dataSetName, resourceGroupName, and shareName. Changing any of these requires recreating the resource.

Using a different cloud?

Explore storage guides for other cloud providers: