簡體   English   中英

Azure 數據工廠:使用 Azure 密鑰庫參考在鏈接服務中獲取用戶名,這可能嗎?

[英]Azure Data Factory: Get UserName in Linked Service using Azure Key Vault Reference, is it possible?

我知道您可以在 ADF 中創建 Azure Key Vault 鏈接服務,然后可以在其他鏈接服務中使用它來獲取密碼密鑰/連接字符串密鑰。 ADF 門戶鏈接服務設置 這是 JSON 從 Keyvault 機密中檢索 FILE SYSTEM 鏈接服務的密碼時的樣子(請參閱 ADF UI 片段的屏幕截圖):

{
"name": "FILESERVER_blah",
"properties": {
    "annotations": [],
    "type": "FileServer",
    "typeProperties": {
        "host": "\\\\ServerName\\ShareName",
        "userId": "ThisIsMyUserName@blah.com",
        "password": {
            "type": "AzureKeyVaultSecret",
            "store": {
                "referenceName": "KEYVAULT_maddisandbox",
                "type": "LinkedServiceReference"
            },
            "secretName": "MySecretName"
        }
    },
    "connectVia": {
        "referenceName": "shir-madie-sandbox",
        "type": "IntegrationRuntimeReference"
    }
}}

有了這個邏輯,我想我可以在 KeyVault 中創建一個 UserName 機密並以相同的方式引用它。 所以我將鏈接服務 Json 更新為以下內容:

{
"name": "FILESERVER_akv_dynamic",
"properties": {
    "type": "FileServer",
    "annotations": [],
    "parameters": {
        "UserSecretName": {
            "type": "string",
            "defaultValue": ""
        },
        "PasswordSecretName": {
            "type": "string",
            "defaultValue": ""
        },
        "Host": {
            "type": "string",
            "defaultValue": ""
        }
    },
    "typeProperties": {
        "host": "@linkedService().Host",
        "userId": {
            "type": "AzureKeyVaultSecret",
            "store": {
                "referenceName": "KEYVAULT_maddisandbox",
                "type": "LinkedServiceReference"
            },
            "secretName": "@linkedService().UserSecretName"
        },
        "password": {
            "type": "AzureKeyVaultSecret",
            "store": {
                "referenceName": "KEYVAULT_maddisandbox",
                "type": "LinkedServiceReference"
            },
            "secretName": "@linkedService().PasswordSecretName"
        }
    },
    "connectVia": {
        "referenceName": "shir-madie-sandbox",
        "type": "IntegrationRuntimeReference"
    }
}}

當我這樣做並嘗試運行測試連接時,它會返回此錯誤:

Failed to convert the value in 'userid' property to 'System.String' type. Please make sure the payload structure and value are correct.

我知道我可以使用 KeyVault REST API 來獲取 Secret 值並將其傳遞給我的活動/數據集/鏈接服務,但我更願意使用本機功能並通過直接引用鏈接服務 ZEED3538Z4244 以來節省一步,尤其是我在我的工廠設置了 KeyVault 鏈接服務。

如果可能的話,有人可以解釋如何使這項工作嗎? 如果不可能,為什么不可能? 密碼機密的處理方式與我嘗試檢索的用戶名機密有何不同?

謝謝

目前設計上只有秘密或連接字符串(對於在鏈接服務中使用連接字符串的連接器,如 SQL 服務器、Blob 存儲等,您可以選擇僅在 AKV 中存儲秘密字段,例如密碼,或存儲AKV 中的整個連接字符串。您可以在 UI 上找到這兩個選項。 )允許通過 ADF 鏈接服務從 AKV 檢索。

因此,無法通過 ADF 鏈接服務從 AKV 檢索用戶名。 這是一個設計限制。

相關 MS 文檔: 將憑證存儲在 Azure 密鑰庫中

但是,如果您對此有任何具體反饋,請隨時在 ADF 用戶語音論壇中分享您的建議/想法: https://feedback.azure.com/forums/270578-azure-data-factory

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM