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 properties are required to create a blob container data set?
You must provide containerName, kind, resourceGroup, storageAccountName, and subscriptionId. Additionally, you need accountName, dataSetName, resourceGroupName, and shareName to identify where the data set belongs.
Why must I set kind to 'Container'?
The kind property identifies the data set type. For blob container data sets, the expected value is "Container".
Immutability & Updates
What properties can't I change after creating the data set?
The properties accountName, dataSetName, resourceGroupName, and shareName are immutable. Changing these requires recreating the resource.
What's the difference between input and output properties?
Input properties like containerName are set during creation. Output properties like dataSetId are generated by Azure and available after the resource is created.
Import & Migration
How do I import an existing blob container data set?
Use pulumi import with the resource path format: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}.

Using a different cloud?

Explore storage guides for other cloud providers: