共用方式為


az storage account network-rule

管理網路規則。

命令

名稱 Description 類型 狀態
az storage account network-rule add

新增網路規則。

核心 GA
az storage account network-rule list

列出網路規則。

核心 GA
az storage account network-rule remove

移除網路規則。

核心 GA

az storage account network-rule add

新增網路規則。

您可以為 IPv4 位址、位址範圍(CIDR 格式)或虛擬網路子網建立規則。

az storage account network-rule add --account-name
                                    [--action]
                                    [--ip-address]
                                    [--resource-group]
                                    [--resource-id]
                                    [--subnet]
                                    [--tenant-id]
                                    [--vnet-name]

範例

建立規則以允許特定位址範圍。

az storage account network-rule add -g myRg --account-name mystorageaccount --ip-address 23.45.1.0/24

建立規則以允許子網的存取。

az storage account network-rule add -g myRg --account-name mystorageaccount --vnet-name myvnet --subnet mysubnet

建立規則以允許另一個資源群組中的子網存取。

az storage account network-rule add -g myRg --account-name mystorageaccount  --subnet $subnetId

必要參數

--account-name -n

儲存體帳戶名稱。

選擇性參數

--action

虛擬網路規則的動作。 可能的值為 Allow。

預設值: Allow
--ip-address

IPv4 位址或 CIDR 範圍。 可以提供清單:--ip-address ip1 [ip2]...

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--resource-id

要加入網路規則的資源標識碼。

--subnet

子網的名稱或標識碼。 如果提供名稱, --vnet-name 則必須提供 。

--tenant-id

要加入網路規則的租用戶標識碼。

--vnet-name

虛擬網路的名稱。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az storage account network-rule list

列出網路規則。

az storage account network-rule list --account-name
                                     [--resource-group]

範例

列出網路規則。 ( 自動產生 )

az storage account network-rule list --account-name MyAccount --resource-group MyResourceGroup

必要參數

--account-name -n

儲存體帳戶名稱。

選擇性參數

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。

az storage account network-rule remove

移除網路規則。

az storage account network-rule remove --account-name
                                       [--ip-address]
                                       [--resource-group]
                                       [--resource-id]
                                       [--subnet]
                                       [--tenant-id]
                                       [--vnet-name]

範例

移除網路規則。 ( 自動產生 )

az storage account network-rule remove --account-name MyAccount --resource-group MyResourceGroup --subnet MySubnetID

移除網路規則。 ( 自動產生 )

az storage account network-rule remove --account-name MyAccount --ip-address 23.45.1.0/24 --resource-group MyResourceGroup

必要參數

--account-name -n

儲存體帳戶名稱。

選擇性參數

--ip-address

IPv4 位址或 CIDR 範圍。 可以提供清單:--ip-address ip1 [ip2]...

--resource-group -g

資源組名。 您可以使用 az configure --defaults group=<name>來設定預設群組。

--resource-id

要加入網路規則的資源標識碼。

--subnet

子網的名稱或標識碼。 如果提供名稱, --vnet-name 則必須提供 。

--tenant-id

要加入網路規則的租用戶標識碼。

--vnet-name

虛擬網路的名稱。

全域參數
--debug

提高日誌詳細程度以顯示所有調試日誌。

--help -h

顯示此說明訊息並結束。

--only-show-errors

只顯示錯誤,隱藏警告。

--output -o

輸出格式。

接受的值: json, jsonc, none, table, tsv, yaml, yamlc
預設值: json
--query

JMESPath 查詢字串。 如需詳細資訊和範例,請參閱 http://jmespath.org/

--subscription

訂用帳戶的名稱或標識碼。 您可以使用 az account set -s NAME_OR_ID來設定預設訂用帳戶。

--verbose

增加記錄的詳細程度。 針對完整偵錯記錄使用 --debug。