Deploying an MVC 4 application programatically - asp.net-mvc

I am thinking at the following scenario: I have a solution with a web application(containing some REST web services) and a console application which is responsible for monitoring the resources of the host server(CPU, RAM, etc.). I want to implement the following feature: when the console app sees that for example I get a value bigger than a given threshold(lets say the CPU usage is over 70%) to deploy automatically on a new machine(on the same network). This is probably something similar with the Azure environment, but I'm not sure because I've never used it(just watched some videos). Has anyone implemented something similar? Can this be done locally on my machine? Any hints and answers are greatly appreciated.
Thanks,
Alex

Related

Make the Web App on Azure portal only Available few hours in a Week

I am building a ASP.Net Core Web App which I am trying to host in the Azure portal. We have requirement that these Applications can be accessed only certain times in a week, those times are stored in the Azure Database. Is it possible to make the App Available/Accessible to the users upon looking at database
Here the Setting is that the application should be available only between 14:00 - 16:30 on TUESDAY. When I tried to research we can schedule tasks/workflows in the portal but couldnt find what I am looking for. All I wanted to know is this requirement possible, if so please share the idea.. I am new Web App development and Azure deployment, any help is greatly appreciated
This feature is not available in Azure out of the box. This is something you will have to handle yourself.
One obvious way to implement this would be to check if the application should be available on every request. If the request day and time falls between the available times set in the database, you show your users the website content otherwise show them some kind of not available message.
A more complicated way would be to make use of App_offline.htm file to make your site unavailable. You can dynamically add/delete App_offline.htm file to your WebApp based on the day/time when you want your site to be offline/online.
However please note that while your site is offline, you will still be charged for the WebApp as the resources keep remain provisioned.
You can use Azure Automation Service to orchestrate processes like this. You will have to create a runbook (script in python or powershell) that will query the DB and figure out the times when the Azure Website hosting your webapplication should be started or stopped.

Amazon EC2 Server very basic questions

I am trying to develop my iOS application that requires a backend for simple CRUD functionality and also a server that helps me link up players and handle real-time multiplayer game logic.
I am using AWS DynamoDB to store my user's data and believe I would need to set up an EC2 instance to help me with my multiplayer game feature. I am completely new in this area and I hope to get some help in these few elementary questions:
Does the different instance (linux or windows) matter?
What language is it required to set up the server-side code? Or is server-side coding necessary?
If the language in the server-side is different from that of xcode's how does it handle the calls? (Please bear with me if this is really fundamental)
Is there any guide for setting up AWS EC2, and must those guide be specific to iOS for my app to work?
Thank you so much for all your help!
Probably
Whatever you want to use, and yes it is necessary
You have different options here, you can do everything from sockets to REST or SOAP.
An EC2 instance is, as far as your concerned, just a server running a back end service for your application. You need to figure how you want the application to work first. It doesn't matter if you decide to host it on ec2 or another service.

Connecting to users local machine from my WebApp

I have a Web App that i have developed I am looking to develop a plugin for this app so that i can pull information from the users accounts package such as sage or quickbooks(offline version). Ideally I would like to do this without them having to have a static ip etc.
Unfortunately this is way over my head I currently have no idea on how to do this.
Please can some one guide me in the right direction I will probably use json data between the webapp and the client service that I will make and im fine with that part its just the initial connection that I am confused about.
Any help would be really really appreciated I hope this makes sense.
Thanks
Ash
The way the Shopify Quickbooks integration (Quickify) works is by setting up a tiny local server that listens on a high port number and is able to play with the local filesystem. The web app part of the solution sends JSON back to it.

How to get site context/information during the PreapplicationStartMethod

When you run the same web based application as a multi-tenant application for different clients is there a way during the PreapplicationStartMethod to gain some kind of context to the site that is being started?
More specifically I'd like to get the host header information (the "bindingInformation" attribute value from the applicationHost.config); I have found ways to get this information at the time of a specific request long after the application has started. Is there a way to get the information during the application startup process?
This is an MVC 3 application and IIS 7.5.
I did not find the direct answer to this question for finding the "bindingInformation" at application start up. After reviewing the requirements further. The host header would not have been the best choice for my solution.
The the better solution is to use the System.Web.Hosting.HostingEnvironment.SiteName value instead.

What are some best-practices for web-based iOS applications?

I have recently started playing around with iOS development and have got most of the basics down. I would however like to know about some best practices and what you guys think is the best in coding practice and application architecture.
What I have in mind is a simple application that gets information from a web server, displays the data to the user, and allows the user to edit the data which must then be updated on the web server.
What I would like to know is:
1) What type of web server / architecture is best suited for something like this? For example, data passing / updating similar to something like the facebook or twitter etc. applications where data is retrieved, potentially updated, and sent back for updating.
2) What type of authentication / security can be built into an application like this? I was thinking something in the line of username / password being stored on the server. Obviously the data should be secure when being transfered.
3) Are there any "free" web servers out there to play around with. I'm not building anything enterprise size, just need somewhere to play. Would the Google App Engine be suitable for something like this? What I have thought up to now is that you would probably need to implement a web service or something. Is this correct? Or are there better ways?
4) Are there any good tutorials around? I have started looking at the ones in the apple.com developer center, but I would like to get other people's point of views too.
I realise these are not really programming questions, but I would appreciate any insight that some more experienced iOS developers have. I would like to get the best practices down by incorporating the above into an app.
Thanks!
This doesn't sound like you need an iOS app, more like just a browser based app that works on the iPhone. If you need features like the GPS, Camera, Gyroscope, taking offline things that are native to the phone, then yes build it on iOS.
But if it's a simple web application that performs the operations you mentioned, then you can look at building a mobile web application. The nice thing is that it will work across iPhone, Droid, WiMo 7, really anything that can host a browser.
1) You can pick almost anything you're comfortable with. I program in both ASP.NET and Python for web apps. Personally, I'm building a web app on Django with Python. It's cheap (free) and there are lots of resources for learning as well as an active community.
2) Security is a rather large topic, there are many things beyond authentication and authorization, like cross-site scripting, sql injection, etc that need to be taken into consideration. Django has some things that help with this. But at the simplest you can secure your site with SSL encryption when performing authentication. You should also consider OpenID as an alternative for authentication, like how StackOverflow gives you the option.
3) I do all my "play" on my macbook pro or pc at home. You can do all of this for free on your own machine, and when you're ready to deploy pick a host, like Amazon or something like Media Temple.

Resources