az functionapp cors

管理跨原始來源資源分享 (CORS)。

命令

名稱 Description 類型 狀態
az functionapp cors add

新增允許的來源。

核心 GA
az functionapp cors credentials

啟用或停用 access-control-allow-credentials。

核心 GA
az functionapp cors remove

移除允許的來源。

核心 GA
az functionapp cors show

顯示允許的來源。

核心 GA

az functionapp cors add

新增允許的來源。

az functionapp cors add --allowed-origins
                        [--ids]
                        [--name]
                        [--resource-group]
                        [--slot]
                        [--subscription]

範例

新增允許的來源

az functionapp cors add -g {myRG} -n {myAppName} --allowed-origins https://myapps.com

必要參數

--allowed-origins -a

應允許的空間分隔原點進行跨原始來源呼叫(例如:)。 http://example.com:12345 若要允許全部,請使用 「*」 並從清單中移除所有其他來源。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

函式應用程式的名稱。

--resource-group -g

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

--slot -s

位置的名稱。 如果未指定,則預設為生產位置。

--subscription

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

全域參數
--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 functionapp cors credentials

啟用或停用 access-control-allow-credentials。

az functionapp cors credentials --enable {false, true}
                                [--ids]
                                [--name]
                                [--resource-group]
                                [--slot]
                                [--subscription]

範例

啟用 CORS 存取控制-allow-credentials。

az functionapp cors credentials --name MyFunctionApp --resource-group MyResourceGroup --enable true

停用 CORS 存取控制-allow-credentials。

az functionapp cors credentials --name MyFunctionApp --resource-group MyResourceGroup --enable false

必要參數

--enable

啟用/停用 access-control-allow-credentials。

接受的值: false, true

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

函式應用程式的名稱。

--resource-group -g

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

--slot -s

位置的名稱。 如果未指定,則預設為生產位置。

--subscription

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

全域參數
--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 functionapp cors remove

移除允許的來源。

az functionapp cors remove --allowed-origins
                           [--ids]
                           [--name]
                           [--resource-group]
                           [--slot]
                           [--subscription]

範例

移除允許的來源

az functionapp cors remove -g {myRG} -n {myAppName} --allowed-origins https://myapps.com

移除所有允許的來源

az functionapp cors remove -g {myRG} -n {myAppName} --allowed-origins

必要參數

--allowed-origins -a

應允許的空間分隔原點進行跨原始來源呼叫(例如:)。 http://example.com:12345 若要允許全部,請使用 「*」 並從清單中移除所有其他來源。

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

函式應用程式的名稱。

--resource-group -g

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

--slot -s

位置的名稱。 如果未指定,則預設為生產位置。

--subscription

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

全域參數
--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 functionapp cors show

顯示允許的來源。

az functionapp cors show [--ids]
                         [--name]
                         [--resource-group]
                         [--slot]
                         [--subscription]

範例

顯示允許的來源 (自動產生)

az functionapp cors show --name MyFunctionApp --resource-group MyResourceGroup

選擇性參數

--ids

一或多個資源識別碼 (以空格分隔)。 它應該是包含 「資源識別碼」引數所有資訊的完整資源識別碼。 您應該提供 --ids 或其他「資源識別碼」引數。

--name -n

函式應用程式的名稱。

--resource-group -g

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

--slot -s

位置的名稱。 如果未指定,則預設為生產位置。

--subscription

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

全域參數
--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 來取得完整偵錯記錄。