Configure Azure Blob Container Data Sets

The azure-native:datashare:BlobContainerDataSet resource, part of the Pulumi Azure Native provider, registers an Azure Storage blob container as a data set within an Azure Data Share share. This guide focuses on one capability: adding blob containers to existing shares.

Data sets belong to shares, which belong to Data Share accounts. The resource references these parent resources and the source storage container. The example is intentionally minimal. Combine it with your own Data Share infrastructure and storage account configuration.

Add a blob container to a data share

Data providers share entire blob containers with consumers, enabling access to all blobs without managing individual file permissions.

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

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

blob_container_data_set = azure_native.datashare.BlobContainerDataSet("blobContainerDataSet",
    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.NewBlobContainerDataSet(ctx, "blobContainerDataSet", &datashare.BlobContainerDataSetArgs{
			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 blobContainerDataSet = new AzureNative.DataShare.BlobContainerDataSet("blobContainerDataSet", 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.BlobContainerDataSet;
import com.pulumi.azurenative.datashare.BlobContainerDataSetArgs;
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 blobContainerDataSet = new BlobContainerDataSet("blobContainerDataSet", BlobContainerDataSetArgs.builder()
            .accountName("Account1")
            .dataSetName("Dataset1")
            .resourceGroupName("SampleResourceGroup")
            .shareName("Share1")
            .build());

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

The accountName and shareName properties identify where the data set lives in the Data Share hierarchy. The dataSetName provides a unique identifier for this data set within the share. The resourceGroupName locates the Data Share account. This example shows the minimal properties needed to register a data set; the actual storage container details (containerName, storageAccountName, subscriptionId, resourceGroup) would be specified to identify the source container.

Beyond these examples

This snippet focuses on data set 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, shares within those accounts, and blob containers in storage accounts. It focuses on registering the data set rather than provisioning the surrounding infrastructure.

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

  • Storage account and container identification (containerName, storageAccountName, subscriptionId, resourceGroup)
  • Data set kind specification (kind property)
  • Cross-subscription sharing configuration

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

Let's configure Azure Blob Container Data Sets

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 are the required properties for creating a BlobContainerDataSet?
You must provide containerName, kind (set to ‘Container’), resourceGroup, storageAccountName, subscriptionId, accountName, dataSetName, resourceGroupName, and shareName.
What value should I set for the kind property?
The kind property must be set to ‘Container’ for blob container data sets.
Immutability & Updates
What properties can't be changed after creating the data set?
The accountName, dataSetName, resourceGroupName, and shareName properties are immutable. Changing any of these will force resource replacement.
Can I move a data set to a different share after creation?
No, the shareName property is immutable and cannot be changed after creation. You would need to create a new data set in the target share.
Property Clarifications
What's the difference between resourceGroup and resourceGroupName?
resourceGroup specifies the resource group of the storage account containing your blob container, while resourceGroupName specifies the resource group containing the Data Share account itself.
What is the dataSetId property used for?
The dataSetId is a computed output property that provides a unique identifier for the data set resource. You don’t set this value; it’s generated by Azure.

Using a different cloud?

Explore storage guides for other cloud providers: