简体   繁体   English

Data Factory v1将某些标头屏蔽为http标头中的凭据

[英]Data Factory v1 mask some headers as credential in http headers

I have a Data Factory (v1) which downloads some files from an HTTP server. 我有一个数据工厂(v1),可以从HTTP服务器下载一些文件。

Within the dataset pointing to the file location on this server we add an API key as an additional header to the HTTP request. 在指向该服务器上文件位置的数据集中,我们添加了一个API密钥作为HTTP请求的附加标头。 We don't want this key to be visible from the portal similar to how Linked Services mask credentials after having been deployed. 我们不希望此密钥在门户网站中可见,类似于Linked Services在部署后掩盖凭据的方式。

The following Json files define the source linked service, the source dataset and the copy activity. 以下Json文件定义了源链接服务,源数据集和复制活动。

  • HTTP_source_linkedservice.json HTTP_source_linkedservice.json

{ "name": "HTTPSourceLinkedService", "properties": { "hubName": "this_is_a_hubname", "type": "Http", "typeProperties": { "url": "https://website.com", "authenticationType": "Anonymous" } } }

  • HTTP_source_dataset HTTP_source_dataset

{ "name": "HTTPSourceDataset", "properties": { "published": false, "type": "Http", "linkedServiceName": "HTTPSourceLinkedService", "typeProperties": { "relativeUrl": "/main_file_to_download", "additionalHeaders": "X-api-key: API_KEY_HERE\\n" }, "availability": { "frequency": "Day", "interval": 1 }, "external": true, "policy": {} } }

  • Copy Activity 复制活动

{ "type": "Copy", "typeProperties": { "source": { "type": "HttpSource" }, "sink": { "type": "BlobSink", "writeBatchSize": 0, "writeBatchTimeout": "00:00:00" } }, "inputs": [ { "name": "HTTPSourceDataset" } ], "outputs": [ { "name": "HTTPSinkDataset" } ], "scheduler": { "frequency": "Day", "interval": 1 }, "name": "CopyFileFromServer" }

I know we could use a Custom Activity to make the request itself and fetch the API key from a keyvault but I really want to use the standard Copy Activity. 我知道我们可以使用“自定义活动”来发出请求,并从密钥库中获取API密钥,但我确实想使用标准的“复制活动”。

Is there a way to achieve this ? 有办法实现吗?

Unfortunately, I think this is not possible. 不幸的是,我认为这是不可能的。 Header field are defined as string. 标头字段定义为字符串。 And in v1, there is even no secure string which is introduced in v2 to indicate a field is credentials. 在v1中,甚至没有在v2中引入的安全字符串来指示字段是凭据。 But I think this can't be achieved in v2 either. 但是我认为这在v2中也无法实现。 As the model type is fixed. 由于型号类型是固定的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM