az sql db threat-policy

此命令群組已被取代,將在未來的版本中移除。 請改用 『sql db advanced-threat-protection-setting』。

管理資料庫的威脅偵測原則。

命令

名稱 Description 類型 狀態
az sql db threat-policy show

取得威脅偵測原則。

核心 已取代
az sql db threat-policy update

更新資料庫的威脅偵測原則。

核心 已取代

az sql db threat-policy show

已被取代

此命令已隱含取代,因為命令群組 'sql db threat-policy' 已被取代,而且將在未來的版本中移除。 請改用 『sql db advanced-threat-protection-setting』。

取得威脅偵測原則。

az sql db threat-policy show [--ids]
                             [--name]
                             [--resource-group]
                             [--server]
                             [--subscription]

選擇性參數

--ids

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

--name -n

Azure SQL 資料庫 的名稱。

--resource-group -g

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

--server -s

Azure SQL Server 的名稱。 您可以使用 來設定預設值 az configure --defaults sql-server=<name>

--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 sql db threat-policy update

已被取代

此命令已隱含取代,因為命令群組 'sql db threat-policy' 已被取代,而且將在未來的版本中移除。 請改用 『sql db advanced-threat-protection-setting』。

更新資料庫的威脅偵測原則。

如果已啟用原則,則必須指定storage_account或同時storage_endpoint和storage_account_access_key。

az sql db threat-policy update [--add]
                               [--disabled-alerts]
                               [--email-account-admins]
                               [--email-addresses]
                               [--force-string]
                               [--ids]
                               [--name]
                               [--remove]
                               [--resource-group]
                               [--retention-days]
                               [--server]
                               [--set]
                               [--state {Disabled, Enabled, New}]
                               [--storage-account]
                               [--storage-endpoint]
                               [--storage-key]
                               [--subscription]

範例

依記憶體帳戶名稱啟用。

az sql db threat-policy update -g mygroup -s myserver -n mydb \
    --state Enabled --storage-account mystorage

依記憶體端點和金鑰啟用。

az sql db threat-policy update -g mygroup -s myserver -n mydb \
    --state Enabled --storage-endpoint https://mystorage.blob.core.windows.net \
    --storage-key MYKEY==

停用警示類型的子集。

az sql db threat-policy update -g mygroup -s myserver -n mydb \
    --disabled-alerts Sql_Injection_Vulnerability Access_Anomaly

設定原則的電子郵件收件者。

az sql db threat-policy update -g mygroup -s myserver -n mydb \
    --email-addresses me@examlee.com you@example.com \
    --email-account-admins Enabled

停用威脅原則。

az sql db threat-policy update -g mygroup -s myserver -n mydb --state Disabled

選擇性參數

--add

藉由指定路徑和索引鍵值組,將物件加入物件清單。 範例:--add property.listProperty <key=value, string or JSON string>

預設值: []
--disabled-alerts

已停用的警示清單。

--email-account-admins

警示是否傳送給帳戶管理員。

--email-addresses

警示傳送到的電子郵件地址清單。

--force-string

使用 'set' 或 'add' 時,請保留字串常值,而不是嘗試轉換成 JSON。

預設值: False
--ids

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

--name -n

Azure SQL 資料庫 的名稱。

--remove

從清單中移除屬性或專案。 範例: --remove property.list <indexToRemove>--remove propertyToRemove

預設值: []
--resource-group -g

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

--retention-days

保留威脅偵測記錄的天數。

--server -s

Azure SQL Server 的名稱。 您可以使用 來設定預設值 az configure --defaults sql-server=<name>

--set

指定要設定的屬性路徑和值,以更新物件。 範例:--set property1.property2=<value>

預設值: []
--state

威脅偵測原則狀態。

接受的值: Disabled, Enabled, New
--storage-account

儲存體帳戶的名稱。

--storage-endpoint

記憶體帳戶端點。

--storage-key

儲存體帳戶的存取金鑰。

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