Problem using Azure Functions and Azure Cosmos DB, returning "down for maintenance"

时间:2018-12-19 11:16:24

标签: node.js azure cloud azure-functions azure-cosmosdb

I am following this tutorial that creates an Azure Function trigged by http with output to CosmosDB.

https://docs.microsoft.com/en-us/azure/azure-functions/functions-integrate-store-unstructured-data-cosmosdb

When I create just a simple Azure function it works ok, I trigge by http and the http response its ok.

But if create a new output to a ComosDB using the example code indicated in the tutorial the function returns "THIS AZURE FUNCTIONS APP IS DOWN FOR MAINTENANCE" when trigged.

Please be patience, until last week I was just a c++ programmer hahaha.

My steps:

Creating a CosmosDB account and a database called "testDb".

CosmosDB account

Creating a Function App:

enter image description here

When trigged using this code its ok.

enter image description here

Creating a CosmosDB output.

enter image description here

I change my code to this:

enter image description here

Now when I trigger by http the response is:

enter image description here

What am I doing wrong?

Grateful.

1 个答案:

答案 0 :(得分:3)

有人报告了相同的issue。总结解决方案:在门户>平台功能> App Service编辑器中。右键单击protected void onSignalReceived(Session session, String type, String data, Connection connection) { String myConnectionId = session.getConnection().getConnectionId(); if (connection != null && connection.getConnectionId().equals(myConnectionId)) { // Signal received from another client } 并删除。

在安装cosmosdb扩展名时,将生成此文件以停止功能应用程序。它应该在安装扩展名后自动删除,此功能似乎存在一些问题,可能与使用计划中的文件系统速度慢有关。

如果以后再次被困,请尝试关闭此行为,在您的应用中添加一个app_offline.htm应用设置,并将其值设置为SCM_CREATE_APP_OFFLINE,选中official announcement以获得该功能。