The azure-native:datashare:BlobDataSet resource, part of the Pulumi Azure Native provider, adds an Azure Storage blob file to a Data Share, defining which specific file consumers can access. This guide focuses on one capability: blob file dataset configuration.
Blob datasets belong to Data Share shares and reference existing storage accounts, containers, and files. The example is intentionally small. Combine it with your own Data Share infrastructure and access policies.
Add a blob file to a data share
Data providers add Azure Storage blobs to shares to make specific files available to consumers.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const blobDataSet = new azure_native.datashare.BlobDataSet("blobDataSet", {
accountName: "Account1",
containerName: "C1",
dataSetName: "Dataset1",
filePath: "file21",
kind: "Blob",
resourceGroup: "SampleResourceGroup",
resourceGroupName: "SampleResourceGroup",
shareName: "Share1",
storageAccountName: "storage2",
subscriptionId: "433a8dfd-e5d5-4e77-ad86-90acdc75eb1a",
});
import pulumi
import pulumi_azure_native as azure_native
blob_data_set = azure_native.datashare.BlobDataSet("blobDataSet",
account_name="Account1",
container_name="C1",
data_set_name="Dataset1",
file_path="file21",
kind="Blob",
resource_group="SampleResourceGroup",
resource_group_name="SampleResourceGroup",
share_name="Share1",
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.NewBlobDataSet(ctx, "blobDataSet", &datashare.BlobDataSetArgs{
AccountName: pulumi.String("Account1"),
ContainerName: pulumi.String("C1"),
DataSetName: pulumi.String("Dataset1"),
FilePath: pulumi.String("file21"),
Kind: pulumi.String("Blob"),
ResourceGroup: pulumi.String("SampleResourceGroup"),
ResourceGroupName: pulumi.String("SampleResourceGroup"),
ShareName: pulumi.String("Share1"),
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 blobDataSet = new AzureNative.DataShare.BlobDataSet("blobDataSet", new()
{
AccountName = "Account1",
ContainerName = "C1",
DataSetName = "Dataset1",
FilePath = "file21",
Kind = "Blob",
ResourceGroup = "SampleResourceGroup",
ResourceGroupName = "SampleResourceGroup",
ShareName = "Share1",
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.BlobDataSet;
import com.pulumi.azurenative.datashare.BlobDataSetArgs;
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 blobDataSet = new BlobDataSet("blobDataSet", BlobDataSetArgs.builder()
.accountName("Account1")
.containerName("C1")
.dataSetName("Dataset1")
.filePath("file21")
.kind("Blob")
.resourceGroup("SampleResourceGroup")
.resourceGroupName("SampleResourceGroup")
.shareName("Share1")
.storageAccountName("storage2")
.subscriptionId("433a8dfd-e5d5-4e77-ad86-90acdc75eb1a")
.build());
}
}
resources:
blobDataSet:
type: azure-native:datashare:BlobDataSet
properties:
accountName: Account1
containerName: C1
dataSetName: Dataset1
filePath: file21
kind: Blob
resourceGroup: SampleResourceGroup
resourceGroupName: SampleResourceGroup
shareName: Share1
storageAccountName: storage2
subscriptionId: 433a8dfd-e5d5-4e77-ad86-90acdc75eb1a
The dataset points to a specific file within a storage account. The storageAccountName, resourceGroup, and subscriptionId identify the storage account location. The containerName and filePath specify which file consumers will access. The kind property must be set to “Blob” to indicate this is a blob file dataset. The dataset is added to the share specified by shareName within the Data Share account specified by accountName.
Beyond these examples
This snippet focuses on blob file dataset configuration. It’s intentionally minimal rather than a complete data sharing solution.
The example references pre-existing infrastructure such as Data Share accounts and shares, Azure Storage accounts and containers, and resource groups and subscriptions. It focuses on configuring the dataset rather than provisioning the surrounding infrastructure.
To keep things focused, common dataset patterns are omitted, including:
- Dataset naming and identification (dataSetName)
- Multiple file or container-level sharing
- Access permissions and role assignments
- Snapshot schedules and synchronization
These omissions are intentional: the goal is to illustrate how the blob dataset is wired, not provide drop-in data sharing modules. See the BlobDataSet resource reference for all available configuration options.
Let's configure Azure Blob Data Sets
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration & Required Properties
containerName, filePath, kind (set to “Blob”), resourceGroup, storageAccountName, and subscriptionId to specify the source blob storage location.kind property identifies the dataset type and must be set to “Blob” for this resource, as it represents an Azure storage blob data set.resourceGroup specifies the resource group of the source storage account, while resourceGroupName identifies the resource group containing the Data Share account itself.Immutability & Updates
accountName, dataSetName, resourceGroupName, and shareName. Changing any of these will force resource replacement.pulumi import azure-native:datashare:BlobDataSet <name> /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataShare/accounts/{accountName}/shares/{shareName}/dataSets/{dataSetName}