The azure-native:storage:FileShare resource, part of the Pulumi Azure Native provider, defines an Azure Files share within a storage account: its protocol, access tier, and performance characteristics. This guide focuses on three capabilities: protocol selection (SMB vs NFS), access tier cost optimization, and provisioned performance configuration.
File shares are created within existing storage accounts and resource groups. Protocol and performance options depend on the storage account type (General Purpose v2, FileStorage, Files Provisioned v2). The examples are intentionally small. Combine them with your own storage accounts and access policies.
Create a basic SMB file share
Most deployments begin with a standard SMB share that provides network file storage for applications and users.
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 Azure resource group, and shareName sets the share identifier. Without additional properties, the share uses SMB protocol with default settings: TransactionOptimized tier and standard performance.
Enable NFS protocol for Linux workloads
Linux applications and containers often require NFS-based file shares for compatibility with POSIX file system semantics.
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. NFS shares require premium FileStorage accounts and support Linux-native mount commands. This configuration extends basic share creation by specifying the protocol at creation time (the property is immutable after creation).
Optimize costs with access tier selection
File shares with infrequent access patterns can reduce storage costs by selecting a cooler access tier.
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 selects Hot tier for frequently accessed data. General Purpose v2 accounts support TransactionOptimized (default), Hot, and Cool tiers; FileStorage accounts support Premium tier. The tier affects per-GB storage costs and transaction pricing, allowing you to optimize for your access patterns.
Provision performance with IOPS and bandwidth
High-performance workloads require guaranteed IOPS and throughput that scale independently of storage capacity.
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 5000 IOPS and 200 MiB/s throughput. The shareQuota sets storage capacity in GiB. Files Provisioned v2 accounts allow you to tune performance independently of capacity, unlike standard shares where performance scales with size. This configuration demonstrates advanced performance tuning beyond basic shares.
Beyond these examples
These snippets focus on specific file share features: protocol selection (SMB and NFS), access tier optimization, and provisioned performance tuning. They’re intentionally minimal rather than full storage solutions.
The examples reference pre-existing infrastructure such as storage accounts (standard or premium, depending on protocol) and resource groups. They focus on configuring the share rather than provisioning the storage account infrastructure.
To keep things focused, common file share patterns are omitted, including:
- Quota limits and capacity planning (shareQuota)
- Metadata tagging for organization
- NFS root squash security (rootSquash)
- Stored access policies (signedIdentifiers)
- Paid bursting for temporary performance spikes
These omissions are intentional: the goal is to illustrate how each file share feature is wired, not provide drop-in storage modules. See the Azure Files 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. Changing any of these requires recreating the share.enabledProtocols can only be specified when creating a share and cannot be changed afterward.Protocols & Access
enabledProtocols to NFS when creating the share. This property is immutable and must be configured at creation time.TransactionOptimized (default), Hot, or Cool. FileStorage accounts can choose Premium.rootSquash is a property for NFS shares only that controls root access permissions. The default is NoRootSquash.Performance & Provisioning
provisionedBandwidthMibps and provisionedIops for guaranteed performance. Standard shares don’t support these properties.provisionedBandwidthMibps, provisionedIops, and shareQuota on a Files Provisioned v2 storage account. Refer to the GetFileServiceUsage API for minimum and maximum allowed values.fileSharePaidBursting with paidBurstingEnabled: true, paidBurstingMaxBandwidthMibps, and paidBurstingMaxIops.Quotas & Limits
nextAllowedProvisionedIopsDowngradeTime, nextAllowedProvisionedBandwidthDowngradeTime, and nextAllowedQuotaDowngradeTime output properties before attempting downgrades.