Thanks for asking question! An extension is basically a web app that runs alongside the regular application and is available in SCM. You may refer to blog for Writing a Site Extension for Azure Websites
If I am understanding right you wants to intercept the pipeline which requires an HttpModule injected into the processing path. This is not an extension.
Adding some information below might be helpful:
This is for ASP.Net on .Net framework.
Overview of HttpModules: IIS Modules Overview | Microsoft Learn
Injecting an HttpModule into the pipeline on Azure: Migrating a static web site using custom HTTP modules to Azure App Service
Sample code for HttpModule: Implement Custom HttpHandler And Custom HttpModule
ASP.Net Core uses middleware. Middleware is injected into the pipeline in the Configure code of the application.
How to migrate HTTP Module to .Net Core: Migrate HTTP handlers and modules to ASP.NET Core middleware
Also, If you could share what is your platform and what is the end goal to this, to help you better on this.
Disclaimer: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you.