@Avasilcai Adrian Thanks for reaching out. You need to leverage the event hub SDK to send the event to a particular partition. Unfortunately, there is no configuration in the event hub output binding that can send the message to single partition.
You can leverage the SDK to send the event as below. Please test it and update it as per your business need.
module.exports = function (context, myTimer) {
var timeStamp = new Date().toISOString();
context.log('Message created at: ', timeStamp);
const { EventHubProducerClient, EventData } = require("@azure/event-hubs");
const connectionString = "EVENT HUBS NAMESPACE CONNECTION STRING";
const eventHubName = "EVENT HUB NAME";
const producer = new EventHubProducerClient(connectionString, eventHubName);
const eventData = {
body: "Message created at: " + timeStamp,
partitionKey: "cities" // Set the partitionKey to "cities" to always send the message to the same partition
};
producer.send(eventData).then(() => {
context.log(`Message sent to partition ${producer.partitionId}`);
context.done();
}).catch((err) => {
context.log(`Error sending message: ${err}`);
context.done(err);
});
};