你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Bicep资源定义
可以使用目标操作部署 storageAccounts/fileServices/share 资源类型:
- 资源组 - 参见 资源组部署命令
有关每个 API 版本中已更改属性的列表,请参阅 更改日志。
用法示例
Bicep示例
在 Azure 存储中部署文件共享的基本示例。
param resourceName string = 'acctest0001'
param location string = 'westeurope'
resource fileService 'Microsoft.Storage/storageAccounts/fileServices@2022-09-01' existing = {
name: 'default'
parent: storageAccount
}
resource storageAccount 'Microsoft.Storage/storageAccounts@2021-09-01' = {
name: resourceName
location: location
sku: {
name: 'Standard_LRS'
}
properties: {}
}
resource share 'Microsoft.Storage/storageAccounts/fileServices/shares@2022-09-01' = {
name: resourceName
parent: fileService
properties: {
accessTier: 'Cool'
}
}
Azure 验证模块
以下 Azure 验证模块可用于部署该资源类型。
| 模块 | 说明 |
|---|---|
| 存储帐户 - 文件共享 | 存储帐户的 AVM 子模块 - 文件共享 |
Azure 快速入门示例
以下Azure快速启动模板包含部署该资源类型的Bicep示例。
| Bicep 文件 | 说明 |
|---|---|
| Azure Cloud Shell - VNet 存储 | 此模板将 Azure Cloud Shell 存储部署到 Azure 虚拟网络。 |
| 使用文件共享创建存储帐户 | 此模板创建 Azure 存储帐户和文件共享。 |
| 创建具有多个文件共享的存储帐户 | 创建一个 Azure 存储帐户和多个文件共享。 |
| 该模板允许您创建 Azure 虚拟桌面 资源,如主机池、应用组、工作区、FSLogix 存储账户、文件共享、文件共享恢复服务保险库、备份测试会话主机及其扩展,使用 Microsoft Entra ID 加入 PR Active Directory 域加入。 | |
| 创建 Function App 和专用终结点保护的存储 | 使用此模板,可以部署通过专用终结点与 Azure 存储通信的 Azure Function App。 |
| 受 Azure Frontdoor 保护的 |
此模板允许部署受 Azure Frontdoor 高级版保护并发布的 Azure 高级函数。 Azure Frontdoor 和 Azure Functions 之间的连接受 Azure 专用链接的保护。 |
| 专用函数应用和专用终结点保护的存储 | 此模板在具有专用终结点的 Premium 计划中预配函数应用,并通过专用终结点与 Azure 存储通信。 |
资源格式
若要创建 Microsoft.Storage/storageAccounts/fileServices/shares 资源,请将以下 Bicep 添加到模板。
resource symbolicname 'Microsoft.Storage/storageAccounts/fileServices/shares@2026-04-01' = {
parent: resourceSymbolicName
name: 'string'
properties: {
accessTier: 'string'
enabledProtocols: 'string'
fileSharePaidBursting: {
paidBurstingEnabled: bool
paidBurstingMaxBandwidthMibps: int
paidBurstingMaxIops: int
}
metadata: {
{customized property}: 'string'
}
provisionedBandwidthMibps: int
provisionedIops: int
rootSquash: 'string'
shareQuota: int
signedIdentifiers: [
{
accessPolicy: {
expiryTime: 'string'
permission: 'string'
startTime: 'string'
}
id: 'string'
}
]
}
}
属性值
Microsoft.Storage/storageAccounts/fileServices/shares
| Name | 说明 | 价值 |
|---|---|---|
| name | 资源名称 | string Constraints: 最小长度 = 3 最大长度 = 63 (必需) |
| 父级 | 在 Bicep 中,你可以指定子资源的父资源。 仅当子资源在父资源外部声明时,才需要添加此属性。 更多信息请参见Child 资源 outside parent resource。 |
类型资源的符号名称:storageAccounts/fileServices |
| 属性 | 文件共享的属性。 | FileShareProperties |
访问策略
| Name | 说明 | 价值 |
|---|---|---|
| expiryTime | 访问策略的到期时间 | 字符串 |
| 权限 | 缩写权限的列表。 | 字符串 |
| startTime | 访问策略的开始时间 | 字符串 |
FileShareProperties
| Name | 说明 | 价值 |
|---|---|---|
| accessTier | 特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized(默认)、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。 | “Cool” 'Hot' 'Premium' “TransactionOptimized” |
| enabledProtocols 协议 | 用于文件共享的身份验证协议。 只能在创建共享时指定。 | “NFS” “SMB” |
| fileSharePaidBursting 文件 | 文件共享付费突发属性。 | FileSharePropertiesFileSharePaidBursting |
| 元数据 | 要作为元数据与共享关联的名称/值对。 | FileShareProperties元数据 |
| 预置带宽Mibps | 共享的预配带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 有关预配带宽的最小和允许的最大值,请参阅 GetFileServiceUsage API 响应。 | int |
| 预置 Iops | 共享的预配 IOPS。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 请参阅 GetFileServiceUsage API 响应,了解预配的 IOPS 的最小和允许的最大值。 | int |
| 根南瓜 | 该属性仅适用于 NFS 共享。 默认值为 NoRootSquash。 | “AllSquash” “NoRootSquash” “RootSquash” |
| shareQuota | 共享的预配大小(以 gibibytes 为单位)。 必须大于 0,并且小于或等于 5TB (5120)。 对于大型文件共享,最大大小为 102400。 有关在文件预配 v2 帐户类型下创建的文件共享,请参阅 GetFileServiceUsage API 响应,了解允许的最小和最大预配存储大小。 | int |
| signed标识符 | 共享上指定的存储访问策略列表。 | 签名标识符 |
FileSharePropertiesFileSharePaidBursting
| Name | 说明 | 价值 |
|---|---|---|
| paidBursting已启用 | 指示是否为共享启用了付费突发。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 | 布尔 |
| 付费BurstingMaxBandwidthMibps | 共享的最大付费突发带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 10340,这是共享允许的最大带宽。 | int |
| 付费BurstingMaxIops | 共享的最大付费突发 IOPS。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 102400,这是共享允许的最大 IOPS。 | int |
FileShareProperties元数据
| Name | 说明 | 价值 |
|---|
签名标识符
| Name | 说明 | 价值 |
|---|---|---|
| 访问策略 | 访问策略 | 访问策略 |
| id | 存储访问策略的唯一标识符。 | 字符串 |
ARM 模板资源定义
可以使用目标操作部署 storageAccounts/fileServices/share 资源类型:
用法示例
Azure 快速入门模板
以下Azure快速启动模板部署了这种资源类型。
| 模板 | 说明 |
|---|---|
|
Azure Cloud Shell - VNet 存储 |
此模板将 Azure Cloud Shell 存储部署到 Azure 虚拟网络。 |
|
通过专用终结点连接到 Azure 文件共享 |
此示例演示如何使用配置虚拟网络和专用 DNS 区域通过专用终结点访问 Azure 文件共享。 |
|
使用文件共享创建存储帐户 |
此模板创建 Azure 存储帐户和文件共享。 |
|
创建具有多个文件共享的存储帐户 |
创建一个 Azure 存储帐户和多个文件共享。 |
| 该模板允许您创建 Azure 虚拟桌面 资源,如主机池、应用组、工作区、FSLogix 存储账户、文件共享、文件共享恢复服务保险库、备份测试会话主机及其扩展,使用 Microsoft Entra ID 加入 PR Active Directory 域加入。 | |
|
创建 Function App 和专用终结点保护的存储 |
使用此模板,可以部署通过专用终结点与 Azure 存储通信的 Azure Function App。 |
|
使用 VM 规模集、Azure 文件和 Mysql 部署 Drupal |
在负载均衡器/NAT 后面部署 VM 规模集,& 运行 Drupal(Apache/PHP)的每个 VM。 所有节点共享创建的 Azure 文件共享存储和 MySQL 数据库 |
| 受 Azure Frontdoor 保护的 |
此模板允许部署受 Azure Frontdoor 高级版保护并发布的 Azure 高级函数。 Azure Frontdoor 和 Azure Functions 之间的连接受 Azure 专用链接的保护。 |
|
专用函数应用和专用终结点保护的存储 |
此模板在具有专用终结点的 Premium 计划中预配函数应用,并通过专用终结点与 Azure 存储通信。 |
资源格式
若要创建 Microsoft.Storage/storageAccounts/fileServices/shares 资源,请将以下 JSON 添加到模板。
{
"type": "Microsoft.Storage/storageAccounts/fileServices/shares",
"apiVersion": "2026-04-01",
"name": "string",
"properties": {
"accessTier": "string",
"enabledProtocols": "string",
"fileSharePaidBursting": {
"paidBurstingEnabled": "bool",
"paidBurstingMaxBandwidthMibps": "int",
"paidBurstingMaxIops": "int"
},
"metadata": {
"{customized property}": "string"
},
"provisionedBandwidthMibps": "int",
"provisionedIops": "int",
"rootSquash": "string",
"shareQuota": "int",
"signedIdentifiers": [
{
"accessPolicy": {
"expiryTime": "string",
"permission": "string",
"startTime": "string"
},
"id": "string"
}
]
}
}
属性值
Microsoft.Storage/storageAccounts/fileServices/shares
| Name | 说明 | 价值 |
|---|---|---|
| apiVersion | API 版本 | '2026-04-01' |
| name | 资源名称 | string Constraints: 最小长度 = 3 最大长度 = 63 (必需) |
| 属性 | 文件共享的属性。 | FileShareProperties |
| 类型 | 资源类型 | “Microsoft.Storage/storageAccounts/fileServices/shares” |
访问策略
| Name | 说明 | 价值 |
|---|---|---|
| expiryTime | 访问策略的到期时间 | 字符串 |
| 权限 | 缩写权限的列表。 | 字符串 |
| startTime | 访问策略的开始时间 | 字符串 |
FileShareProperties
| Name | 说明 | 价值 |
|---|---|---|
| accessTier | 特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized(默认)、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。 | “Cool” 'Hot' 'Premium' “TransactionOptimized” |
| enabledProtocols 协议 | 用于文件共享的身份验证协议。 只能在创建共享时指定。 | “NFS” “SMB” |
| fileSharePaidBursting 文件 | 文件共享付费突发属性。 | FileSharePropertiesFileSharePaidBursting |
| 元数据 | 要作为元数据与共享关联的名称/值对。 | FileShareProperties元数据 |
| 预置带宽Mibps | 共享的预配带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 有关预配带宽的最小和允许的最大值,请参阅 GetFileServiceUsage API 响应。 | int |
| 预置 Iops | 共享的预配 IOPS。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 请参阅 GetFileServiceUsage API 响应,了解预配的 IOPS 的最小和允许的最大值。 | int |
| 根南瓜 | 该属性仅适用于 NFS 共享。 默认值为 NoRootSquash。 | “AllSquash” “NoRootSquash” “RootSquash” |
| shareQuota | 共享的预配大小(以 gibibytes 为单位)。 必须大于 0,并且小于或等于 5TB (5120)。 对于大型文件共享,最大大小为 102400。 有关在文件预配 v2 帐户类型下创建的文件共享,请参阅 GetFileServiceUsage API 响应,了解允许的最小和最大预配存储大小。 | int |
| signed标识符 | 共享上指定的存储访问策略列表。 | 签名标识符 |
FileSharePropertiesFileSharePaidBursting
| Name | 说明 | 价值 |
|---|---|---|
| paidBursting已启用 | 指示是否为共享启用了付费突发。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 | 布尔 |
| 付费BurstingMaxBandwidthMibps | 共享的最大付费突发带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 10340,这是共享允许的最大带宽。 | int |
| 付费BurstingMaxIops | 共享的最大付费突发 IOPS。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 102400,这是共享允许的最大 IOPS。 | int |
FileShareProperties元数据
| Name | 说明 | 价值 |
|---|
签名标识符
| Name | 说明 | 价值 |
|---|---|---|
| 访问策略 | 访问策略 | 访问策略 |
| id | 存储访问策略的唯一标识符。 | 字符串 |
Terraform (AzAPI 提供程序)资源定义
可以使用目标操作部署 storageAccounts/fileServices/share 资源类型:
- 资源组 关于每个API版本中变更属性的列表,请参见 更改日志。
用法示例
Terraform 示例
在 Azure 存储中部署文件共享的基本示例。
terraform {
required_providers {
azapi = {
source = "Azure/azapi"
}
}
}
provider "azapi" {
skip_provider_registration = false
}
variable "resource_name" {
type = string
default = "acctest0001"
}
variable "location" {
type = string
default = "westeurope"
}
resource "azapi_resource" "resourceGroup" {
type = "Microsoft.Resources/resourceGroups@2020-06-01"
name = var.resource_name
location = var.location
}
resource "azapi_resource" "storageAccount" {
type = "Microsoft.Storage/storageAccounts@2021-09-01"
parent_id = azapi_resource.resourceGroup.id
name = var.resource_name
location = var.location
body = {
properties = {
}
sku = {
name = "Standard_LRS"
}
}
schema_validation_enabled = false
response_export_values = ["*"]
}
data "azapi_resource_action" "listKeys" {
type = "Microsoft.Storage/storageAccounts@2022-09-01"
resource_id = azapi_resource.storageAccount.id
action = "listKeys"
response_export_values = ["*"]
}
data "azapi_resource" "fileService" {
type = "Microsoft.Storage/storageAccounts/fileServices@2022-09-01"
parent_id = azapi_resource.storageAccount.id
name = "default"
}
resource "azapi_resource" "share" {
type = "Microsoft.Storage/storageAccounts/fileServices/shares@2022-09-01"
parent_id = data.azapi_resource.fileService.id
name = var.resource_name
body = {
properties = {
accessTier = "Cool"
}
}
response_export_values = ["*"]
}
资源格式
若要创建 Microsoft.Storage/storageAccounts/fileServices/shares 资源,请将以下 Terraform 添加到模板。
resource "azapi_resource" "symbolicname" {
type = "Microsoft.Storage/storageAccounts/fileServices/shares@2026-04-01"
name = "string"
parent_id = "string"
body = {
properties = {
accessTier = "string"
enabledProtocols = "string"
fileSharePaidBursting = {
paidBurstingEnabled = bool
paidBurstingMaxBandwidthMibps = int
paidBurstingMaxIops = int
}
metadata = {
{customized property} = "string"
}
provisionedBandwidthMibps = int
provisionedIops = int
rootSquash = "string"
shareQuota = int
signedIdentifiers = [
{
accessPolicy = {
expiryTime = "string"
permission = "string"
startTime = "string"
}
id = "string"
}
]
}
}
}
属性值
Microsoft.Storage/storageAccounts/fileServices/shares
| Name | 说明 | 价值 |
|---|---|---|
| name | 资源名称 | string Constraints: 最小长度 = 3 最大长度 = 63 (必需) |
| parent_id | 此资源的父资源的 ID。 | 类型资源的 ID:storageAccounts/fileServices |
| 属性 | 文件共享的属性。 | FileShareProperties |
| 类型 | 资源类型 | “Microsoft。Storage/storageAccounts/fileServices/shares@2026-04-01” |
访问策略
| Name | 说明 | 价值 |
|---|---|---|
| expiryTime | 访问策略的到期时间 | 字符串 |
| 权限 | 缩写权限的列表。 | 字符串 |
| startTime | 访问策略的开始时间 | 字符串 |
FileShareProperties
| Name | 说明 | 价值 |
|---|---|---|
| accessTier | 特定共享的访问层。 GpV2 帐户可以在 TransactionOptimized(默认)、热和冷之间进行选择。 FileStorage 帐户可以选择“高级”。 | “Cool” 'Hot' 'Premium' “TransactionOptimized” |
| enabledProtocols 协议 | 用于文件共享的身份验证协议。 只能在创建共享时指定。 | “NFS” “SMB” |
| fileSharePaidBursting 文件 | 文件共享付费突发属性。 | FileSharePropertiesFileSharePaidBursting |
| 元数据 | 要作为元数据与共享关联的名称/值对。 | FileShareProperties元数据 |
| 预置带宽Mibps | 共享的预配带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 有关预配带宽的最小和允许的最大值,请参阅 GetFileServiceUsage API 响应。 | int |
| 预置 Iops | 共享的预配 IOPS。 此属性仅适用于在文件预配 v2 帐户类型下创建的文件共享。 请参阅 GetFileServiceUsage API 响应,了解预配的 IOPS 的最小和允许的最大值。 | int |
| 根南瓜 | 该属性仅适用于 NFS 共享。 默认值为 NoRootSquash。 | “AllSquash” “NoRootSquash” “RootSquash” |
| shareQuota | 共享的预配大小(以 gibibytes 为单位)。 必须大于 0,并且小于或等于 5TB (5120)。 对于大型文件共享,最大大小为 102400。 有关在文件预配 v2 帐户类型下创建的文件共享,请参阅 GetFileServiceUsage API 响应,了解允许的最小和最大预配存储大小。 | int |
| signed标识符 | 共享上指定的存储访问策略列表。 | 签名标识符 |
FileSharePropertiesFileSharePaidBursting
| Name | 说明 | 价值 |
|---|---|---|
| paidBursting已启用 | 指示是否为共享启用了付费突发。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 | 布尔 |
| 付费BurstingMaxBandwidthMibps | 共享的最大付费突发带宽(以每秒兆字节为单位)。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 10340,这是共享允许的最大带宽。 | int |
| 付费BurstingMaxIops | 共享的最大付费突发 IOPS。 此属性仅适用于在文件预配 v1 SSD 帐户类型下创建的文件共享。 允许的最大值为 102400,这是共享允许的最大 IOPS。 | int |
FileShareProperties元数据
| Name | 说明 | 价值 |
|---|
签名标识符
| Name | 说明 | 价值 |
|---|---|---|
| 访问策略 | 访问策略 | 访问策略 |
| id | 存储访问策略的唯一标识符。 | 字符串 |