我正在尝试使用事件中心的捕获功能将数据存储在启用了Data Lake Storage Gen2的存储帐户v2中。 在门户中,选择“存储帐户”后,不会显示容器,因此我无法创建新的容器。 在Azure CLI中,我运行了以下命令:
az eventhubs eventhub update -n hubtest --namespace-name #removed# -g #removed# --enable-capture True --capture-interval 300 --capture-size-limit 262144000 --storage-account #removed# --blob-container #removed# --destination-name capturetest
我收到以下错误:
'NoneType' object has no attribute 'enabled'
Traceback (most recent call last):File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in execute raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 386, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 379, in _run_job six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 356, in _run_job result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 171, in __call__ return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/arm.py", line 477, in handler instance = custom_function(instance=instance, **custom_func_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/eventhubs/custom.py", line 112, in cli_eheventhub_update instance.capture_description.enabled = enabled
AttributeError: 'NoneType' object has no attribute 'enabled'
答案 0 :(得分:1)
我可以重现您的问题,似乎不支持通过Data Lake Gen2启用Azure Event Hubs Capture,请记住Data Lake Gen2处于预览状态。
答案 1 :(得分:0)
只要您首先使用Data Lake Storage Gen2创建了您的 Azure 存储帐户 - 请参阅下面门户中的图片:
[在存储帐户上启用 Data Lake Storage Gen2] https://i.stack.imgur.com/J55kC.png
然后,您可以仅使用“Azure 存储”作为捕获提供程序并继续选择存储帐户容器 - 请参阅以下门户中的图像: 【存储账号选择】 https://i.stack.imgur.com/FhI1x.png
注意* 如果您尚未配置容器,则系统会要求您在选择过程步骤中进行配置。
我知道一个老问题,但我今天需要这样做。希望它有所帮助。
参考资料: https://docs.microsoft.com/en-us/azure/event-hubs/event-hubs-capture-enable-through-portal