使用documentdb nodejs客户端删除用户定义函数时出现401错误

时间:2017-07-19 01:56:15

标签: node.js azure-cosmosdb

我能够成功拨打readStoredProcedure,但使用相同的链接,而不是deleteUserDefinedFunction ---我尝试了链接的变体(_self,或使用{生成Uri {1}})---再次,它们都与read和execute一起工作,但用于删除。

的完整错误消息
UriFactory.createStoredProcedureUri

我查看了源代码,两个函数(读取和删除)似乎以相同的方式使用路径。

我知道DocumentDB - DELETE causes 401 error这个问题,但它是针对文档删除问题的,而且似乎没有解决我遇到的UDF问题

可能有人知道发生了什么?

非常感谢!

以下是我将其称为仅供参考的方式:

The input authorization token can't serve the request. Please check that the expected payload is built as per the protocol, and check the key being used. Server used the following payload to sign:...

请注意,我已将let sprocUri = documentdb.UriFactory.createStoredProcedureUri(DATABASEID,COLLECTIONID, name); console.log("sprcURI", sprocUri); client.readStoredProcedure(sprocUri, function(err, response) { if (err) { console.log("bad", JSON.stringify(err)); } else { console.log(`Succes for temporal queries: ${JSON.stringify(response)}`); client.deleteUserDefinedFunction(sprocUri, ResponseLoggingWrapper("DELETE sproc " + name)); } }); 的第二次使用替换为sprocUri,但无济于事。

另请注意,我使用的是存储过程,但它与行为方面的UDF大致相同

1 个答案:

答案 0 :(得分:1)

您需要使用deleteStoredProcedure函数删除存储过程。

  

enter image description here

相关问题