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

Resource Configuration
What properties are required to create a BlobFolderDataSet?
You must provide ten properties: containerName, kind (must be ‘BlobFolder’), prefix, resourceGroup, storageAccountName, subscriptionId, accountName, dataSetName, resourceGroupName, and shareName.
What value should I use for the kind property?
The kind property must always be set to ‘BlobFolder’ for this resource type.
What storage account information do I need to provide?
You need four storage-related properties: storageAccountName (the account name), resourceGroup (the resource group containing the account), subscriptionId (the subscription ID), and containerName (the container with the file path).
Immutability & Lifecycle
Which properties can't be changed after creating the resource?
Four properties are immutable: accountName, dataSetName, resourceGroupName, and shareName. Changing these requires recreating the resource.
Examples & Usage
Why don't the provided examples include all required properties?
The examples only show accountName, dataSetName, resourceGroupName, and shareName, but you also need containerName, kind, prefix, resourceGroup, storageAccountName, and subscriptionId to successfully create the resource.

Using a different cloud?

Explore analytics guides for other cloud providers: