Configure Azure Data Share Blob Folder Datasets

The azure-native:datashare:BlobFolderDataSet resource, part of the Pulumi Azure Native provider, registers an Azure Blob Storage folder as a dataset within an Azure Data Share share. This guide focuses on one capability: adding blob folder datasets to existing shares.

A blob folder dataset belongs to a Data Share share, which belongs to a Data Share account. The blob storage container must exist separately. The examples are intentionally small. Combine them with your own Data Share infrastructure and storage account references.

Add a blob folder to a data share

Data providers building shares start by adding blob folder datasets that point to existing storage containers, establishing what consumers receive when they accept the share.

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

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

blob_folder_data_set = azure_native.datashare.BlobFolderDataSet("blobFolderDataSet",
    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.NewBlobFolderDataSet(ctx, "blobFolderDataSet", &datashare.BlobFolderDataSetArgs{
			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 blobFolderDataSet = new AzureNative.DataShare.BlobFolderDataSet("blobFolderDataSet", 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.BlobFolderDataSet;
import com.pulumi.azurenative.datashare.BlobFolderDataSetArgs;
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 blobFolderDataSet = new BlobFolderDataSet("blobFolderDataSet", BlobFolderDataSetArgs.builder()
            .accountName("Account1")
            .dataSetName("Dataset1")
            .resourceGroupName("SampleResourceGroup")
            .shareName("Share1")
            .build());

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

The accountName and shareName properties identify where the dataset lives in the Data Share hierarchy. The dataSetName provides a unique identifier for this dataset within the share. The resourceGroupName specifies the Azure resource group containing the Data Share account. This minimal configuration registers the dataset; additional properties like containerName, prefix, and storageAccountName specify which blob folder to share.

Beyond these examples

This snippet focuses on dataset registration within shares. It’s intentionally minimal rather than a complete data sharing configuration.

The example references pre-existing infrastructure such as Data Share accounts, Data Share shares, and Azure storage accounts with blob containers. It focuses on dataset registration rather than provisioning the surrounding infrastructure.

To keep things focused, common dataset patterns are omitted, including:

  • Storage account connection details (containerName, prefix, storageAccountName)
  • Cross-subscription sharing (subscriptionId, resourceGroup)
  • Dataset kind specification (kind property)

These omissions are intentional: the goal is to illustrate how the dataset resource is wired, not provide drop-in data sharing modules. See the BlobFolderDataSet resource reference for all available configuration options.

Let's configure Azure Data Share Blob Folder 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 & Setup
What properties can't be changed after creating a BlobFolderDataSet?
Four properties are immutable: accountName, dataSetName, resourceGroupName, and shareName. Changes to these require resource replacement.
Why must I set kind to 'BlobFolder'?
The kind property identifies the data set type and must be set to ‘BlobFolder’ for this resource.
What's the difference between containerName and prefix?
containerName specifies the storage container that has the file path, while prefix defines the specific blob folder path within that container.
Resource Management
How do I import an existing BlobFolderDataSet?
Use the Pulumi import command with the full resource identifier: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}.
What is the dataSetId output property?
dataSetId is a unique identifier assigned by Azure for the data set resource, available after creation.

Using a different cloud?

Explore analytics guides for other cloud providers: