In my organization, there is a process where in for every new website/application to be added into the IIS, we have to go through a 6 weeks complex process and waiting. Even after the process completes the team will not have access to IIS. We can only deploy the build files using TFS, web deploy etc.
I have initiated the process for my first application/site in the IIS. I wanted to know if there is a way I can avoid future request/process for new application, by making this upcoming application an application of applications :). Something like child applications. But remember I do not have IIS access. I still have access to my application's web config. I also have the freedom to manage URL structures/patterns.
Either by using multiple routes, multiple projects etc. Just thinking loud. My applications will be of type web api, mvc etc
Any crazy ideas? Thanks in advance.
You can have several application roots in IIS, which can be virtual or real directories, under the same site.
Those separate applications will have separate configs and will not inherit each other's settings.
You can access your apps under the same domain, or to be configured to use different domains
http://www.domain.com/app1, http://www.domain.com/app2
They can share the same app pool or be configured to use different.
Since you don't have an access to IIS, I'm not sure how would you configure the app pool or domain, but perhaps Microsoft.Web.Administration namespace will help doing this from code. It contains managed classes to manage all aspects of IIS, including the configuration . It can be used from .Net or from PowerShell.
Creating Sites and Virtual Directories Using System.DirectoryServices
Using IIS Programmatic Administration
Related
We are developing an online CRM Saas product in .Net Framework. Now we want to provide this service to anyone.
Any user wants to use or try our service they just need to put a few basic details and click on Sign up.
There is one best example of my above statement is confluence, as soon as I sign up with some site name my confluence portal is stared.
https://www.atlassian.com/try/cloud/signup?bundle=confluence
Now how to do the same in Azure, I have only files and folder of my application. How to create separate websites for multiple users with a single domain name. If I programmatically created multiple azure apps using Azure ARM then it becomes very difficult to maintain our product. How to do achieve this functionality.
To host multiple apps under a single domain, if you’re leveraging Azure Web App and deploy your web applications to each virtual directory with the name which could identify your web application.
You could keep your web sites in separate projects and use the ‘virtual directories and applications’ settings in Azure to publish the two different projects under the same site.
Go to WebApp -> Settings -> Application Settings -> Virtual applications and directories.
In Web Apps, each site and its child applications run in the same application pool. If your site has multiple child applications utilizing multiple application pools, consolidate them to a single application pool with common settings or migrate each application to a separate web app.
You may want to check the blog post Deploying multiple virtual directories to a single Azure Website for more details.
Also, you could also use Application Gateway infront of your app since you can do path based routing with app gateway i.e testing.com/one points to one web app and testing.com/another points to the other app. You could start out with the example below the modify the back end to use path-based routing. Kindly refer the links below one that covers the basics of configuring the App Gateway with a WebApp and one discussing path based routing:
https://blogs.msdn.microsoft.com/waws/2017/11/21/setting-up-application-gateway-with-an-app-service-that-uses-azure-active-directory-authentication/
https://learn.microsoft.com/en-us/azure/application-gateway/application-gateway-create-url-route-portal#create-a-path-based-routing-rule
I have just begin using ASP.Net Web application in Visual Studio. What I want to know is that I have two web pages namely index1.aspx and index2.aspx. I want to host them separately using different port numbers in local host on the iis server. I know site binding is used in these cases but not sure how to go about it.
What is the best way to do this? I want them to run simultaneously and communicate between each other.
In IIS there is something called Virtual directory. You can create two web applications in IIS and make both pointing to same physical location on your system.
You can also update settings of each web application to have different index pages. i.e. web app1 shall use Index1.aspx as index page, and web app 2 shall use Index2.aspx.
Virtual directories are so cool, you can use the same code base for multiple tenants. All we have to create is new web apps or sites in IIS.
So I solved it like this:
I created two projects WebApp1 and WebApp2 in the same Solution.
Right Click on Solution Explorer--> Properties--->Select the radio button with Multiple Startup projects.
Also make sure The Action of atleast one of the projects is set to Start only . The rest can be Start Without Debugging.
To connect IIS to your web application say webapp1:
Reference this video:
https://www.youtube.com/watch?v=IwbKquNBNgQ
Hope this helps anyone who is trying this out.
I'm building a site for SaaS.
I'd like to distinguish sites by Domain name to use same contoller.
The reason why I want to make multiple IIS Application is, There are tons of HttpContext.Current.Application in Application_Start() and OnActionExecuting(). And It should be isolated by domains.
My questions are :
Is there any solution for multiple IIS Application using same C# MVC controllers?
If not, Is there other container instead of HttpContext.Current.Application?
Or, Is there other solution that is more elegant, efficient, or effective?
What I tried for creating multiple IIS Application are :
Setting same path.
Set only bin directory to same path as virtual directory
However, Nothing works.
I Hope this is helpful
Windows Server 2012 / IIS 8.5
VS 2013 / C# MVC5 / .Net Framework v4.5.0
Thank you.
Is there any solution for multiple IIS Application using same C# MVC controllers?
Yes.
IIS7 - How do I use the same physical path for different domains?
Can I configure IIS to use the same physical path for different sites but use custom web.config
If not, Is there other container instead of HttpContext.Current.Application?
Or, Is there other solution that is more elegant, efficient, or effective?
It is possible to have multiple domains pointed to a single web application. For more information take a look at IIS Bindings
So my company has an ASP.NET web app, targeting .NET 3.5. I am tasked with building a ticketing system for them. I don't really need to use any resources of the company app, except for authentication. I would like to target .NET 4.0 and use the 4.0 goodies like entity framework and mvc 3.0. If I create an application targeting .net 4 nested within the main web app in IIS, is there a way to persist authentication so they do not require a different session within the 4.0 web app?
Please let me know if I am being unclear.
Thank you.
If you use membership authentication you can share sessions between different web applications provided the following is true:
All of them share the same machine
key - you can set the machineKey
explicitly in each web.config to the
same value.
You are using the same
authentication cookie name (i.e.
.ASPXAUTH by default)
There might be other ways, but this is how I got it to work.
Also see this article for reference: Forms Authentication Across Applications
If the subfolder in the main IIS application is not an application itself, it will be loaded into the AppDomain of the parent IIS application, and this would ensure that session state is shared between the applications. If it is its own IIS application, it will have its own AppDomain and be a separate running application.
If it shares the same AppDomain as the parent IIS application, you have to be careful of where you deploy your binaries. If you do not add in a private bin path for assembly resolution, all assemblies must be located in the root /bin. But this has the additional risk of the main app looking for assemblies in your additional subfolder where it shouldn't be looking.
Currently applications are deployed only to my office of 40 employees or so. ClickOnce works great for this as everyone has network access or VPN access which makes updating pretty straightforward. Now, it has been tasked to me to figure out the best way to deploy these applications to res of the company. ClickOnce would work but the files would be made publicly available to any.
What would be the easiest way to implement this feature with some form of authentication?
The actual deploy page can be set up on a site that requires Windows Authentication. As long as the domain controller you are using trusts the other domain controllers, you are golden. You might be able to do this at the folder level, as well. If you go this route, you can still use the click once model.
There are a few more ideas here:
http://tinyurl.com/bn5e76