是否有任何解决方法可以使用代码在私人频道上创建、更新和删除对话?
botframework microsoft-teams microsoft-graph-teams microsoft-graph-api
Below is the code that I have:
List<PatchOperation> patchOperations = new List<PatchOperation>();
patchOperations.Add(PatchOperation.Replace("/endpointId", 100));
string id = "id1";
PartitionKey partitionKey = new PartitionKey("partitionkey1");
await _container.PatchItemAsync<Watermark>(id,
partitionKey,
patchOperations);
Run Code Online (Sandbox Code Playgroud)
I am expecting to get endpointId property to be replaced with 100.
但是,我面临着 Message: {"Errors":["One of the specified inputs is invalid"]}。
我可以检查一下我缺少哪一部分吗?或者我是否必须等待为我的 Cosmos 数据库启用补丁私人预览功能?
参考官方文档
如果在 Azure 中运行时不存在此应用程序设置,则假定环境为生产环境。
即使在覆盖AZURE_FUNCTIONS_ENVIRONMENT并ASPNETCORE_ENVIRONMENT进入生产之后,我仍然在 Azure 中进行开发。
我的 Azure Function 是在 Windows 环境上运行的无服务器消费计划,运行时版本 ~3。
我按照文档在 manifest.json 中添加了 webApplicationInfo 以包含 RSC 权限。但是,当消息中没有提到机器人时,我仍然没有收到任何消息活动。
"webApplicationInfo": {
"id": "<i have updated app id here>",
"resource": "https://AnyString",
"applicationPermissions": [
"ChannelMessage.Read.Group"
]
}
Run Code Online (Sandbox Code Playgroud)
下面是我回显消息的代码:
protected override async Task OnMessageActivityAsync(ITurnContext<IMessageActivity> turnContext, CancellationToken cancellationToken)
{
await turnContext.SendActivityAsync(MessageFactory.Text($"Echo: {turnContext.Activity.Text}"), cancellationToken);
}
Run Code Online (Sandbox Code Playgroud)
我已经检查了 permissionGrant restful API(https://graph.microsoft.com/v1.0/groups/ { groupid }/ permissionGrants ),它包括“ChannelMessage.Read.Group”
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#permissionGrants",
"value": [
{
"id": "<id ....>",
"deletedDateTime": null,
"clientId": "<client id ...>",
"clientAppId": "<client app id ...>",
"resourceAppId": "<resource app id ...>",
"permissionType": "Application",
"permission": "ChannelMessage.Read.Group"
} …Run Code Online (Sandbox Code Playgroud)