How to deploy a single multi tenant MVC application to multiple Azure virtual directories - asp.net-mvc

I have a single MVC.net web project that will be deployed for multiple customers
The code base and database structure is identical for each customer however on deployment, different CSS and images are used giving each customer their own look and feel.
Each application needs to have the same root url, mydomain.com. I would like to be able to configure so that when a user navigates to mydomain.com/site1 then they are shown customer A's specific deployment of the application. I would also like these deployments to be running on separate app pools (or similar).
mydomain.com/site1
mydomain.com/site2
mydomain.com/site3
I'm currently deploying to an Azure cloud service and using SQL Azure for the database (one DB shared by each cloud service).
How can I setup the above structure using Azure cloud services and ensure that all our customers can use the same root URL but have different complete applications for all of the multiple sites?
Can this be done using virtual directories on an Azure cloud service?
If not, what would be the best way of achieving this?

Related

"Runtime: custom" access to project id, Google Cloud

We're trying to automaticaly load service accounts depending on the App Engine environment running (dev, staging, prod)
The thing is we are using a custom docker image based on
FROM node:15.14.0-alpine
Does anyone know how we would load the service account json automatically?
With App Engine (and the other Google Cloud product) the service account is loaded automatically and accessible through the metadata server. With some product you can choose the service account that you want to use with your service, with other not (such as Cloud Build and App Engine).
With App Engine, the default (and unique) service account is <project-id>#appspot.gserviceaccount.com. If you want to have 3 different services, for 3 different environments with 3 different permissions, you have to create 3 different projects.
Note: if you use custom App Engine runtime environment, have a close look to Cloud Run

What Minimum Azure Features Requires for running ASP MVC with elastic search as a database

I know about elastic search and run a server in Command prompt in Windows 10 and Work in ASP.NET MVC.
I just want to host in Azure platform. as i have been using shared hosting with SQL server before. so i Need help
What will be minimum requirement or features i have to get to host asp.net mvc application compatible with mobile apps ( providing Apis , not for large scale only for 1 , 2 application ) , with elastic search running at the end ?
Do i have to get virtual machine , documentDB etc features.
You have multiple solutions to your scenario.
Using ElasticSearch
1) To run ElasticSearch you need an Azure Virtual Machine, this could be one from the Marketplace, like, an Ubuntu Server. The size of the VM will depend on the load that it has to manage, maybe you can work with an S1 or you might need an S2. In this case, it's your responsability to expose the network interfases for the elastic search service.
2) For your Web App, you'd need an Azure Web App (App Services). Depending on the load, you can go with an S1/S2 and define your scaling strategy if you need to. There are plenty of tools to measure how your Web App is handling load (NewRelic / AppInsights).
3) Finally, it depends on your Data, but you might need to store it in a persistent storage, like Azure SQL or Azure DocumentDB (depends on the nature of the data) in case you need to rebuild your Elastic Search indexes (and thus reindex from the persistent store).
Using Azure Search
1) Instead of Elastic Search, you can use Azure Search, it will simplify the whole scenario, since it's SaaS (Soft-as-a-Service) and you don't need to maintain and configure a VM, just use the service API from your Web App. Under the hood, it's basically Elastic Search/Lucene with added things.
2) You still need the App Service for your Web App.
3) You still need the persistent storage (Azure SQL, DocumentDB) in case you need to reindex your information or create new indexes.
Basically it all boils down to 3 services (VM/Azure Search + App Service + SQL/DocumentDB) + the Network usage that your App consumes, that's how you'd calculate your costs.
We are currently using both solutions on our products (ElasticSearch for an ELK Logging platform / Azure Search for our main client products) and both work well, but it depends really on your wallet and the kind of implementation times you have, the Azure Search approach might be faster.

What Microsoft Azure should i use?

My company is about provide e-commercial website service and finding the best solution for deployment.
Our application is a multi-tenant e-commercial application. Once purchased, our customer has a website. The newly created website can be browsed by default subdomain on our domain (our domain is invishop.com) eg: mikeshop.invishop.com. The website also can be browsed by customer's custom domain. This requires to create CNAME record to our domain name (invishop.com). Our multi-tenant application is developed in ASP.NET MVC platform.
The simplest solution our considered is Windows hosting with Dedicated IP but this solution does not meet big users requirement. Our application will be used by up to 1000 or higher at a same time. If we deploy our service on shared ASP.NET hosting our service is always can not access. We want to run our application on higher availability Infrastructure but do not want to focus on building and managing Infrastructure. We only want to focus on develop our application and business.
So what service we should use ?
You can use Azure virtual machines for hosting. VMs are scalable and you can make availability set with other VMs. So, if is going down (update etc), the second will working. You can create virtual network and assign some VMs to it (Web server and database server). You can use backup services for each VM too.
You can make VM with dedicated IP - Be careful it is possible to configure ONLY before you make VM - you must use PowerShell.
Create dedicated IP via PowerShell (see on internet commands)
Create virtual network (not necessary)
create VM - web server and assign it to IP via PowerShell
create VM - SQL server
Configure server for IIS - it is possible to host multiple websites on one VM via host names (I use this). Add A record to your domain(xyz.com and www.xyz.com and your dedicated IP)

Windows Azure + Asp.Net MVC + E-Commerce

I will developp and host an e-commerce website based on Asp.Net MVC4 (with several SQL Server Jobs).
I think use Azure in order to stay in Microsoft's world and avoid dedicated server management.
The package Web Site Shared with 1 site / 5Go SQL Server Database / 200Go Bandwidth is very interesting with the price based on 12 months.
But i don't know if this configuration is enough specially on the bandwidth.
What do you think of ? Did you use Azure with this type of application ?
Regards,
Guillaume.
If you want to develop E-Commerce application you will have to secure customers' sensitive data i.e. credit cards, address details etc. via secure connections (HTTPS; in many countries this is legal requirement). For that reason you will have to have SSL support.
Azure Website do not support SSL for custom domains. However, they support SSL for *.azurewebsites.net DNS name. So if your E-Commerce application DNS will be, say, my-ecom-app.azurewebsites.net then it's fine. Otherwise, I would not recommend Azure Website solution yet (I am sure SSL support for custom domains on Azure Website will be implemented).
Azure Cloud Services, on the other had, have full support of SSL for custom domains.
One of the really good websites to check Azure features and development roadmap is ScottGu's Blog
Azure Web Sites do not support SSL and I really don't know of any successful e-commerce site that does not run SSL for at least part of the website. If you really want to host your e-commerce on Azure today your only real choice is to run Virtual Machines for your web front end servers and use them for your DB or use SQL Azure.
We developed platform called Virto Commerce that does just that, MVC4 website hosted on Azure. There was also a need for SQL Jobs (indexing, payment processing, cart cleanups and so on) for which we used WorkerRole (instead of WebRole). WorkerRole and WebRole can actually be combined as part of a single deployment, however it is better to use a different instance for worker roles. In our case WorkerRole acted as a scheduler for multiple jobs defined in the database.
The challenge with WorkerRoles however is to make sure they scale well when new instances are added. So the workload needs to be distributed between multiple instances. This is done through the use of queues and blob locks, where each job is now split into two, one that schedules and partitions the work and the second that actually picks up the next partition and completes it.
Hope this helps!
PS: Virto Commerce is now available as an open source project on codeplex, go to http://virtocommerce.codeplex.com

Multiple Web Roles in an Azure Compute Instance [Deployment]

There is an option for us to have 2 or more web roles in a single deployment. But each deployment can be either be staging or production i.e. by extension, we get only 1 URL to access that deployment.
Considering this case how to access the different webroles, what will be the URLs for those.Also what is the use for having multiple webroles in a single deployment.
Why multiple web roles in a single deployment? Consider an application with a public-facing (customer-oriented) website, as well as an administrative website (maybe on port 8000). There are two basic ways to handle this:
Place both sites in the same web role. This means they now share the VM instances, network cards, memory, etc. It also means that, should you need to scale to handle traffic, both sites are scaled together as a single unit.
Place each site in its own role. Now, they're in their own VM instances and may be scaled separately.
Option #1 is more cost-effective because you can get by with only two role instances (minimum two needed for SLA). Option #2 is better for independent scaling. for instance: If you get a huge spike in customer traffic, this could cause trouble for you when trying to access the administrative website, whereas if your admin website is in its own role, it won't be affected by customer traffic.
In both cases, you get one IP addres, one *.cloudapp.net name (and you can map a custom domain name to it with a CNAME).
Staging vs. Production: Your entire deployment may be published to either Staging or Production (or both, as two separate publishes). Staging is not meant for external users - it's really meant for a pre-live area, where you can verify that a new deployment works as expected. You can then perform a virtual IP swap with your currently-running system in Production, which effectively swaps your staging and production deployments. This results in a near-instant upgrade of your software with no customer downtime.
Keep in mind: Every role in a deployment must stay together - you can't deploy one role to one service and the other role to another service. If you want to do this: Separate your roles into separate deployments. Then you can publish them to different URLs.
In a production deployment your webrole can be accessed by the URL with a prefix you defined previously for example myapp.cloudapp.net; web roles in staging deployment on the other hand can be accessed by automatically generated URL for example 205521014d8c440a83852b62e0df9db5.cloudapp.net
I am afraid there is no way to access web role instance directly, bypassing AppFabric router. Why would you ever need to do it anyway?
If you need get access from one web role instance to another, consider using a queue or distributed cache instead of direct communication.

Resources