ConnectionStringSetting必須是設置的名稱,而不是值。 For example: public static async Task Run( [CosmosDBTrigger( databaseName: "blabla_Database", collectionName: "blabla_Container", ConnectionStringSetting = "myCosmosDBConnection", LeaseCollectionName = "leases", LeaseCollectionPrefix = "trigger", CreateLeaseCollectionIfNotExists = true )] string input, FunctionContext executionContext ) 在settings.json文件中: { "Values": { "AzureWebJobsStorage": "UseDevelopmentStorage=true", "FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated", "FUNCTIONS_WORKER_RUNTIME_VERSION": "~4", "myCosmosDBConnection": "AccountEndpoint=https:/