Configure Azure SQL DW Table Data Set Mappings

The azure-native:datashare:SqlDWTableDataSetMapping resource, part of the Pulumi Azure Native provider, defines how shared table data from Azure Data Share flows into a consumer’s SQL Data Warehouse. This guide focuses on one capability: mapping shared datasets to SQL DW tables.

Data set mappings connect existing share subscriptions to SQL Data Warehouse infrastructure. The example is intentionally small. Combine it with your own Data Share accounts, share subscriptions, and SQL servers.

Map shared data to a SQL Data Warehouse table

When consuming shared datasets through Azure Data Share, you define where incoming table data lands in your SQL Data Warehouse by creating a mapping that specifies the target server, warehouse, schema, and table.

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

const sqlDWTableDataSetMapping = new azure_native.datashare.SqlDWTableDataSetMapping("sqlDWTableDataSetMapping", {
    accountName: "Account1",
    dataSetId: "a08f184b-0567-4b11-ba22-a1199336d226",
    dataSetMappingName: "DatasetMapping1",
    dataWarehouseName: "DataWarehouse1",
    kind: "SqlDWTable",
    resourceGroupName: "SampleResourceGroup",
    schemaName: "dbo",
    shareSubscriptionName: "ShareSubscription1",
    sqlServerResourceId: "/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1",
    tableName: "Table1",
});
import pulumi
import pulumi_azure_native as azure_native

sql_dw_table_data_set_mapping = azure_native.datashare.SqlDWTableDataSetMapping("sqlDWTableDataSetMapping",
    account_name="Account1",
    data_set_id="a08f184b-0567-4b11-ba22-a1199336d226",
    data_set_mapping_name="DatasetMapping1",
    data_warehouse_name="DataWarehouse1",
    kind="SqlDWTable",
    resource_group_name="SampleResourceGroup",
    schema_name="dbo",
    share_subscription_name="ShareSubscription1",
    sql_server_resource_id="/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1",
    table_name="Table1")
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.NewSqlDWTableDataSetMapping(ctx, "sqlDWTableDataSetMapping", &datashare.SqlDWTableDataSetMappingArgs{
			AccountName:           pulumi.String("Account1"),
			DataSetId:             pulumi.String("a08f184b-0567-4b11-ba22-a1199336d226"),
			DataSetMappingName:    pulumi.String("DatasetMapping1"),
			DataWarehouseName:     pulumi.String("DataWarehouse1"),
			Kind:                  pulumi.String("SqlDWTable"),
			ResourceGroupName:     pulumi.String("SampleResourceGroup"),
			SchemaName:            pulumi.String("dbo"),
			ShareSubscriptionName: pulumi.String("ShareSubscription1"),
			SqlServerResourceId:   pulumi.String("/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1"),
			TableName:             pulumi.String("Table1"),
		})
		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 sqlDWTableDataSetMapping = new AzureNative.DataShare.SqlDWTableDataSetMapping("sqlDWTableDataSetMapping", new()
    {
        AccountName = "Account1",
        DataSetId = "a08f184b-0567-4b11-ba22-a1199336d226",
        DataSetMappingName = "DatasetMapping1",
        DataWarehouseName = "DataWarehouse1",
        Kind = "SqlDWTable",
        ResourceGroupName = "SampleResourceGroup",
        SchemaName = "dbo",
        ShareSubscriptionName = "ShareSubscription1",
        SqlServerResourceId = "/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1",
        TableName = "Table1",
    });

});
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.datashare.SqlDWTableDataSetMapping;
import com.pulumi.azurenative.datashare.SqlDWTableDataSetMappingArgs;
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 sqlDWTableDataSetMapping = new SqlDWTableDataSetMapping("sqlDWTableDataSetMapping", SqlDWTableDataSetMappingArgs.builder()
            .accountName("Account1")
            .dataSetId("a08f184b-0567-4b11-ba22-a1199336d226")
            .dataSetMappingName("DatasetMapping1")
            .dataWarehouseName("DataWarehouse1")
            .kind("SqlDWTable")
            .resourceGroupName("SampleResourceGroup")
            .schemaName("dbo")
            .shareSubscriptionName("ShareSubscription1")
            .sqlServerResourceId("/subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1")
            .tableName("Table1")
            .build());

    }
}
resources:
  sqlDWTableDataSetMapping:
    type: azure-native:datashare:SqlDWTableDataSetMapping
    properties:
      accountName: Account1
      dataSetId: a08f184b-0567-4b11-ba22-a1199336d226
      dataSetMappingName: DatasetMapping1
      dataWarehouseName: DataWarehouse1
      kind: SqlDWTable
      resourceGroupName: SampleResourceGroup
      schemaName: dbo
      shareSubscriptionName: ShareSubscription1
      sqlServerResourceId: /subscriptions/433a8dfd-e5d5-4e77-ad86-90acdc75eb1a/resourceGroups/SampleResourceGroup/providers/Microsoft.Sql/servers/Server1
      tableName: Table1

The mapping routes data from the provider’s shared dataset (identified by dataSetId) into your SQL Data Warehouse. The sqlServerResourceId points to your SQL server, dataWarehouseName specifies which warehouse receives the data, and schemaName and tableName define the exact destination table. The kind property must be set to “SqlDWTable” to indicate this is a SQL Data Warehouse table mapping. Azure Data Share uses this configuration to write incoming data during synchronization.

Beyond these examples

This snippet focuses on SQL Data Warehouse table mapping. It’s intentionally minimal rather than a complete data sharing workflow.

The example references pre-existing infrastructure such as Azure Data Share accounts and share subscriptions, SQL servers and data warehouses, and shared 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:

  • Mapping validation and provisioning state handling
  • Alternative destination types (SQL DB, ADLS Gen2)
  • Error handling for failed mappings
  • Mapping updates or schema evolution

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

Let's configure Azure SQL DW Table 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 SQL DW table data set mapping?
You need six required properties: dataSetId, dataWarehouseName, kind (must be “SqlDWTable”), schemaName, sqlServerResourceId, and tableName. Additionally, you must provide the immutable identifiers: accountName, dataSetMappingName, resourceGroupName, and shareSubscriptionName.
What's the default value for the schema name?
The schemaName property defaults to “dbo” if not specified.
What value must the kind property be set to?
The kind property must be set to “SqlDWTable” (this is the expected value for SQL DW table mappings).
Resource Lifecycle
What properties can't be changed after creating the mapping?
Four properties are immutable: accountName, dataSetMappingName, resourceGroupName, and shareSubscriptionName. Changing any of these requires replacing the resource.
Monitoring & Status
How can I check the status of my data set mapping?
The resource provides two output properties for monitoring: dataSetMappingStatus shows the mapping’s operational status, and provisioningState indicates the provisioning status.

Using a different cloud?

Explore database guides for other cloud providers: