The azure-native:datashare:BlobFolderDataSetMapping resource, part of the Pulumi Azure Native provider, defines how a shared blob folder dataset maps to a consumer’s storage account, specifying the destination container and folder prefix. This guide focuses on one capability: mapping blob folder datasets to storage containers.
Dataset mappings belong to share subscriptions, which are created when you accept a data sharing invitation. The mapping requires an existing Data Share account, an active share subscription, and a target storage account with a container. The examples are intentionally small. Combine them with your own Data Share infrastructure and storage configuration.
Map a blob folder dataset to storage
When you accept a data share invitation, you create mappings that route incoming datasets to your storage accounts.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const blobFolderDataSetMapping = new azure_native.datashare.BlobFolderDataSetMapping("blobFolderDataSetMapping", {
accountName: "Account1",
dataSetMappingName: "DatasetMapping1",
resourceGroupName: "SampleResourceGroup",
shareSubscriptionName: "ShareSubscription1",
});
import pulumi
import pulumi_azure_native as azure_native
blob_folder_data_set_mapping = azure_native.datashare.BlobFolderDataSetMapping("blobFolderDataSetMapping",
account_name="Account1",
data_set_mapping_name="DatasetMapping1",
resource_group_name="SampleResourceGroup",
share_subscription_name="ShareSubscription1")
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.NewBlobFolderDataSetMapping(ctx, "blobFolderDataSetMapping", &datashare.BlobFolderDataSetMappingArgs{
AccountName: pulumi.String("Account1"),
DataSetMappingName: pulumi.String("DatasetMapping1"),
ResourceGroupName: pulumi.String("SampleResourceGroup"),
ShareSubscriptionName: pulumi.String("ShareSubscription1"),
})
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 blobFolderDataSetMapping = new AzureNative.DataShare.BlobFolderDataSetMapping("blobFolderDataSetMapping", new()
{
AccountName = "Account1",
DataSetMappingName = "DatasetMapping1",
ResourceGroupName = "SampleResourceGroup",
ShareSubscriptionName = "ShareSubscription1",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.datashare.BlobFolderDataSetMapping;
import com.pulumi.azurenative.datashare.BlobFolderDataSetMappingArgs;
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 blobFolderDataSetMapping = new BlobFolderDataSetMapping("blobFolderDataSetMapping", BlobFolderDataSetMappingArgs.builder()
.accountName("Account1")
.dataSetMappingName("DatasetMapping1")
.resourceGroupName("SampleResourceGroup")
.shareSubscriptionName("ShareSubscription1")
.build());
}
}
resources:
blobFolderDataSetMapping:
type: azure-native:datashare:BlobFolderDataSetMapping
properties:
accountName: Account1
dataSetMappingName: DatasetMapping1
resourceGroupName: SampleResourceGroup
shareSubscriptionName: ShareSubscription1
The mapping connects a source dataset (via dataSetId) to your storage infrastructure. The accountName and shareSubscriptionName identify where the mapping lives. The containerName and prefix specify where data lands in your storage account. The storageAccountName, resourceGroup, and subscriptionId point to your target storage. When the provider sends data, Azure Data Share writes it to your specified container and folder prefix.
Beyond these examples
This snippet focuses on blob folder dataset mapping configuration. It’s intentionally minimal rather than a full data sharing workflow.
The example references pre-existing infrastructure such as Data Share accounts, share subscriptions (from accepted invitations), storage accounts, containers, and resource groups, and source datasets from data providers. It focuses on configuring the mapping rather than provisioning the surrounding infrastructure.
To keep things focused, common mapping patterns are omitted, including:
- Dataset mapping for other storage types (ADLS Gen2, SQL, Synapse)
- Mapping validation and provisioning state handling
- Cross-subscription or cross-region mapping scenarios
- Mapping updates or reconfiguration
These omissions are intentional: the goal is to illustrate how blob folder mappings are wired, not provide drop-in data sharing modules. See the BlobFolderDataSetMapping resource reference for all available configuration options.
Let's configure Azure Data Share Blob Folder Mappings
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration & Required Fields
containerName (container with the file path), dataSetId (source data set ID), kind (must be ‘BlobFolder’), prefix (blob folder prefix), resourceGroup (storage account resource group), storageAccountName (source storage account name), and subscriptionId (storage account subscription ID). Additionally, you need the four immutable identifier properties: accountName, dataSetMappingName, resourceGroupName, and shareSubscriptionName.kind property must be set to ‘BlobFolder’ for this resource type.accountName, dataSetMappingName, resourceGroupName, shareSubscriptionName), but you must also provide containerName, dataSetId, kind, prefix, resourceGroup, storageAccountName, and subscriptionId to successfully create the resource.Resource Lifecycle & Immutability
accountName, dataSetMappingName, resourceGroupName, and shareSubscriptionName. Changing these requires recreating the resource.pulumi import azure-native:datashare:BlobFolderDataSetMapping <name> /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shareSubscriptions/{shareSubscriptionName}/dataSetMappings/{dataSetMappingName}Monitoring & Status
dataSetMappingStatus indicates the operational status of the data set mapping, while provisioningState shows the Azure resource provisioning state.Using a different cloud?
Explore integration guides for other cloud providers: