I have a web app that has a virtual web app within it in IIS. The site map exists in the parent web app and want to have certain nodes route to the virtual app views.
I tried to define custom routes in the parent web global.asax but the provider seems to append the route to every node by default even if the node has no route configured. What's the appropriate way to use custom routes, or route to my scenario with MvcSiteMapProvider?
Did you take a look at this :
https://github.com/maartenba/MvcSiteMapProvider/wiki/Dynamic-sitemaps
When creating the dynamic nodes can specify the Action and Controllers - see if that works for the two different links..
Related
I successfully created the Azure Container App named my-app-name to host the Python Flask App.
The hostname for my app uses FQDN, so it looks like my-app-name.grayocean-1r2fd430h.centralus.azurecontainerapps.io.
I would like the hostname to be more user-friendly, for example my-app-name.azurecontainerapps.io (similar to the App Service, where it's named my-app-name.azurewebsites.net by default)
What should I do to make my custom hostname point to the Container App?
Unlike app service, in container apps there is a concept of an environment that groups all your apps that might need to communicate together whether it's for microservices or other designs you might have. the grayocean-1r2fd430h.centralus part is the unique part for your particular environment in this case.
However, From Container Apps you have 2 options here to give your app a custom domain:
1- You can use a different suffix for all the apps on your environment. i.e: replacing .grayocean-1r2fd430h.centralus.azurecontainerapps.io with some domain you might have, like .cornisto.io for example See https://learn.microsoft.com/en-us/azure/container-apps/environment-custom-dns-suffix for how to configure that.
2- You can assign custom domains per container app where each application can have its own set of custom domains that route to it. See this doc for how to set that up https://learn.microsoft.com/en-us/azure/container-apps/custom-domains-certificates
You could also use a service like Azure Front Door or API Management to proxy traffic to your application and the configuration of a custom domain would be on that end instead.
I would to host two ASP.NET Core Applications, a Web API and a Blazor Server App, but I searched in the internet and the answers that I founded only target to a different path inside of one application, that's not my case. I would to use they like a sub-address of the same Azure Web App for example: www.example.com and www.example.com/api where each one will be a different .NET Core application. So I suspect that I'll need to create two Azure App Services and try to communicate they both, but maybe the structured that I wonder won't work in this way, it's that right? How I can do this?
I have the same setup as you; an ASP.NET Core web API, and a Blazor Server Side app.
As you want to use the same domain for both services, you would have to use Azure API Management or some other proxy if you were to route requests to two different Azure App Services.
An easier option is to deploy both services to the same App Service, but as different virtual applications. You publish your Blazor app as normal, but for the Web API you would publish to a new virtual application /api.
To enable this virtual application, navigate to Configuration and then Path mappings in your App Service. Here you already have the default virtual application / pointing to site\wwwroot. You then add another virtual application named /api pointing to site\wwwroot\api:
When adding the virtual application, remember to remove checkbox for Directory (making it a virtual application instead), and optionally enable Preload:
If you publish your app using Azure DevOps Pipeline, it has an option to specify virtual application if another than default should be used.
You can now navigate to your two different URLs and hit each service. Note that when developing your Web API, you should not add api to your controllers routes, as this virtual application does that for you.
I have 2 domains I want to use with one web app. I want all traffic to be routed via the app gateway.
I have set up 2 example domains www.myfirstdomain.com www.mysecondomain.com
I have verified these websites in my azure web app and added each hostname to the web app.
I have created virtual directories in the web app as follows
/one -> site\wwwroot\one
/two -> site\wwwroot\two
When I type in www.www.myfirstdomain.com I want this to go to the /one directory when I type in www.myseconddomain.com I want this to go the /two directory
Does the app gateway need to have multi site listeners and path based rules, is only one backendpool required?
In Azure the concept of a web server is the underlying App Service Plan, on top of that each virtual directory is a web app. You can have multiple web apps per Service Plan. So the usual solution is to have a separate web app for each distinct website you have. You can attach multiple domain names to each app, but they will all point to the same code.
I have a web application that has frontend (React) and backend(Express) separately, so in my local environment, frontend is running on localhost:8080 while backend is running on localhost:3000.
I could deploy backend server to App Engine running on https://[app_name].appspot.com.
and then I also deployed frontend to Google Cloud Storage by referencing this. However, the frontend application is also running on https://[app_name].appspot.com.
When I open the app, it is showing frontend but api call is not working.
I do not have custom domain yet, and I am also using postgresql.
Is there any way to set different url for frontend and backend? or Am I doing something wrong in the structure to set an application?
Mapping to a domain name (either the default appspot.com one or a custom one) is done at the application level, not at the service level. Your both services, being part of the same app, would thus be mapped to the same domain.
Side note here: I assume you chose different service/module names for your services (in the respective .yaml files), otherwise they overwrite each-other at deployment time.
Routing a request to one service or another is done based on pattern matching on the filepath portion in the URL, not on the host/domain portion. First match wins and no match always goes to the default service.
Because of this typically the frontent is the default service (you can also leave it unnamed). An any other, more dedicated service, have an identifying pattern in their URL path which is used for routing with a dispatch.yaml file. In your case, for example, the backend service would be the specialized one and could serve, let's say, URLs starting with /backend/, thus could have a dispatch.file like this:
dispatch:
- url: "*/backend/*"
module: <backend-service-name>
More or less related:
Configuring two services on the same domain in dispatch.yaml
GCP Point Custom Domain to Specific App Engine Service
Running multiple services using dev_appserver.py on different ports
Note: You have to account for the specific pattern inside the specialized services as well. If, for example, your backend service currently serves a request for /index.html you'll have to adjust it to serve /backend/index.html instead.
It might be possible to make both services work side by side without a dispatch file, using other routing methods (see the entire How Requests are Routed section), but IMHO it's more difficult to set up and more fragile. Especially when trying to also use custom domains.
I have 2 ASP.NET core projects, first one lets call it Test which contains angular SPA, and the second one Test.API which exposes a RESTfull API to the angular app, now i'm deploying 2 apps to Azure web apps under custom domain.
Test is: www.mydomain.com
Test.API is api.mydomain.com
My problems is that any call from my angular app causing an additional OPTIONS request (delay) that i want to eliminate, by rewriting request (Not redirect) that points to api.mydomain.com/* to www.mydomain.com/api/*.
And also keeping 2 different web apps.
Tried to use asp.net - IIS URL Rewrite module but without any luck, can someone provide me with working example or suggest other way to accomplish this.
Please try to use Azure Web App Virtual Directory. Refer to this article to know how to deploy multiple virtual directories to a single Azure Website. Please try to deploy Test web app to the root project, and deploy Test.API to the virtual directory. After this, we can use www.mydomain.com to access the root web app, use www.mydomain.com/api to access the web app existed in virtual directory.