azure-data-lake - 启用 Data Lake Gen2 的 Azure 事件中心捕获到存储
问题描述
我正在尝试使用事件中心的捕获功能存储在启用了 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'
解决方案
只要您首先使用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
推荐阅读
- visual-studio-code - Visual Studio Code 转到下一个错误或警告,但不转到信息
- json - 快速解析对 JSON 的 API 响应
- reactjs - ReactJS - 禁用引导库依赖
- c++ - 如何在 Windows 上使用 C++ 在现有浏览器窗口中打开 URL
- icecast - IceCast 当前播放不更新,当使用 % 符号时
- angular - 更新后 Angular 8 订阅触发
- java - 不使用框架管理 DI 对象
- vfs - 如何在块设备层考虑 VFS 操作?
- angular - Angular:如何用实时 api 替换硬编码对象?
- c# - 为什么 AES 加密的结果在使用 C# 和使用 OpenSSL C++ 之间存在巨大差异?