Aspnetcore.docs: How to publish Runtime Store IHostingStartup implementation assembly to Azure

Created on 2 Nov 2018  Â·  13Comments  Â·  Source: dotnet/AspNetCore.Docs

Hi,
One thing that doesn't seem to be addressed here is how to make a runtime store IHostingStartup assembly available when I publish the WebHost application to Azure.

Thanks.


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

PU Source - Docs.ms doc-enhancement

Most helpful comment

Runtime store and additional deps that we produce are part of site extension (https://azure.microsoft.com/en-us/blog/azure-web-sites-extensions/ and https://www.nuget.org/packages/Microsoft.AspNetCore.AzureAppServices.SiteExtension/). You can download and unpack it to see some implementation details.

There are docs on how to package site extensions here

All 13 comments

I presume you mean for a no-compile-time reference hosting startup, since a hosting startup published as a NuGet package with a compile-time reference is ok. My impression is that for a no-compile-time approach that one would need to use an installer. @pakrym, can u clarify?

@guardrex

I presume you mean for a no-compile-time reference hosting startup

Yes that is what I meant.

In the document, no-compile-time reference was deployed using the runtime store method. I don't know if there is any access to adding to the runtime store for Azure deployed Web Apps. I really hope so because the no-compile-time reference will really solve an issue for us.

Correct ... AFAIK, the approach requires an installer in the mix to take care of placing the hosting startup in the runtime store ✨ auto-magically ✨ for an end user (i.e., someone who won't be executing the dotnet store command on their machine).

... However, I defer to Pavel to tell us what's what.

mccoy

Damn it Jim! I'm a doc doctor, not a Microsoft engineer! - Dr. Leonard H. "Bones" McCoy (DeForest Kelley)
Star Trek, ©1966-69 Paramount Pictures

I think we had a mistake from the beginning. Dotnet store uses csproj as manifest, generating store items for package references in it without ever building or including csproj output. We have to have manifest as a separate csproj from hosting startup.

I'm going to fix things up.

I came here by googling "Azure IHostingStartup" because I had a similar (maybe the same?) question. I am just now ramping up on all the IHostingStartup but you never see Azure mentioned a single time in this whole page https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/platform-specific-configuration?view=aspnetcore-2.1&tabs=windows#runtime-store

@guardrex is there a way we could get some additional information on there? How would someone create their own little StartupDiagnostics "app enhancement" project and share it to a variety of Azure Web Services hosted apps?

I think ur asking about an approach that doesn't require a NuGet package ... I think you're ultimately asking about how to do it without a compile-time reference.

If so, the answer AFAIK would be that you would need to distribute an installer to get the hosting startup installed into the runtime store on each machine where the app will run.

Now .... let's ask a real engineer lol ... @pakrym Thoughts? ... and whatever the case may be, what should we cover (if anything) in the topic on this point?

[EDIT] Indeed ... it goes back to the OP on this issue. What do we need to cover? I don't have enough guidance yet to proceed ... if we are going to surface some info on this subject.

@guardrex I didn't know I could run an installer on Azure App Services like that. I always figured it was more of a PaaS option unless you did a Azure App Services Container deployment. Or maybe i am missing some feature of Kudu? Ill wait for Pavel's reply.

Yes, right. You're correct. The runtime store for an App Service app is part of the SDK _that they install_. I have NO knowledge on that aspect and no idea (yet!) on what the options are in that regard.

You could use a NuGet package. For a no-compile-time ref, we need @pakrym to tell us. I'll see what I can do on the topic when we hear back.

Runtime store and additional deps that we produce are part of site extension (https://azure.microsoft.com/en-us/blog/azure-web-sites-extensions/ and https://www.nuget.org/packages/Microsoft.AspNetCore.AzureAppServices.SiteExtension/). You can download and unpack it to see some implementation details.

There are docs on how to package site extensions here

_Ah! Very good!_ I'll look that over and enhance the topic from there.

Thanks a lot for clarifying. I see some of the NuGet assets here as well: https://github.com/aspnet/AspNetCore/tree/master/src/SiteExtensions/src/Microsoft.AspNetCore.AzureAppServices.SiteExtension but I admit i do not know enough on how we go from that source to a NuGet package with store folders and all.

Another thing I found odd @guardrex:

  • you show using PowerShell to modify env variables here.
  • But @pakrym shows modifying env variables from the SCM/Kudu site is as easy as doing it from the applicationHost.xdt here.

Why the difference? Maybe the applicationHost needs to be mentioned in the docs?

An aside: I wonder if your average companies using AAS will use SiteExtensions this way. It feels very hacky in a way. I guess because it does not seem discoverable? Maybe the applicationHost.xdt is a weird throwback to IIS + Web.Config transforms? In the blog post you linked by Elliott Hamai he shows essentially adding a new IIS Web Application to an IIS Web Site, virtual directory and all. I will say though, being able to easily enhance all running apps without needing to recompile is a pretty big perk.

found odd

I'll look at that when I get to the updates. In the non-Azure case (the topic today), I think it's ok to rely upon PS. Apparently, adding the site extension to an app adds the env vars. In the non-Azure case, there's no similar mechanism to set them, thus PS is the suggested approach.

WRT the site extensions, I've only used the preview runtime extensions. It will be interesting (and hopefully fun) to build one out for the topic sample and topic update. I hope to get to this fairly soon ... this sprint, if possible.

@pakrym Nevermind for a bit ... I didn't unpack the site extension to study it yet. That may clear up what's wrong with my current process/approach.

[EDIT] Yep! ... I see a few things that I did wrong earlier.

Was this page helpful?
0 / 5 - 0 ratings