Цель состоит в том, чтобы записать данные в topi c в Azure, но я получаю следующую ошибку:
Ошибка функции 'PostBooking': Тип привязки (s) ) 'eventGrid' не зарегистрированы. Убедитесь, что тип указан правильно и расширение привязки установлено.
Я разрабатываю это локально.
index. js
module.exports = async function (context, req) {
let booking = req.body;
var timeStamp = new Date().toISOString();
context.bindings.bookings = booking;
context.bindings.outputEvent = {
id: 'message-id'+timeStamp,
subject: 'Booking',
dataVersion: '1.0',
eventType: 'event-type',
data: booking,
eventTime: timeStamp
};
context.res = {
status: 201,
headers: {
"content-type": "application/json"
},
body: {
message: booking.id
}
}
context.done();
}
функция. js
{
"disabled": false,
"bindings": [
{
"authLevel": "function",
"type": "httpTrigger",
"direction": "in",
"name": "req",
"methods": [
"post"
],
"route": "bookings/"
},
{
"name": "outputEvent",
"type": "eventGrid",
"topicEndpointUri": "{hidden}",
"topicKeySetting": "{hidden}",
"direction": "out"
},
{
"name": "bookings",
"type": "cosmosDB",
"direction": "out",
"databaseName": "{hidden}",
"collectionName": "bookings",
"createIfNotExists": true,
"connectionStringSetting": "CosmosDB"
},
{
"type": "http",
"direction": "out",
"name": "res"
}
]
}
сообщение об ошибке ![enter image description here](https://i.stack.imgur.com/6t5tw.png)
Я не знаю, что делать?