简体   繁体   中英

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

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帐户

Creating a Function App:

在此处输入图片说明

When trigged using this code its ok.

在此处输入图片说明

Creating a CosmosDB output.

在此处输入图片说明

I change my code to this:

在此处输入图片说明

Now when I trigger by http the response is:

在此处输入图片说明

What am I doing wrong?

Grateful.

Someone has reported same issue . To conclude the solution: In portal> Platform features> App Service Editor. Right click on app_offline.htm and delete.

This file is generated to stop the function app when you install cosmosdb extension. It is supposed to be deleted automatically after extension being installed, there seems some problem with this feature, probably related to the slow file system in Consumption plan.

If you are trapped again later, try to turn this behavior off, add an SCM_CREATE_APP_OFFLINE App Setting to your app and set the value to 0 , check official announcement for this feature.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM