Configure Azure Blob Data Set Mappings

The azure-native:datashare:BlobDataSetMapping resource, part of the Pulumi Azure Native provider, defines where incoming blob datasets land in the consumer’s storage account: the target container, file path, and subscription. This guide focuses on one capability: mapping shared blob datasets to storage destinations.

Data set mappings connect existing share subscriptions to existing storage accounts, referencing datasets by their unique IDs. The example is intentionally small. Combine it with your own Data Share accounts, share subscriptions, and storage infrastructure.

Map a blob dataset to a storage destination

When you subscribe to a data share, you need to tell Azure Data Share where to write the incoming data in your own storage account.

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

const blobDataSetMapping = new azure_native.datashare.BlobDataSetMapping("blobDataSetMapping", {
    accountName: "Account1",
    containerName: "C1",
    dataSetId: "a08f184b-0567-4b11-ba22-a1199336d226",
    dataSetMappingName: "DatasetMapping1",
    filePath: "file21",
    kind: "Blob",
    resourceGroup: "SampleResourceGroup",
    resourceGroupName: "SampleResourceGroup",
    shareSubscriptionName: "ShareSubscription1",
    storageAccountName: "storage2",
    subscriptionId: "433a8dfd-e5d5-4e77-ad86-90acdc75eb1a",
});
import pulumi
import pulumi_azure_native as azure_native

blob_data_set_mapping = azure_native.datashare.BlobDataSetMapping("blobDataSetMapping",
    account_name="Account1",
    container_name="C1",
    data_set_id="a08f184b-0567-4b11-ba22-a1199336d226",
    data_set_mapping_name="DatasetMapping1",
    file_path="file21",
    kind="Blob",
    resource_group="SampleResourceGroup",
    resource_group_name="SampleResourceGroup",
    share_subscription_name="ShareSubscription1",
    storage_account_name="storage2",
    subscription_id="433a8dfd-e5d5-4e77-ad86-90acdc75eb1a")
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.NewBlobDataSetMapping(ctx, "blobDataSetMapping", &datashare.BlobDataSetMappingArgs{
			AccountName:           pulumi.String("Account1"),
			ContainerName:         pulumi.String("C1"),
			DataSetId:             pulumi.String("a08f184b-0567-4b11-ba22-a1199336d226"),
			DataSetMappingName:    pulumi.String("DatasetMapping1"),
			FilePath:              pulumi.String("file21"),
			Kind:                  pulumi.String("Blob"),
			ResourceGroup:         pulumi.String("SampleResourceGroup"),
			ResourceGroupName:     pulumi.String("SampleResourceGroup"),
			ShareSubscriptionName: pulumi.String("ShareSubscription1"),
			StorageAccountName:    pulumi.String("storage2"),
			SubscriptionId:        pulumi.String("433a8dfd-e5d5-4e77-ad86-90acdc75eb1a"),
		})
		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 blobDataSetMapping = new AzureNative.DataShare.BlobDataSetMapping("blobDataSetMapping", new()
    {
        AccountName = "Account1",
        ContainerName = "C1",
        DataSetId = "a08f184b-0567-4b11-ba22-a1199336d226",
        DataSetMappingName = "DatasetMapping1",
        FilePath = "file21",
        Kind = "Blob",
        ResourceGroup = "SampleResourceGroup",
        ResourceGroupName = "SampleResourceGroup",
        ShareSubscriptionName = "ShareSubscription1",
        StorageAccountName = "storage2",
        SubscriptionId = "433a8dfd-e5d5-4e77-ad86-90acdc75eb1a",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.datashare.BlobDataSetMapping;
import com.pulumi.azurenative.datashare.BlobDataSetMappingArgs;
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 blobDataSetMapping = new BlobDataSetMapping("blobDataSetMapping", BlobDataSetMappingArgs.builder()
            .accountName("Account1")
            .containerName("C1")
            .dataSetId("a08f184b-0567-4b11-ba22-a1199336d226")
            .dataSetMappingName("DatasetMapping1")
            .filePath("file21")
            .kind("Blob")
            .resourceGroup("SampleResourceGroup")
            .resourceGroupName("SampleResourceGroup")
            .shareSubscriptionName("ShareSubscription1")
            .storageAccountName("storage2")
            .subscriptionId("433a8dfd-e5d5-4e77-ad86-90acdc75eb1a")
            .build());

    }
}
resources:
  blobDataSetMapping:
    type: azure-native:datashare:BlobDataSetMapping
    properties:
      accountName: Account1
      containerName: C1
      dataSetId: a08f184b-0567-4b11-ba22-a1199336d226
      dataSetMappingName: DatasetMapping1
      filePath: file21
      kind: Blob
      resourceGroup: SampleResourceGroup
      resourceGroupName: SampleResourceGroup
      shareSubscriptionName: ShareSubscription1
      storageAccountName: storage2
      subscriptionId: 433a8dfd-e5d5-4e77-ad86-90acdc75eb1a

The dataSetId identifies which shared dataset this mapping applies to. The storageAccountName, containerName, and filePath properties specify the exact destination in your storage account. The resourceGroup and subscriptionId properties allow cross-subscription mapping, letting you route data to storage accounts in different subscriptions than your Data Share account.

Beyond these examples

This snippet focuses on blob storage destination mapping. It’s intentionally minimal rather than a complete data sharing workflow.

The example references pre-existing infrastructure such as Data Share accounts and share subscriptions, storage accounts with containers, and shared datasets identified by dataSetId. It focuses on configuring the mapping rather than provisioning the surrounding infrastructure.

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

  • Output type configuration (outputType property)
  • Mapping status monitoring (dataSetMappingStatus)
  • Alternative dataset types (SQL, ADLS Gen2, Synapse)
  • Provisioning state handling

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

Let's configure Azure Blob Data Set Mappings

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 are required to create a BlobDataSetMapping?
You need to provide seven required properties: containerName, dataSetId, filePath, kind, resourceGroup, storageAccountName, and subscriptionId. Additionally, you must specify accountName, dataSetMappingName, resourceGroupName, and shareSubscriptionName.
What value should I use for the kind property?
The kind property must be set to Blob for blob data set mappings.
Resource Lifecycle
Which properties can't be changed after creating the mapping?
Four properties are immutable after creation: accountName, dataSetMappingName, resourceGroupName, and shareSubscriptionName.

Using a different cloud?

Explore storage guides for other cloud providers: