Synapse LINK从Azure Cosmos DB容器加载流式DataFrame

问题描述

我正在尝试在突触上使用Feed更改,我正在使用突触链接来连接到宇宙,

dfStream = spark.readStream\
    .format("cosmos.oltp")\
    .option("spark.synapse.linkedService","<enter linked service name>")\
    .option("spark.cosmos.container","<enter container name>")\
    .option("spark.cosmos.changeFeed.readEnabled","true")\
    .option("spark.cosmos.changeFeed.startFromTheBeginning","true")\
    .option("spark.cosmos.changeFeed.checkpointLocation","/localReadCheckpointFolder")\
    .option("spark.cosmos.changeFeed.queryName","streamQuery")\
    .load()

但是我收到以下错误

错误:org.apache.hadoop.fs.azurebfs.contracts.exceptions.AbfsRestOperationException:操作失败:“此请求无权使用此权限执行此操作。”,403,DELETE,https://adlsgarage7.dfs.core.windows.net/adlsgarage7/localReadCheckpointFolder/streamQuery

解决方法

您需要具有访问权限,才能以创建者的身份访问已在创建时连接到工作区的Data Lake Account的容器。您需要 Blob存储贡献者对帐户adlsgarage7或至少容器adlsgarage7的ARM访问权限。

您还应该确保写下连接到的链接服务和容器的名称。