Jun 15 2024 05:15 PM
Hello,
In an Azure Function with an HTTP Trigger, is there a way to limit the triggering of the function to requests coming only from a specific SharePoint site? For example, I have a SharePoint site with a clickable link that contains the URL of the Azure Function, and I'd like the function to be triggered only if the link is clicked from the SharePoint site. If someone copies and pastes the URL of the function and the browser directly, it should not work.
Thanks in advance for your help with this.
Jul 01 2024 12:07 AM
Jul 01 2024 11:04 PM
you can use the EventGrid Function as below:
BinaryData events = await BinaryData.FromStreamAsync(req.Body);
EventGridEvent[] eventGridEvents = EventGridEvent.ParseMany(events);
var details = JsonConvert.DeserializeObject<add your class>(eventGridEvents.First().Data.ToString());
if (details .source != "SharePoint"){
// Perform
}
// do nothing