The azure-native:storage:FileShare resource, part of the Pulumi Azure Native provider, defines an Azure Files share within a storage account: its protocol, performance characteristics, and access tier. This guide focuses on four capabilities: protocol selection (SMB and NFS), access tier optimization, performance provisioning with IOPS and bandwidth, and paid bursting for variable workloads.
File shares belong to storage accounts and resource groups that must exist before share creation. The examples are intentionally small. Combine them with your own storage accounts, networking, and access control.
Create a basic SMB file share
Most deployments begin with a basic SMB share that provides network file storage with default settings.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const fileShare = new azure_native.storage.FileShare("fileShare", {
accountName: "sto328",
resourceGroupName: "res3376",
shareName: "share6185",
});
import pulumi
import pulumi_azure_native as azure_native
file_share = azure_native.storage.FileShare("fileShare",
account_name="sto328",
resource_group_name="res3376",
share_name="share6185")
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
AccountName: pulumi.String("sto328"),
ResourceGroupName: pulumi.String("res3376"),
ShareName: pulumi.String("share6185"),
})
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 fileShare = new AzureNative.Storage.FileShare("fileShare", new()
{
AccountName = "sto328",
ResourceGroupName = "res3376",
ShareName = "share6185",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.FileShare;
import com.pulumi.azurenative.storage.FileShareArgs;
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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
.accountName("sto328")
.resourceGroupName("res3376")
.shareName("share6185")
.build());
}
}
resources:
fileShare:
type: azure-native:storage:FileShare
properties:
accountName: sto328
resourceGroupName: res3376
shareName: share6185
The accountName references an existing storage account, resourceGroupName specifies the resource group, and shareName sets the share identifier. Without additional properties, the share uses SMB protocol (default), transaction-optimized access tier, and standard performance characteristics.
Enable NFS protocol for Linux workloads
Linux applications and containers often require NFS protocol support for file sharing.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const fileShare = new azure_native.storage.FileShare("fileShare", {
accountName: "sto666",
enabledProtocols: azure_native.storage.EnabledProtocols.NFS,
resourceGroupName: "res346",
shareName: "share1235",
});
import pulumi
import pulumi_azure_native as azure_native
file_share = azure_native.storage.FileShare("fileShare",
account_name="sto666",
enabled_protocols=azure_native.storage.EnabledProtocols.NFS,
resource_group_name="res346",
share_name="share1235")
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
AccountName: pulumi.String("sto666"),
EnabledProtocols: pulumi.String(storage.EnabledProtocolsNFS),
ResourceGroupName: pulumi.String("res346"),
ShareName: pulumi.String("share1235"),
})
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 fileShare = new AzureNative.Storage.FileShare("fileShare", new()
{
AccountName = "sto666",
EnabledProtocols = AzureNative.Storage.EnabledProtocols.NFS,
ResourceGroupName = "res346",
ShareName = "share1235",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.FileShare;
import com.pulumi.azurenative.storage.FileShareArgs;
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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
.accountName("sto666")
.enabledProtocols("NFS")
.resourceGroupName("res346")
.shareName("share1235")
.build());
}
}
resources:
fileShare:
type: azure-native:storage:FileShare
properties:
accountName: sto666
enabledProtocols: NFS
resourceGroupName: res346
shareName: share1235
The enabledProtocols property selects NFS 4.1 instead of the default SMB protocol. This property is immutable after creation, so protocol choice must be made at provisioning time. NFS shares require premium storage accounts and support Linux-native file access patterns.
Optimize costs with access tier selection
File shares in general-purpose v2 accounts can use different access tiers to balance performance and cost.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const fileShare = new azure_native.storage.FileShare("fileShare", {
accessTier: azure_native.storage.ShareAccessTier.Hot,
accountName: "sto666",
resourceGroupName: "res346",
shareName: "share1235",
});
import pulumi
import pulumi_azure_native as azure_native
file_share = azure_native.storage.FileShare("fileShare",
access_tier=azure_native.storage.ShareAccessTier.HOT,
account_name="sto666",
resource_group_name="res346",
share_name="share1235")
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
AccessTier: pulumi.String(storage.ShareAccessTierHot),
AccountName: pulumi.String("sto666"),
ResourceGroupName: pulumi.String("res346"),
ShareName: pulumi.String("share1235"),
})
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 fileShare = new AzureNative.Storage.FileShare("fileShare", new()
{
AccessTier = AzureNative.Storage.ShareAccessTier.Hot,
AccountName = "sto666",
ResourceGroupName = "res346",
ShareName = "share1235",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.FileShare;
import com.pulumi.azurenative.storage.FileShareArgs;
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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
.accessTier("Hot")
.accountName("sto666")
.resourceGroupName("res346")
.shareName("share1235")
.build());
}
}
resources:
fileShare:
type: azure-native:storage:FileShare
properties:
accessTier: Hot
accountName: sto666
resourceGroupName: res346
shareName: share1235
The accessTier property sets the storage tier to Hot, which optimizes for frequently accessed data. General-purpose v2 accounts support TransactionOptimized (default), Hot, and Cool tiers. Premium storage accounts use a single Premium tier. Access tier changes affect storage costs and transaction pricing.
Provision performance with IOPS and bandwidth
Applications with predictable performance requirements can provision specific IOPS and bandwidth levels independently of storage size.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const fileShare = new azure_native.storage.FileShare("fileShare", {
accountName: "sto666",
provisionedBandwidthMibps: 200,
provisionedIops: 5000,
resourceGroupName: "res346",
shareName: "share1235",
shareQuota: 100,
});
import pulumi
import pulumi_azure_native as azure_native
file_share = azure_native.storage.FileShare("fileShare",
account_name="sto666",
provisioned_bandwidth_mibps=200,
provisioned_iops=5000,
resource_group_name="res346",
share_name="share1235",
share_quota=100)
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
AccountName: pulumi.String("sto666"),
ProvisionedBandwidthMibps: pulumi.Int(200),
ProvisionedIops: pulumi.Int(5000),
ResourceGroupName: pulumi.String("res346"),
ShareName: pulumi.String("share1235"),
ShareQuota: pulumi.Int(100),
})
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 fileShare = new AzureNative.Storage.FileShare("fileShare", new()
{
AccountName = "sto666",
ProvisionedBandwidthMibps = 200,
ProvisionedIops = 5000,
ResourceGroupName = "res346",
ShareName = "share1235",
ShareQuota = 100,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.FileShare;
import com.pulumi.azurenative.storage.FileShareArgs;
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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
.accountName("sto666")
.provisionedBandwidthMibps(200)
.provisionedIops(5000)
.resourceGroupName("res346")
.shareName("share1235")
.shareQuota(100)
.build());
}
}
resources:
fileShare:
type: azure-native:storage:FileShare
properties:
accountName: sto666
provisionedBandwidthMibps: 200
provisionedIops: 5000
resourceGroupName: res346
shareName: share1235
shareQuota: 100
The provisionedIops and provisionedBandwidthMibps properties guarantee performance levels for the share. This configuration requires a Files Provisioned v2 account type, which decouples performance from storage size. The shareQuota sets storage capacity in gibibytes. Provisioned values have minimum and maximum limits returned by the GetFileServiceUsage API.
Handle traffic spikes with paid bursting
Workloads with occasional traffic spikes can use paid bursting to temporarily exceed baseline IOPS and bandwidth.
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";
const fileShare = new azure_native.storage.FileShare("fileShare", {
accountName: "sto666",
fileSharePaidBursting: {
paidBurstingEnabled: true,
paidBurstingMaxBandwidthMibps: 10340,
paidBurstingMaxIops: 102400,
},
resourceGroupName: "res346",
shareName: "share1235",
});
import pulumi
import pulumi_azure_native as azure_native
file_share = azure_native.storage.FileShare("fileShare",
account_name="sto666",
file_share_paid_bursting={
"paid_bursting_enabled": True,
"paid_bursting_max_bandwidth_mibps": 10340,
"paid_bursting_max_iops": 102400,
},
resource_group_name="res346",
share_name="share1235")
package main
import (
storage "github.com/pulumi/pulumi-azure-native-sdk/storage/v3"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := storage.NewFileShare(ctx, "fileShare", &storage.FileShareArgs{
AccountName: pulumi.String("sto666"),
FileSharePaidBursting: &storage.FileSharePropertiesFileSharePaidBurstingArgs{
PaidBurstingEnabled: pulumi.Bool(true),
PaidBurstingMaxBandwidthMibps: pulumi.Int(10340),
PaidBurstingMaxIops: pulumi.Int(102400),
},
ResourceGroupName: pulumi.String("res346"),
ShareName: pulumi.String("share1235"),
})
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 fileShare = new AzureNative.Storage.FileShare("fileShare", new()
{
AccountName = "sto666",
FileSharePaidBursting = new AzureNative.Storage.Inputs.FileSharePropertiesFileSharePaidBurstingArgs
{
PaidBurstingEnabled = true,
PaidBurstingMaxBandwidthMibps = 10340,
PaidBurstingMaxIops = 102400,
},
ResourceGroupName = "res346",
ShareName = "share1235",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.storage.FileShare;
import com.pulumi.azurenative.storage.FileShareArgs;
import com.pulumi.azurenative.storage.inputs.FileSharePropertiesFileSharePaidBurstingArgs;
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 fileShare = new FileShare("fileShare", FileShareArgs.builder()
.accountName("sto666")
.fileSharePaidBursting(FileSharePropertiesFileSharePaidBurstingArgs.builder()
.paidBurstingEnabled(true)
.paidBurstingMaxBandwidthMibps(10340)
.paidBurstingMaxIops(102400)
.build())
.resourceGroupName("res346")
.shareName("share1235")
.build());
}
}
resources:
fileShare:
type: azure-native:storage:FileShare
properties:
accountName: sto666
fileSharePaidBursting:
paidBurstingEnabled: true
paidBurstingMaxBandwidthMibps: 10340
paidBurstingMaxIops: 102400
resourceGroupName: res346
shareName: share1235
The fileSharePaidBursting block enables burst capacity beyond provisioned levels. When paidBurstingEnabled is true, the share can temporarily reach paidBurstingMaxIops and paidBurstingMaxBandwidthMibps during traffic spikes. This provides an alternative to constant high provisioning for workloads with variable demand patterns.
Beyond these examples
These snippets focus on specific file share features: protocol selection (SMB and NFS), access tier and performance provisioning, and paid bursting for traffic spikes. They’re intentionally minimal rather than full storage solutions.
The examples reference pre-existing infrastructure such as storage accounts (general-purpose v2 or premium) and resource groups. They focus on configuring the share rather than provisioning the storage account itself.
To keep things focused, common file share patterns are omitted, including:
- Quota limits and size constraints (shareQuota)
- Metadata tags for organization
- NFS root squash settings (rootSquash)
- Stored access policies (signedIdentifiers)
These omissions are intentional: the goal is to illustrate how each file share feature is wired, not provide drop-in storage modules. See the FileShare resource reference for all available configuration options.
Let's create Azure File Shares
Get started with Pulumi Cloud, then follow our quick setup guide to deploy this infrastructure.
Try Pulumi Cloud for FREEFrequently Asked Questions
Configuration & Immutability
accountName, resourceGroupName, shareName, and enabledProtocols properties are immutable and require recreating the file share if you need to change them.enabledProtocols is immutable and can only be specified when creating the share. To use a different protocol, you must create a new file share.Access Tiers & Storage Types
NFS Shares
enabledProtocols to NFS when creating the share. This property is immutable and can only be specified during creation.rootSquash is an NFS-only property that controls root access permissions. The default value is NoRootSquash.Provisioned Performance
provisionedBandwidthMibps and provisionedIops when creating the share. Refer to the GetFileServiceUsage API response for minimum and maximum allowed values.fileSharePaidBursting.paidBurstingEnabled to true and configuring paidBurstingMaxBandwidthMibps and paidBurstingMaxIops.nextAllowedProvisionedBandwidthDowngradeTime, nextAllowedProvisionedIopsDowngradeTime, and nextAllowedQuotaDowngradeTime output properties to see when downgrades are allowed.