ARM 模板 - 自动批准托管专用端点

Sor*_*rty 8 azure azure-resource-manager azure-data-factory azure-data-lake infrastructure-as-code

我正在为 Azure 数据工厂开发一个 ARM 模板,其中包含 SQL Server 和 Azure Datalake 的托管专用终结点。但是,当 ARM 模板完成执行时,托管专用端点将处于“待处理”状态。如何配置托管专用端点,以便在使用 ARM 模板完全配置 ADF 后将其配置为“已批准”。以下是我的 template.json 文件:

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "environment": {
            "type": "string",
            "metadata": {
                "description": "name of environment for deployment"
            }
        },
        "project": {
            "type": "string",
            "metadata": {
                "description": "name of the project for building the name of resources"
            }
        },
        "location": {
            "defaultValue": "eastus",
            "type": "string"
        },
        "adfFactoryName": {            
            "type": "string"
        },
        "adfVersion": {            
            "type": "string"
        },
        "tags": {
            "type": "object",
            "metadata": {
                "description": "tags to add to resources"
            }
        },
        "adfVNetEnabled": {            
            "type": "bool"
        },
        "adfPublicNetworkAccess": {            
            "type": "bool"
        },
        "adfAzureDatabricksDomain": {
            "type": "string",
            "metadata": "Azure Databricks existing cluster Id"
        },
        "adfAzureDatabricksExistingClusterId": {
            "type": "string",
            "metadata": "Azure Databricks existing cluster Id"
        },
        "adfDataLakeConnectionString": {
            "type": "string",
            "metadata": "Azure Data Lake connection string"
        },
        "adfDataFactoryIdentity": {
            "type": "string",
            "metadata": "Identity type for data factory"
        },
        "adfLSASDBConnectionString": {
            "type": "string",
            "metadata": "SQL DB connection string"            
        },
        "adfKVBaseURL": {
            "type": "string",
            "metadata": "Keyvault connection string"            
        },
        "adfDataLakeStorageName": {
            "type": "string",
            "metadata": "Azure Data lake Storage Name"            
        },
        "adfDataLakeStorageGroupId": {
            "type": "string",
            "metadata": "Azure Data lake Storage Group ID"            
        },
        "adfSqlServerName": {
            "type": "string",
            "metadata": "Azure SQL Server name"            
        },
        "adfSqlServerGroupId": {
            "type": "string",
            "metadata": "Azure SQL Server Group ID"            
        }
    },
    "variables": {
        "factoryId": "[concat('Microsoft.DataFactory/factories/', parameters('adfFactoryName'))]",        
        "managedVirtualNetworkName": "[concat(parameters('adfFactoryName'), '/default')]"      
    },
    "resources": [
        {
            "condition": "[equals(parameters('adfVersion'), 'V2')]",
            "type": "Microsoft.DataFactory/factories",
            "apiVersion": "2018-06-01",
            "name": "[parameters('adfFactoryName')]",
            "location": "[parameters('location')]",
            "identity": {
                "type": "[parameters('adfDataFactoryIdentity')]"
            },
            "properties": {                
                "publicNetworkAccess": "[if(bool(parameters('adfPublicNetworkAccess')), 'Enabled', 'Disabled')]"                
            },
            "tags": "[parameters('tags')]",
            "resources": [
                {
                    "condition": "[and(equals(parameters('adfVersion'), 'V2'), parameters('adfVNetEnabled'))]",
                    "name": "[concat(parameters('adfFactoryName'), '/default')]",
                    "type": "Microsoft.DataFactory/factories/managedVirtualNetworks",
                    "apiVersion": "2018-06-01",
                    "properties": {},
                    "dependsOn": [
                        "[concat('Microsoft.DataFactory/factories/', parameters('adfFactoryName'))]"
                    ]
                },
                {
                    "condition": "[and(equals(parameters('adfVersion'), 'V2'), parameters('adfVNetEnabled'))]",
                    "name": "[concat(parameters('adfFactoryName'), '/DDIR')]",
                    "type": "Microsoft.DataFactory/factories/integrationRuntimes",
                    "apiVersion": "2018-06-01",
                    "properties": {
                        "type": "Managed",
                        "managedVirtualNetwork": {
                            "referenceName": "default",
                            "type": "ManagedVirtualNetworkReference"
                        },
                        "typeProperties": {
                            "computeProperties": {
                                "location": "[parameters('location')]"
                            }
                        }
                    },
                    "dependsOn": [
                        "[concat('Microsoft.DataFactory/factories/', parameters('adfFactoryName'))]",
                        "[concat('Microsoft.DataFactory/factories/', parameters('adfFactoryName'), '/managedVirtualNetworks/default')]"
                    ]
                },
                {
                    "name": "[concat(parameters('adfFactoryName'), '/AzureKeyVault')]",
                    "type": "Microsoft.DataFactory/factories/linkedServices",
                    "apiVersion": "2018-06-01",
                    "properties": {
                        "annotations": [],
                        "type": "AzureKeyVault",
                        "typeProperties": {
                            "baseUrl": "[parameters('adfKVBaseURL')]"
                        }
                    },
                    "dependsOn": [
                        "[parameters('adfFactoryName')]"
                    ]
                },  
                {
                    "name": "[concat(parameters('adfFactoryName'), '/AzureDatabricks_LinkedService')]",
                    "type": "Microsoft.DataFactory/factories/linkedServices",
                    "apiVersion": "2018-06-01",
                    "properties": {
                        "annotations": [],
                        "type": "AzureDatabricks",
                        "typeProperties": {
                            "domain": "[parameters('adfAzureDatabricksDomain')]",
                            "accessToken": {
                                "type": "AzureKeyVaultSecret",
                                "store": {
                                    "referenceName": "AzureKeyVault",
                                    "type": "LinkedServiceReference"
                                },
                                "secretName": "[concat('kvs-databricks-',parameters('environment'), 'aue', parameters('project'))]"
                            },
                            "existingClusterId": "[parameters('adfAzureDatabricksExistingClusterId')]"
                        },
                        "connectVia": {
                            "referenceName": "DDIR",
                            "type": "IntegrationRuntimeReference"
                        }
                    },
                    "dependsOn": [
                        "[parameters('adfFactoryName')]",
                        "[concat(variables('factoryId'), '/integrationRuntimes/DDIR')]",
                        "[concat(variables('factoryId'), '/linkedServices/AzureKeyVault')]"
                    ]
                },                
        {
            "name": "[concat(parameters('adfFactoryName'), '/AzureDatalake_DDIR')]",
            "type": "Microsoft.DataFactory/factories/linkedServices",
            "apiVersion": "2018-06-01",
            "properties": {
                "annotations": [],
                "type": "AzureBlobFS",
                "typeProperties": {
                    "url": "[parameters('adfDataLakeConnectionString')]"
                },
                "connectVia": {
                    "referenceName": "DDIR",
                    "type": "IntegrationRuntimeReference"
                }
            },
            "dependsOn": [
                "[parameters('adfFactoryName')]",
                "[concat(variables('factoryId'), '/integrationRuntimes/DDIR')]"
            ]
        },
        {
            "name": "[concat(parameters('adfFactoryName'), '/LS_ASDB')]",
            "type": "Microsoft.DataFactory/factories/linkedServices",
            "apiVersion": "2018-06-01",
            "properties": {
                "annotations": [],
                "type": "AzureSqlDatabase",
                "typeProperties": {
                    "connectionString": "[parameters('adfLSASDBConnectionString')]",
                    "password": {
                        "type": "AzureKeyVaultSecret",
                        "store": {
                            "referenceName": "AzureKeyVault",
                            "type": "LinkedServiceReference"
                        },
                        "secretName": "kvs-synapsepwd-devauegteng"
                    }
                },
                "connectVia": {
                    "referenceName": "DDIR",
                    "type": "IntegrationRuntimeReference"
                }
            },
            "dependsOn": [
                "[parameters('adfFactoryName')]",
                "[concat(variables('factoryId'), '/integrationRuntimes/DDIR')]",
                "[concat(variables('factoryId'), '/linkedServices/AzureKeyVault')]"
            ]
        } 
            ]
        },
        {
            "name": "[concat(parameters('adfFactoryName'), '/default/',parameters('adfDataLakeStorageName'))]",
            "type": "Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints",
            "apiVersion": "2018-06-01",
            "properties": {
                "privateLinkResourceId": "[resourceId('Microsoft.Storage/storageAccounts', parameters('adfDataLakeStorageName'))]",
                "groupId": "[parameters('adfDataLakeStorageGroupId')]"
            },
            "dependsOn": [
                "[concat('Microsoft.DataFactory/factories/', parameters('adfFactoryName'), '/managedVirtualNetworks/default')]"
            ]
        },
        {
            "name": "[concat(parameters('adfFactoryName'), '/default/',parameters('adfSqlServerName'))]",
            "type": "Microsoft.DataFactory/factories/managedVirtualNetworks/managedPrivateEndpoints",
            "apiVersion": "2018-06-01",
            "properties": {
                "privateLinkResourceId": "[resourceId('Microsoft.Sql/servers', parameters('adfSqlServerName'))]",
                "groupId": "[parameters('adfSqlServerGroupId')]"
            },
            "dependsOn": [
                "[concat('Microsoft.DataFactory/factories/', parameters('adfFactoryName'), '/managedVirtualNetworks/default')]"
            ]
        }
    ]
}
Run Code Online (Sandbox Code Playgroud)

小智 0

使用Azure 门户或使用带有以下 JSON 模板的 ARM 模板创建专用终结点资源,并在 ConnectionState 中提及状态为“已批准”。

例子:

{
  "name": "string",
  "type": "Microsoft.Network/privateEndpoints",
  "apiVersion": "2020-07-01",
  "location": "string",
  "tags": {},
  "properties": {
    "subnet": {
      "id": "string",
      "name": "string"
    },
    "privateLinkServiceConnections": [
      {
        "id": "string",
        "properties": {
          "privateLinkServiceId": "string",
          "groupIds": [
            "string"
          ],
          "requestMessage": "string",
          "privateLinkServiceConnectionState": {
            "status": "string",
            "description": "string",
            "actionsRequired": "string"
          }
        },
        "name": "string"
      }
    ],
    "manualPrivateLinkServiceConnections": [
      {
        "id": "string",
        "properties": {
          "privateLinkServiceId": "string",
          "groupIds": [
            "string"
          ],
          "requestMessage": "string",
          "privateLinkServiceConnectionState": {
            "status": "string",
            "description": "string",
            "actionsRequired": "string"
          }
        },
        "name": "string"
      }
    ],
    "customDnsConfigs": [
      {
        "fqdn": "string",
        "ipAddresses": [
          "string"
        ]
      }
    ]
  },
  "resources": []
}
Run Code Online (Sandbox Code Playgroud)

请参阅 - privateendpoints以获取字符串属性值。

  • 那是行不通的。ConnectionState 是只读的,由部署服务器自动设置。 (2认同)