Microsoft.Synapse workspaces/sqlPools/securityAlertPolicies 2021-04-01-預覽版

Bicep 資源定義

workspaces/sqlPools/securityAlertPolicies 資源類型可以使用目標作業來部署:

如需每個 API 版本中已變更屬性的清單,請參閱 變更記錄檔。

資源格式

若要建立 Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies 資源,請將下列 Bicep 新增至範本。

resource symbolicname 'Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies@2021-04-01-preview' = {
  parent: resourceSymbolicName
  name: 'string'
  properties: {
    disabledAlerts: [
      'string'
    ]
    emailAccountAdmins: bool
    emailAddresses: [
      'string'
    ]
    retentionDays: int
    state: 'string'
    storageAccountAccessKey: 'string'
    storageEndpoint: 'string'
  }
}

屬性值

Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies

名字 描述 價值
名字 資源名稱 'default' (必要)
父代 在 Bicep 中,您可以指定子資源的父資源。 只有在父資源外部宣告子資源時,才需要新增這個屬性。

如需詳細資訊,請參閱 父資源外部的子資源。
類型的資源符號名稱:workspaces/sqlPools
性能 資源屬性。 SecurityAlertPolicyProperties

SecurityAlertPolicyProperties

名字 描述 價值
disabledAlerts (禁用警報) 指定已停用的警示陣列。 允許的值為:Sql_Injection、Sql_Injection_Vulnerability、Access_Anomaly、Data_Exfiltration、Unsafe_Action 字串[]
電子郵件帳戶管理員 指定警示會傳送給帳戶管理員。 布爾 (bool)
電子郵件位址 指定傳送警示的電子郵件地址陣列。 字串[]
retention天數 指定要保留在威脅偵測稽核記錄中的天數。 整數 (int)
狀態 指定原則的狀態,無論是啟用或停用,還是尚未在特定 Sql 集區上套用原則。 “已禁用”
“已啟用”
'New' (必要)
storageAccountAccessKey 指定威脅偵測稽核記憶體帳戶的標識符金鑰。 字串
storageEndpoint 指定 Blob 記憶體端點(例如 https://MyAccount.blob.core.windows.net)。 此 Blob 記憶體會保存所有威脅偵測稽核記錄。 字串

ARM 樣本資源定義

workspaces/sqlPools/securityAlertPolicies 資源類型可以使用目標作業來部署:

使用範例

資源格式

若要建立 Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies 資源,請將下列 JSON 新增至範本。

{
  "type": "Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies",
  "apiVersion": "2021-04-01-preview",
  "name": "string",
  "properties": {
    "disabledAlerts": [ "string" ],
    "emailAccountAdmins": "bool",
    "emailAddresses": [ "string" ],
    "retentionDays": "int",
    "state": "string",
    "storageAccountAccessKey": "string",
    "storageEndpoint": "string"
  }
}

屬性值

Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies

名字 描述 價值
apiVersion API 版本 “2021-04-01-預覽”
名字 資源名稱 'default' (必要)
性能 資源屬性。 SecurityAlertPolicyProperties
型別 資源類型 “Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies”

SecurityAlertPolicyProperties

名字 描述 價值
disabledAlerts (禁用警報) 指定已停用的警示陣列。 允許的值為:Sql_Injection、Sql_Injection_Vulnerability、Access_Anomaly、Data_Exfiltration、Unsafe_Action 字串[]
電子郵件帳戶管理員 指定警示會傳送給帳戶管理員。 布爾 (bool)
電子郵件位址 指定傳送警示的電子郵件地址陣列。 字串[]
retention天數 指定要保留在威脅偵測稽核記錄中的天數。 整數 (int)
狀態 指定原則的狀態,無論是啟用或停用,還是尚未在特定 Sql 集區上套用原則。 “已禁用”
“已啟用”
'New' (必要)
storageAccountAccessKey 指定威脅偵測稽核記憶體帳戶的標識符金鑰。 字串
storageEndpoint 指定 Blob 記憶體端點(例如 https://MyAccount.blob.core.windows.net)。 此 Blob 記憶體會保存所有威脅偵測稽核記錄。 字串

Terraform (AzAPI 提供者) 資源定義

workspaces/sqlPools/securityAlertPolicies 資源類型可以使用目標作業來部署:

  • 資源團體 關於每個 API 版本變更屬性的清單,請參見 變更日誌。

使用範例

Terraform 範例

部署 Synapse SQL 集區安全性警示原則的基本範例。

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 = "westus"
}

variable "sql_administrator_login_password" {
  type        = string
  sensitive   = true
  description = "The SQL administrator login password for the Synapse workspace"
}

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@2023-05-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${var.resource_name}st"
  location  = var.location
  body = {
    kind = "StorageV2"
    properties = {
      accessTier                   = "Hot"
      allowBlobPublicAccess        = true
      allowCrossTenantReplication  = false
      allowSharedKeyAccess         = true
      defaultToOAuthAuthentication = false
      dnsEndpointType              = "Standard"
      encryption = {
        keySource = "Microsoft.Storage"
        services = {
          queue = {
            keyType = "Service"
          }
          table = {
            keyType = "Service"
          }
        }
      }
      isHnsEnabled       = true
      isLocalUserEnabled = true
      isNfsV3Enabled     = false
      isSftpEnabled      = false
      minimumTlsVersion  = "TLS1_2"
      networkAcls = {
        bypass              = "AzureServices"
        defaultAction       = "Allow"
        ipRules             = []
        resourceAccessRules = []
        virtualNetworkRules = []
      }
      publicNetworkAccess      = "Enabled"
      supportsHttpsTrafficOnly = true
    }
    sku = {
      name = "Standard_LRS"
    }
  }
}

resource "azapi_resource" "filesystem" {
  type      = "Microsoft.Storage/storageAccounts/blobServices/containers@2023-05-01"
  parent_id = "${azapi_resource.storageAccount.id}/blobServices/default"
  name      = "${var.resource_name}fs"
  body = {
    properties = {
      publicAccess = "None"
    }
  }
}

resource "azapi_resource" "workspace" {
  type      = "Microsoft.Synapse/workspaces@2021-06-01"
  parent_id = azapi_resource.resourceGroup.id
  name      = "${var.resource_name}ws"
  location  = var.location
  identity {
    type         = "SystemAssigned"
    identity_ids = []
  }
  body = {
    properties = {
      azureADOnlyAuthentication = false
      defaultDataLakeStorage = {
        accountUrl = azapi_resource.storageAccount.output.properties.primaryEndpoints.dfs
        filesystem = azapi_resource.filesystem.name
      }
      managedResourceGroupName         = ""
      managedVirtualNetwork            = ""
      publicNetworkAccess              = "Enabled"
      sqlAdministratorLogin            = "sqladminuser"
      sqlAdministratorLoginPassword    = var.sql_administrator_login_password
      workspaceRepositoryConfiguration = {}
    }
  }
  depends_on = [azapi_resource.filesystem]
}

resource "azapi_resource" "sqlPool" {
  type      = "Microsoft.Synapse/workspaces/sqlPools@2021-06-01"
  parent_id = azapi_resource.workspace.id
  name      = "${var.resource_name}sp"
  location  = var.location
  body = {
    properties = {
      collation          = ""
      createMode         = "Default"
      storageAccountType = "GRS"
    }
    sku = {
      name = "DW100c"
    }
  }
}

resource "azapi_resource_action" "storageKeys" {
  type                   = "Microsoft.Storage/storageAccounts@2023-05-01"
  resource_id            = azapi_resource.storageAccount.id
  action                 = "listKeys"
  response_export_values = ["keys"]
}

resource "azapi_resource" "securityAlertPolicy" {
  type      = "Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies@2021-06-01"
  parent_id = azapi_resource.sqlPool.id
  name      = "default"
  body = {
    properties = {
      disabledAlerts          = ["Data_Exfiltration", "Sql_Injection"]
      retentionDays           = 20
      state                   = "Enabled"
      storageAccountAccessKey = azapi_resource_action.storageKeys.output.keys[0].value
      storageEndpoint         = azapi_resource.storageAccount.output.properties.primaryEndpoints.blob
    }
  }
}

資源格式

若要建立 Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies 資源,請將下列 Terraform 新增至範本。

resource "azapi_resource" "symbolicname" {
  type = "Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies@2021-04-01-preview"
  name = "string"
  parent_id = "string"
  body = {
    properties = {
      disabledAlerts = [
        "string"
      ]
      emailAccountAdmins = bool
      emailAddresses = [
        "string"
      ]
      retentionDays = int
      state = "string"
      storageAccountAccessKey = "string"
      storageEndpoint = "string"
    }
  }
}

屬性值

Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies

名字 描述 價值
名字 資源名稱 'default' (必要)
父項識別碼 此資源為父系之資源的標識碼。 類型資源的標識碼:workspaces/sqlPools
性能 資源屬性。 SecurityAlertPolicyProperties
型別 資源類型 “Microsoft.Synapse/workspaces/sqlPools/securityAlertPolicies@2021-04-01-preview”

SecurityAlertPolicyProperties

名字 描述 價值
disabledAlerts (禁用警報) 指定已停用的警示陣列。 允許的值為:Sql_Injection、Sql_Injection_Vulnerability、Access_Anomaly、Data_Exfiltration、Unsafe_Action 字串[]
電子郵件帳戶管理員 指定警示會傳送給帳戶管理員。 布爾 (bool)
電子郵件位址 指定傳送警示的電子郵件地址陣列。 字串[]
retention天數 指定要保留在威脅偵測稽核記錄中的天數。 整數 (int)
狀態 指定原則的狀態,無論是啟用或停用,還是尚未在特定 Sql 集區上套用原則。 “已禁用”
“已啟用”
'New' (必要)
storageAccountAccessKey 指定威脅偵測稽核記憶體帳戶的標識符金鑰。 字串
storageEndpoint 指定 Blob 記憶體端點(例如 https://MyAccount.blob.core.windows.net)。 此 Blob 記憶體會保存所有威脅偵測稽核記錄。 字串