将Azure QnA bot部署到Azure环境后的问题

我有bot代码(node.js),可以通过压缩并拖放到https://test.scm.azurewebsites.net/ZipDeployUI中来部署为azure,我们的本地计算机中有python文件和flask,在我使用模拟器进行测试之前,它可以正常工作,现在部署到Azure中并在Web Chat中对其进行测试后,本地主机flask API无法正常工作。 请帮助我如何从Azure bot传达flask API

错误消息: 从源'https://botservice.hosting.portal.azure.net/botservice/api/Telemetry'处对'https://portal.azure.com'处XMLHttpRequest的访问已被CORS策略阻止:对预检请求的响应未通过访问控制检查:它没有HTTP正常状态。

从原点“ https://botservice.hosting.portal.azure.net/botservice/api/ClientTrace”到“ https://portal.azure.com”的XMLHttpRequest的访问已被CORS策略阻止:对预检请求的响应未通过访问控制检查:它没有HTTP正常状态。

在CORS中: In App Service i have given * and removed all other origins

错误: These are the errors i am getting

lzh050925 回答:将Azure QnA bot部署到Azure环境后的问题

您需要确保azure门户>您的资源组>您的应用程序服务>设置> CORS看起来像这样:

enter image description here

请按照以下文档部署Bot:

https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-tutorial-basic-deploy?view=azure-bot-service-4.0&tabs=csharp

也请检查此内容以获取其他参考:

We are getting CORS issue in Azure WebAPP still i have allowed all origin as "*"

希望有帮助。

本文链接:https://www.f2er.com/3153793.html

大家都在问