Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a section on Blazor subdomain hosting #32568

Open
developer-sintmaartencampus opened this issue May 12, 2024 · 5 comments
Open

Add a section on Blazor subdomain hosting #32568

developer-sintmaartencampus opened this issue May 12, 2024 · 5 comments
Assignees

Comments

@developer-sintmaartencampus

Description

Can a Blazor Wasm application be deployed in a subdomain?

Currently we have a static website running on the main domain (like https://www.mywebsite.com/) and some different static websites running on subdomains, like intranet.mywebsite.com, admin.mywebsite.com, and so on.

The applications on the subdomain need to be gobbled up into one application, and it needs to become an interactive webapplication.

I have developed a blazor wasm application with an api (blazor server isn't possible because you need to be able to define a server farm, and the assets are not available for that), and the idea was to put it in on of the subdomains and run it.

It's not a subapplication (https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/iis/advanced?view=aspnetcore-8.0#sub-applications), and I have no access (they want to keep both seperated) to the static website anyway.

Area information are always refering to a blazor server application.

I have difficulty finding the appropriate information, and I'm not even sure if it is possible anyway.

The application will be deployed on IIS and windows server.

Am I just confusing subapplications and subdomains? Should I just consider it as a an ordinary deployment, with some additional configuration for route mapping?

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/host-and-deploy/?view=aspnetcore-8.0&tabs=visual-studio

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/host-and-deploy/index.md

Document ID

c82cf121-831d-75dd-a796-c735aad3b3e9

Article author

@guardrex

Copy link
Contributor

🕺💃 Happy Cinco de Mayo! 🥳🎈

A green dinosaur 🦖 will be along shortly to assist. Stand-by ........

@guardrex
Copy link
Collaborator

guardrex commented May 13, 2024

Hello @developer-sintmaartencampus ...

Am I just confusing subapplications and subdomains? Should I just consider it as a an ordinary deployment, with some additional configuration for route mapping?

It sounds like it, yes. You shouldn't need to do anything in the app layer for subdomain hosting. It should be an ordinary deployment of the app. The configuration should be entirely in IIS.

Let's take the following course of action ...

  • Try to configure your IIS for normal subdomain hosting (and I'm sure there's an IIS doc out there in the MS ether on that). Deploy your WASM app.
  • If you run into trouble, ping me back on this issue. I'll give it shot here (via an Azure VM), and I'll report back later†.
  • Either way, let's leave this issue open for work later† to add a new section to the Host and deploy main doc saying that (hopefully 🤞🍀) a vanilla IIS subdomain config works fine. This issue will automatically close when the PR merges later†.

later ... I'm tied up for several weeks at the moment. I won't be able to reach this issue until probably early June. In the meantime for faster assistance, you can hit up the community on the usual public support channels. We recommend ...

... and note ...

Subdomain hosting doesn't change the app base path of the app. That's why the app shouldn't require any special configuration. It should ✨ Just Work!™ ✨.

When an app is hosted as a sub-application, then the app base path IS CHANGED ... and then, yes, you would need to follow our app base path and link guidance in the app layer to handle it.

From what you're saying, I gather that you're just looking for subdomain hosting, so that's not a concern. The app should work fine without any special config for a garden-variety subdomain scenario AFAIK.

Let me know if you have trouble, and I'll try to carve out some time to look. It's just that I'm kind'a buried in work ⛰️⛏️😅 until early June, which is why I'm suggesting that perhaps you should hit up the community first for help ... then the 🦖.

@guardrex guardrex changed the title subapplication versus subdomain Add a section on Blazor subdomain hosting May 13, 2024
@developer-sintmaartencampus
Copy link
Author

Yes you're right (... I'm conflating things). I've failed to deploy my app, but I than just deployed the sample standalone counter app on the subdomain, just like an ordinary deployment as you mentioned, and it worked.

For any noobs in the future who might ask themselves this same question, here's the bottomline:

Basically there is no difference between deploying a stand-alone-app to a main domain or to a subdomain as far as I can figure out. (see SO 78468366)

My current approach is, try now to get the api deployed (that the wasm would call on), and than try again.

@developer-sintmaartencampus
Copy link
Author

I do find some conflicting info about dependencies, between the api and the wasm project. To me it seems logical there shouldn't be any, but than you need to deploy the api and the wasm seperately.

@guardrex
Copy link
Collaborator

guardrex commented May 13, 2024

I do find some conflicting info about dependencies, between the api and the wasm project. To me it seems logical there shouldn't be any, but than you need to deploy the api and the wasm seperately.

That's correct. They're separate apps (projects), and they're deployed separately. There are no shared project dependencies (project references) between the WASM project and the API project.

I'll use this issue to track adding a new section on this subject ... subdomain hosting. I'll reach this as soon as I can, but it will be no sooner than June 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: P2 - Medium Priority
Development

No branches or pull requests

3 participants