This project has moved and is read-only. For the latest updates, please go here.

Owin startup and Azure WebRole question

Apr 23, 2014 at 12:37 PM
Edited Apr 23, 2014 at 1:08 PM

I use owin to host WebApi in a WebRole (IIS).
Actually Owin is started by a magical Attribute marked in the assembly, something as:
[assembly: OwinStartup(typeof(MyWebRole.Startup))]

This startup class is doing my Autofac config and webApi config.

But I am also using a WebRole.cs class called by Azure to make some initializations and to trap Environment changes.
I would appreciate to be able to initialize the WebAPI Trace level from the webRole.cs OnStart method as I am doing for all the other tracing engines I am using.

But to do this I need to have Web API configured and so to have Owin started.

Is it possible to override the Owin startup Attribute with a direct start from the webrole.cs as I do when Owin is Self hosted in an Azure Worker role ?
Apr 24, 2014 at 12:06 AM
You might be able to do this using the handler instead of the module. See You'll want to disable the module auto-startup.