Unknown's avatar

Posts by Simon Doy

I am an avid SharePoint enthusiast who works as an Independent SharePoint Consultant based in Leeds, United Kingdom. I am one of the organisers of the Yorkshire SharePoint User Group in the United Kingdom. I have been designing and building SharePoint solutions since 2006.

A way to manually kick a Azure Function Timer Trigger Function when its been deployed


Introduction

At iThink 365 we have been building a few products around the Microsoft 365 Employee Experience. These products need to refresh information about the employees and so this is done using Azure Functions as Timer Trigger functions.

Something like this

Last week, I was chatting with one of my team and I showed them how they could manually kick off the timer trigger function. They exclaimed, “Woah, I had no idea you could do that!” I asked some more of the team and they said the same thing. So, I hope you have not either.

One of the attributes on the Timer Trigger is the RunOnStartup flag and it is important and seen as one of the best practices of Azure Functions to make sure that these are switched off,. This ensures that you don’t get your Azure Function firing randomly.

However, when developers are working on these Timer Triggers you want the Timer Trigger to run as soon as you start debugging the code. Having the RunOnStartUp flag off is a pain and often they get left on so that the code runs on startup. We do not want that behaviour where the flag gets left on.

Another scenario that you want to kick off the Timer Trigger is when a new customer joins and you want their user estate to be processed as soon as they subscribe to your product.

So, we need to be able to kick off the Timer Trigger function somehow.

How do we manually kick off a Timer Trigger function?

Solution

Well, it turns out you can call the Azure Function with a special endpoint and it is this one.

Using the URL:

https://%5Byour azure function url]/admin/functions/[YourAzureFunctionTimerTriggerFunctionName]

For our timer job above it would be like this:

https://doyfunction.azurewebsites.net/admin/functions/RefreshNewStartersCachesFunction

You can kick off the Timer Job, you also need either the master key or the function key from your Azure Function.

This can be retrieved by:

  • Browse to the Azure Portal (https://portal.azure.com)
  • Find your Azure Function
  • Click on App Keys under Functions
  • Copy the master key

Once we have the Azure Function function/master key, we need to call the endpoint. To do that we:

  • Using Postman
  • Create a request
  • Change the HTTP verb from GET to POST
  • Use your URL for your Trigger Function
  • Add a new header called
    • x-functions-key
  • use the function or master key as the value.
  • Click Send
  • You will receive an Accepted 202 response back if the request was successful.

That is it your timer job will have started.

An example is here:

If you receive an HTTP 404, and you are using an Application Setting to define your Timer Trigger schedule then check you have a valid value for the Application Setting in your configuration.

Hope you find this useful!

Finding that file that you remember that someone shared with you once upon a time in Microsoft 365


Introduction

I was chatting with one of our customers last week and they said how annoying it was that they could never find files that people have shared with them. They talked about how they could not remember when it was and searched through their emails, searched through SharePoint but could not remember the file name and so could not find the file.

Well, I tell you what when I showed him a little feature in Microsoft Onedrive he was suddenly much happier!

Tip

So, if you want to see files that have been shared with you and also files that you have shared with someone then check out this tip.

  • Click Shared
  • Click on With You to see files that have been shared by others with you.
  • Click on By You to see files that have been shared by you to others.
A screenshot showing Microsoft One Drive in Microsoft 365 to see the files that have been shared with you and by you.

The By You feature is great if you wish to stop sharing a file with others.

To stop sharing:

– hover over the file that you wish to stop sharing,

– click the … and choose the manage access option.

  • Click on Stop Sharing button.

Hope that helps.