I'm attempting to do something very similar to what is being asked in this question except that I need access to the IAppBuilder instance during the startup process elsewhere in my code.
Using the solution in this answer does not appear to be possible, as the Owin context is not available during startup.
Can anyone offer an alternate approach?