通过设置数据流终结点,将数据发送到 Azure IoT 操作中的 Azure Data Lake Storage Gen2。 借助此配置,可以指定目标终结点、身份验证方法、表和其他设置。
先决条件
为托管标识分配权限
若要为 Azure Data Lake Storage Gen2 配置数据流终结点,请使用用户分配的托管标识或系统分配的托管标识。 此方法是安全的,无需手动管理凭据。
创建 Azure Data Lake Storage Gen2 后,需要为 Azure IoT Operations 托管标识分配一个角色,以授予写入存储帐户的权限。
如果使用系统分配的托管标识,请在 Azure 门户中转到 Azure IoT 操作实例并选择 “概述”。 复制“Azure IoT 操作 Arc 扩展”后列出的扩展的名称。 例如 azure-iot-operations-xxxx7。 可以使用 Azure IoT 操作 Arc 扩展的名称找到系统分配的托管标识。
然后,转到 Azure 存储帐户 >访问控制(IAM)>添加角色分配。
- 在“ 角色 ”选项卡上,选择适当的角色,例如
Storage Blob Data Contributor
。 这将为托管标识提供写入 Azure 存储 blob 容器所需的权限。 若要了解详细信息,请参阅 使用 Microsoft Entra ID 授予对 blob 的访问权限。
- 在“成员”选项卡上:
- 如果使用系统分配的托管标识,若要 分配访问权限,请选择 “用户”、“组”或服务主体,然后选择“ + 选择成员 ”并搜索 Azure IoT Operations Arc 扩展的名称。
- 如果使用用户分配的托管标识,首先在分配访问权限中选择托管标识,然后选择"+ 选择成员",并搜索为云连接设置的用户分配托管标识。
为 Azure Data Lake Storage Gen2 创建数据流终结点
在 IoT 操作门户中,选择“数据流终结点”选项卡。
在“创建新的数据流终结点”下,选择“Azure Data Lake Storage (第二代)”“新建”。>
输入以下用于终结点的设置:
设置 |
说明 |
名称 |
数据流终结点的名称。 |
主机 |
Azure Data Lake Storage Gen2 终结点的主机名,格式为 <account>.blob.core.windows.net 。 将帐户占位符替换为终结点帐户名称。 |
身份验证方法 |
用于身份验证的方法。 建议选择 系统分配的托管标识 或 用户分配的托管标识。 |
客户端 ID |
用户分配的托管标识的客户端 ID。 如果使用 用户分配的托管标识,则为必需。 |
租户 ID |
用户分配的托管标识的租户 ID。 如果使用 用户分配的托管标识,则为必需。 |
同步的机密名称 |
数据流中的终结点设置和 Kubernetes 群集中的机密信息的引用名称。 如果使用 Access 令牌,则为必需。 |
访问令牌机密名称 |
包含 SAS 令牌的 Kubernetes 机密的名称。 如果使用 Access 令牌,则为必需。 |
选择 “应用” 以预配终结点。
创建或替换
使用 az iot ops 数据流终结点 create adls 命令创建或替换 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint create adls --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --storage-account <StorageAccountName>
存储帐户名称是采用格式 <account>.blob.core.windows.net
的 Azure Data Lake Storage Gen2 帐户的名称。
下面是用于创建或替换名为 adls-endpoint 的 Azure Data Lake Storage Gen2 数据流终结点的示例命令:
az iot ops dataflow endpoint create adls --resource-group myResourceGroup --instance myAioInstance --name adls-endpoint --storage-account adlsstorage
创建或更改
使用 az iot ops dataflow endpoint apply 命令创建或更改 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
参数 --config-file
是包含资源属性的 JSON 配置文件的路径和文件名。
在此示例中,假定一个配置文件 adls-endpoint.json
,其中包含存储在用户主目录中的以下内容:
{
"endpointType": "DataLakeStorage",
"dataLakeStorageSettings": {
"authentication": {
"method": "SystemAssignedManagedIdentity",
"systemAssignedManagedIdentitySettings": {}
},
"batching": {
"latencySeconds": 60,
"maxMessages": 100000
},
"host": "https://<account>.blob.core.windows.net"
}
}
下面是一个示例命令,用于创建名为 adls-endpoint 的新 Azure Data Lake Storage Gen2 数据流终结点:
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adls-endpoint --config-file ~/adls-endpoint.json
创建包含以下内容的 Bicep .bicep
文件。
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
param endpointName string = '<ENDPOINT_NAME>'
param host string = 'https://<ACCOUNT>.blob.core.windows.net'
resource aioInstance 'Microsoft.IoTOperations/instances@2024-11-01' existing = {
name: aioInstanceName
}
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
name: customLocationName
}
resource adlsGen2Endpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-11-01' = {
parent: aioInstance
name: endpointName
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
endpointType: 'DataLakeStorage'
dataLakeStorageSettings: {
host: host
authentication: {
// See available authentication methods section for method types
// method: <METHOD_TYPE>
}
}
}
}
然后,通过 Azure CLI 进行部署。
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
创建具有以下内容的 Kubernetes 清单 .yaml
文件。
apiVersion: connectivity.iotoperations.azure.com/v1
kind: DataflowEndpoint
metadata:
name: <ENDPOINT_NAME>
namespace: azure-iot-operations
spec:
endpointType: DataLakeStorage
dataLakeStorageSettings:
host: https://<ACCOUNT>.blob.core.windows.net
authentication:
# See available authentication methods section for method types
# method: <METHOD_TYPE>
然后,将清单文件应用到 Kubernetes 群集。
kubectl apply -f <FILE>.yaml
使用访问令牌身份验证
按照“访问令牌”部分中的步骤获取存储帐户的 SAS 令牌,并将其存储在 Kubernetes 机密中。
然后,创建 DataflowEndpoint 资源并指定访问令牌身份验证方法。 在这里,请将 <SAS_SECRET_NAME>
替换为包含 SAS 令牌的机密的名称,以及其他占位符值。
有关在操作体验 Web UI 中创建密钥的步骤,请参阅 访问令牌 部分。
创建包含以下内容的 Bicep .bicep
文件。
param aioInstanceName string = '<AIO_INSTANCE_NAME>'
param customLocationName string = '<CUSTOM_LOCATION_NAME>'
param endpointName string = '<ENDPOINT_NAME>'
param host string = 'https://<ACCOUNT>.blob.core.windows.net'
resource aioInstance 'Microsoft.IoTOperations/instances@2024-11-01' existing = {
name: aioInstanceName
}
resource customLocation 'Microsoft.ExtendedLocation/customLocations@2021-08-31-preview' existing = {
name: customLocationName
}
resource adlsGen2Endpoint 'Microsoft.IoTOperations/instances/dataflowEndpoints@2024-11-01' = {
parent: aioInstance
name: endpointName
extendedLocation: {
name: customLocation.id
type: 'CustomLocation'
}
properties: {
endpointType: 'DataLakeStorage'
dataLakeStorageSettings: {
host: host
authentication: {
method: 'AccessToken'
accessTokenSettings: {
secretRef: '<SAS_SECRET_NAME>'
}
}
}
}
}
然后,通过 Azure CLI 进行部署。
az deployment group create --resource-group <RESOURCE_GROUP> --template-file <FILE>.bicep
创建具有以下内容的 Kubernetes 清单 .yaml
文件。
apiVersion: connectivity.iotoperations.azure.com/v1
kind: DataflowEndpoint
metadata:
name: <ENDPOINT_NAME>
namespace: azure-iot-operations
spec:
endpointType: DataLakeStorage
dataLakeStorageSettings:
host: https://<ACCOUNT>.blob.core.windows.net
authentication:
method: AccessToken
accessTokenSettings:
secretRef: <SAS_SECRET_NAME>
然后,将清单文件应用到 Kubernetes 群集。
kubectl apply -f <FILE>.yaml
可用身份验证方法
以下身份验证方法适用于 Azure Data Lake Storage Gen2 终结点。
系统分配的托管标识
在配置数据流端点之前,请为 Azure IoT 操作托管身份分配一个角色,以授予写入存储帐户的权限:
- 在 Azure 门户中,转到 Azure IoT 操作实例并选择“概述”。
- 复制“Azure IoT 操作 Arc 扩展”后列出的扩展的名称。 例如 azure-iot-operations-xxxx7。
- 转到你需要授予权限的云资源。 例如,转到 Azure 存储帐户 >访问控制(IAM)>添加角色分配。
- 在“角色”选项卡上,选择适当的角色。
- 在“成员”选项卡上,对于“将访问权限分配到”,选择“用户、组或服务主体”选项,然后选择“+ 选择成员”并搜索 Azure IoT 操作托管标识。 例如 azure-iot-operations-xxxx7。
然后,使用系统分配的托管标识设置配置数据流终结点。
在操作体验数据流终结点设置页中,选择“基本”选项卡,然后选择“身份验证方法”“系统分配的托管标识”。>
大多数情况下,无需指定服务受众。 不指定受众将会创建一个托管标识,其默认受众范围限定为存储帐户。
创建或替换
使用 az iot ops dataflow endpoint create adls 命令创建或替换采用系统分配的托管标识的 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint create adls --auth-type SystemAssignedManagedIdentity --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --storage-account <StorageAccountName>
存储帐户名称是采用格式 <account>.blob.core.windows.net
的 Azure Data Lake Storage Gen2 帐户的名称。
用于创建或替换名为 my-endpoint
的 Azure Data Lake Storage Gen2 数据流终结点的示例命令为:
az iot ops dataflow endpoint create adls --auth-type SystemAssignedManagedIdentity --resource-group myResourceGroup --instance myAioInstance --name adls-endpoint --storage-account adlsstorage
创建或更改
使用 az iot ops dataflow endpoint apply 命令创建或更改采用系统分配的托管标识的 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
参数 --config-file
是包含资源属性的 JSON 配置文件的路径和文件名。
在此示例中,假定一个配置文件 adls-endpoint.json
,其中包含存储在用户主目录中的以下内容:
{
"endpointType": "DataLakeStorage",
"dataLakeStorageSettings": {
"authentication": {
"method": "SystemAssignedManagedIdentity",
"systemAssignedManagedIdentitySettings": {}
},
"batching": {
"latencySeconds": 60,
"maxMessages": 100000
},
"host": "https://<account>.blob.core.windows.net"
}
}
下面是一个示例命令,用于创建名为 adls-endpoint 的新 Azure Data Lake Storage Gen2 数据流终结点:
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adls-endpoint --config-file ~/adls-endpoint.json
dataLakeStorageSettings: {
authentication: {
method: 'SystemAssignedManagedIdentity'
systemAssignedManagedIdentitySettings: {}
}
}
dataLakeStorageSettings:
authentication:
method: SystemAssignedManagedIdentity
systemAssignedManagedIdentitySettings: {}
如果需要替代系统分配的托管标识受众,则可以指定 audience
设置。
大多数情况下,无需指定服务受众。 不指定受众将会创建一个托管标识,其默认受众范围限定为存储帐户。
创建或替换
使用 az iot ops dataflow endpoint create adls 命令创建或替换采用系统分配的托管标识的 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint create adls --auth-type SystemAssignedManagedIdentity --audience https://<account>.blob.core.windows.net --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --storage-account <StorageAccountName>
存储帐户名称是采用格式 <account>.blob.core.windows.net
的 Azure Data Lake Storage Gen2 帐户的名称。
用于创建或替换名为 my-endpoint
的 Azure Data Lake Storage Gen2 数据流终结点的示例命令为:
az iot ops dataflow endpoint create adls --auth-type SystemAssignedManagedIdentity --audience https://<account>.blob.core.windows.net --resource-group myResourceGroup --instance myAioInstance --name adls-endpoint --storage-account adlsstorage
创建或更改
使用 az iot ops dataflow endpoint apply 命令创建或更改采用系统分配的托管标识的 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
参数 --config-file
是包含资源属性的 JSON 配置文件的路径和文件名。
在此示例中,假定一个配置文件 adls-endpoint.json
,其中包含存储在用户主目录中的以下内容:
{
"endpointType": "DataLakeStorage",
"dataLakeStorageSettings": {
"authentication": {
"method": "SystemAssignedManagedIdentity",
"systemAssignedManagedIdentitySettings": {
"audience": "https://<account>.blob.core.windows.net"
}
},
"batching": {
"latencySeconds": 60,
"maxMessages": 100000
},
"host": "https://<account>.blob.core.windows.net"
}
}
下面是一个示例命令,用于创建名为 adls-endpoint 的新 Azure Data Lake Storage Gen2 数据流终结点:
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adls-endpoint --config-file ~/adls-endpoint.json
dataLakeStorageSettings: {
authentication: {
method: 'SystemAssignedManagedIdentity'
systemAssignedManagedIdentitySettings: {
audience: 'https://<ACCOUNT>.blob.core.windows.net'
}
}
}
dataLakeStorageSettings:
authentication:
method: SystemAssignedManagedIdentity
systemAssignedManagedIdentitySettings:
audience: https://<ACCOUNT>.blob.core.windows.net
用户分配的托管标识
若要使用用户分配的托管标识进行身份验证,必须先部署已启用安全设置的 Azure IoT 操作。 然后,需要 为云连接设置用户分配的托管标识。 若要了解详细信息,请参阅 Azure IoT作部署中的“启用安全设置”。
在配置数据流终结点之前,请为用户分配的托管标识分配一个角色,以授予写入存储帐户的权限:
- 在 Azure 门户中,转到你需要授予权限的云资源。 例如,转到 Azure 存储帐户 >访问控制(IAM)>添加角色分配。
- 在“角色”选项卡上,选择适当的角色。
- 在“成员”选项卡上,对于“将访问权限分配到”,选择“托管标识”选项,然后选择“+ 选择成员”并搜索用户分配的托管标识。
然后,使用用户分配的托管标识设置配置数据流终结点。
在操作体验数据流终结点设置页中,选择“基本”选项卡,然后选择“身份验证方法”“用户分配的托管标识”。>
在相应的字段中输入用户分配的托管标识客户端 ID 和租户 ID。
创建或替换
使用 az iot ops 数据流终结点 create adls 命令,创建或替换具有用户分配的托管身份的 Azure 数据湖存储 Gen2 数据流终结点。
az iot ops dataflow endpoint create adls --auth-type UserAssignedManagedIdentity --client-id <ClientId> --tenant-id <TenantId> --scope <Scope> --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --storage-account <StorageAccountName>
存储帐户名称是采用格式 <account>.blob.core.windows.net
的 Azure Data Lake Storage Gen2 帐户的名称。 该 --auth-type
参数指定身份验证方法, UserAssignedManagedIdentity
在本例中。
--client-id
、--tenant-id
和--scope
参数分别指定用户分配的托管标识客户端 ID、租户 ID 和作用域。
用于创建或替换名为 my-endpoint
的 Azure Data Lake Storage Gen2 数据流终结点的示例命令为:
az iot ops dataflow endpoint create adls --auth-type UserAssignedManagedIdentity --client-id ClientId --tenant-id TenantId --scope https://storage.azure.com/.default --resource-group myResourceGroup --instance myAioInstance --name adls-endpoint --storage-account adlsstorage
创建或更改
使用 az iot ops dataflow endpoint apply 命令创建或更改采用用户分配的托管标识的 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
参数 --config-file
是包含资源属性的 JSON 配置文件的路径和文件名。
在此示例中,假定一个配置文件 adls-endpoint.json
,其中包含存储在用户主目录中的以下内容:
{
"endpointType": "DataLakeStorage",
"dataLakeStorageSettings": {
"authentication": {
"method": "UserAssignedManagedIdentity",
"userAssignedManagedIdentitySettings": {
"clientId": "<ClientId>",
"scope": "<Scope>",
"tenantId": "<TenantId>"
}
},
"batching": {
"latencySeconds": 60,
"maxMessages": 100000
},
"host": "https://<account>.blob.core.windows.net"
}
}
下面是一个示例命令,用于创建名为 adls-endpoint 的新 Azure Data Lake Storage Gen2 数据流终结点:
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adls-endpoint --config-file ~/adls-endpoint.json
dataLakeStorageSettings: {
authentication: {
method: 'UserAssignedManagedIdentity'
userAssignedManagedIdentitySettings: {
clientId: '<ID>'
tenantId: '<ID>'
// Optional, defaults to 'https://storage.azure.com/.default'
// scope: 'https://<SCOPE_URL>'
}
}
}
dataLakeStorageSettings:
authentication:
method: UserAssignedManagedIdentity
userAssignedManagedIdentitySettings:
clientId: <ID>
tenantId: <ID>
# Optional, defaults to 'https://storage.azure.com/.default'
# scope: https://<SCOPE_URL>
在这里,范围是可选的,默认为 https://storage.azure.com/.default
。 如果需要替代默认范围,请通过 Bicep 或 Kubernetes 清单指定 scope
设置。
访问令牌
使用访问令牌是替代性身份验证方法。 此方法要求使用 SAS 令牌创建 Kubernetes 机密,并在 DataflowEndpoint 资源中引用该机密。
获取 Azure Data Lake Storage Gen2(ADLSv2)帐户的 SAS 令牌 。 例如,使用 Azure 门户浏览到存储帐户。 在左侧菜单中,选择“安全性 + 网络”“共享访问签名”。> 使用下表设置所需的权限。
参数 |
启用的设置 |
允许的服务 |
团块 |
允许的资源类型 |
对象、容器 |
允许的权限 |
读取、写入、删除、列出、创建 |
要增强安全性并遵循最低特权原则,可以为特定容器生成 SAS 令牌。 要防止身份验证错误,请确保 SAS 令牌中指定的容器与配置中的数据流目标设置匹配。
重要说明
为了使用操作体验 Web UI 管理机密,必须先通过配置 Azure Key Vault 和启用工作负荷标识来启用 Azure IoT 操作的安全设置。 若要了解详细信息,请参阅 Azure IoT作部署中的“启用安全设置”。
在操作体验数据流终结点设置页中,选择“基本”选项卡,然后选择“身份验证方法”“访问令牌”。>
此时,在“同步的机密名称”下,输入机密的名称。 此名称用于在数据流终结点设置中引用机密,是机密存储在 Kubernetes 集群中的名称。
然后,在 “访问令牌机密名称”下,选择“ 添加引用 ”以从 Azure Key Vault 添加机密。 在下一页上,使用“从 Azure Key Vault 添加”从 Azure Key Vault 选择机密,或选择“新建”创建新机密。
如果选择“新建”,请输入以下设置:
设置 |
说明 |
机密名称 |
Azure 密钥保管库中机密的名称。 选择一个易于记住的名称,以便稍后从列表中选择机密。 |
机密值 |
SAS 令牌,格式为 'sv=2022-11-02&ss=b&srt=c&sp=rwdlax&se=2023-07-22T05:47:40Z&st=2023-07-21T21:47:40Z&spr=https&sig=<signature>' 。 |
设置激活日期 |
如果已启用,则为机密生效的日期。 |
设置过期日期 |
如果已启用,则为机密过期的日期。 |
若要了解有关机密的详细信息,请参阅 在 Azure IoT作中创建和管理机密。
创建或替换
使用 az iot ops dataflow endpoint create adls 命令创建或替换 Azure Data Lake Storage Gen2 数据流终结点,使用访问令牌认证。
az iot ops dataflow endpoint create adls --auth-type AccessToken --secret-name <SasSecretName> --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --storage-account <StorageAccountName>
存储帐户名称是采用格式 <account>.blob.core.windows.net
的 Azure Data Lake Storage Gen2 帐户的名称。 该 --auth-type
参数指定身份验证方法, AccessToken
在本例中。 该 --secret-name
参数指定包含 SAS 令牌的 Kubernetes 机密的名称。
用于创建或替换名为 my-endpoint
的 Azure Data Lake Storage Gen2 数据流终结点的示例命令为:
az iot ops dataflow endpoint create adls --auth-type AccessToken --secret-name mySasSecret --resource-group myResourceGroup --instance myAioInstance --name adls-endpoint --storage-account adlsstorage
创建或更改
使用 az iot ops 数据流终结点 apply 命令创建或更改具有访问令牌身份验证的 Azure Data Lake Storage Gen2 数据流终结点。
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
参数 --config-file
是包含资源属性的 JSON 配置文件的路径和文件名。
在此示例中,假定一个配置文件 adls-endpoint.json
,其中包含存储在用户主目录中的以下内容:
{
"endpointType": "DataLakeStorage",
"dataLakeStorageSettings": {
"authentication": {
"method": "AccessToken",
"accessTokenSettings": {
"secretRef": "<SAS_SECRET_NAME>"
}
},
"batching": {
"latencySeconds": 60,
"maxMessages": 100000
},
"host": "https://<account>.blob.core.windows.net"
}
}
dataLakeStorageSettings: {
authentication: {
method: 'AccessToken'
accessTokenSettings: {
secretRef: '<SAS_SECRET_NAME>'
}
}
}
下面是一个示例命令,用于创建名为 adls-endpoint 的新 Azure Data Lake Storage Gen2 数据流终结点:
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adls-endpoint --config-file ~/adls-endpoint.json
使用 SAS 令牌创建 Kubernetes 机密。
kubectl create secret generic <SAS_SECRET_NAME> -n azure-iot-operations \
--from-literal=accessToken='sv=2022-11-02&ss=b&srt=c&sp=rwdlax&se=2023-07-22T05:47:40Z&st=2023-07-21T21:47:40Z&spr=https&sig=<signature>'
dataLakeStorageSettings:
authentication:
method: AccessToken
accessTokenSettings:
secretRef: <SAS_SECRET_NAME>
高级设置
可以为 Azure Data Lake Storage Gen2 终结点设置高级设置,例如批处理延迟和消息计数。
使用 batching
设置配置消息的最大数量和消息发送到目标之前的最大延迟。 如果要优化网络带宽并减少对目标的请求数,此设置会非常有用。
字段 |
说明 |
必需 |
latencySeconds |
将消息发送到目标之前要等待的最大秒数。 默认值为 60 秒。 |
否 |
maxMessages |
要发送到目标的最大消息数。 默认值为 100000 条消息。 |
否 |
例如,要将最大消息数配置为 1000,并将最大延迟配置为 100 秒,请使用以下设置:
在操作体验中,选择数据流终结点的“高级”选项卡。
使用 az iot ops dataflow endpoint apply 命令来创建或修改 Azure Data Lake Storage Gen2 数据流端点的高级设置。
az iot ops dataflow endpoint apply --resource-group <ResourceGroupName> --instance <AioInstanceName> --name <EndpointName> --config-file <ConfigFilePathAndName>
参数 --config-file
是包含资源属性的 JSON 配置文件的路径和文件名。
在此示例中,假定一个配置文件 adls-endpoint.json
,其中包含存储在用户主目录中的以下内容:
{
"endpointType": "DataLakeStorage",
"dataLakeStorageSettings": {
"authentication": {
"method": "SystemAssignedManagedIdentity",
"systemAssignedManagedIdentitySettings": {}
},
"batching": {
"latencySeconds": 100,
"maxMessages": 1000
},
"host": "https://<account>.blob.core.windows.net"
}
}
下面是一个示例命令,用于创建名为 adls-endpoint 的新 Azure Data Lake Storage Gen2 数据流终结点:
az iot ops dataflow endpoint apply --resource-group myResourceGroupName --instance myAioInstanceName --name adls-endpoint --config-file ~/adls-endpoint.json
dataLakeStorageSettings: {
batching: {
latencySeconds: 100
maxMessages: 1000
}
}
dataLakeStorageSettings:
batching:
latencySeconds: 100
maxMessages: 1000
后续步骤