Hosting MongoDB on Windows Azure for C# Access - c#

I have read this page: http://www.mongodb.org/display/DOCS/Azure+Deployment, but it seems to be talking about actually setting up an Azure application, which I'm not interested in. I just want to host a Mongo DB on Azure which I can access from some non-Azure application using a connection string. I also tried running the script on this page: http://www.mongodb.org/display/DOCS/MongoDB+Installer+for+Windows+Azure but it threw an exception when it tried to validate the image name. Is what I want possible?
The reason for all of this is that I'm trying to compare MongoDB and Azure Table Storage, and I want to make the scenarios as similar as possible when I performance test.

The first link in your question talks about deploying MongoDB in Windows Azure (also accessible by other applications), but this in a traditional PaaS context. This means you'll be deploying MongoDB in a hosted service/cloud service.
If you want to host MongoDB on Windows Azure in a way that "feels more natural" you should consider deploying it in a Virtual Machine (the second link in your question). There's actually a how to on the Windows Azure website that will guide you through the whole process of creating a VM and deploying MongoDB on that VM: Install MongoDB on a virtual machine running Windows Server 2008 R2 in Windows Azure
Both ways to deploy MongoDB will allow you to access it from non-Azure applications, you'll simply need to configure the endpoints correctly (allowing access to specific ports from outside the datacenter).
Note that Virtual Machines (IaaS) is still a preview feature and the performance in the preview might not reflect the performance of the final version.

You can run MongoDB on Windows Azure two ways. First way is to run as Cloud Service which is described here however this is not what you want.
The second option to run MongoDB on Windows Azure to use Windows Azure Virtual Machine (either Linux or Windows) and then install MongoDB on it. The link below explains how you can install MongoDB on a CentOS machine in Windows Azure:
https://www.windowsazure.com/en-us/manage/linux/common-tasks/mongodb-on-a-linux-vm/
If you decide to use Windows Virtual Machine, you sure can use any MongoDB tutorial to install it on Windows box after configuring Windows Virtual Machine or just use this one.
As you have already tried using Powershell to deploy MongoDB from your desktop to Windows VM, but failed to get working, please write another question with error details and i sure can help.
Finally based on your actual objective I would suggest creating MongoDB on CentOS by following above tutorial and get your test done, which could be easiest MongoDB setup among all the methods we have talked.

Related

UWP install SQL Server Express or other pre requisites

Is there a way to install pre requisites from an UWP app published in the store?
I want to develop several multi user UWP apps that use SQL Server.
First I was trying to get all SQL server instances within a network to be able to select one if present, or give the option to install a server if none exists. Seems that UWP cannot use any existing method to get those instances:
SqlDataSourceEnumerator is not present in net core
SqlClientFactory.CanCreateDataSourceEnumerator is always false
SmoApplication.EnumAvailableSqlServer also throws exceptions and cannot be used from UWP, as seems that it also uses SqlDataSourceEnumerator
Then I was trying to use Process from System.Diagnostics to start a cmd, use "net view" to get all workgroup computers, and then, by powershell or cmd, get services running on those computers to check if sql express exists. But, Process cannot be used from UWP apps, always throws access denied (even with "runas", that cannot be used as it needs Process.StartInfo.UseShellExecute, that trows a "platform" error). I was hoping to use cmd or powershell to download and install SQL Server too. When I was using winforms I installed it even from the setup (using innosetup)
So, as long as you can connect to almost any type of database server from UWP, how can we use the store to deliver apps that need any pre requisite?

Is it possible to host a *CONSOLE* application in AWS

I'm trying to upload a .net console application, which has selenium in it which does some automation in the web.
I have seen the docs that tell us how to upload a mvc application and i have hosted it successfully.
So the question is, is it possible to upload a console application created in visual studio to aws.
Amazon EC2 creates a virtual machine that runs the operating system of your choice.
You can run whatever you wish on it, as long as it does not violate the Terms & Conditions of usage.
you can deploy it to AWS Lightsail or AWS EC2 . But you are in developing some application, it is better to deploy to AWS Lightsail as to reduce cost of development.
Of course Possible it will be very easy, I hope. In my case I use .NetCore 3.1 console app, where I implement tcplistener, tcpClient.
Configure port in aws.
when u create instances u will see public ipv4 address, that u will put in yours
client or app file.
and after than in that instance open cmd -> type ipconfig -> thane u find private
ipv4 address, that use in server file.
Finished!!!
Literally you don't need AWS to host your console app at all, as you can write even simpler AWS Lambda in C#, which is similar to Azure Functions.

SQL notification problems upon Change from local IIS to azure APP

I am trying to upgrade my application from being in a local machine (both application and SQL server) to using the combination of Azure APP and Azure SQL service. I have successfully published the code in the Azure Web App, and the Application works except from one error that keeps on comming.
"{serviceResponse:{success:false,message:"System.InvalidOperationException: When using SqlDependency without providing an options value, SqlDependency.Start() must be called prior to execution of a command added to the SqlDependency instance."
in the Application start I am indeed using the SqlDependency that works only locally. The only sort of solution I found is to use the SqlNotificationRequest, but I have not been able to make it work using it.
What corrections do I need to do in order to make the App work with my remote DB? I am using C# (.net) and SQL server 2016.

Add/Start/Stop IoT Core application from another application

I would like to add/start/stop/remove an application (IoT Core) just like the web interface or the Power Shell commands: "IotStartup" but from within a C# application running on the IoT Core itself.
Is there a c# API for this or do I have to implement the Power Shell commands inside my application?
Using the Device Portal API could work for you.
Here are the docs.
https://learn.microsoft.com/en-us/windows/uwp/debug-test-perf/device-portal-api-core
Device Portal APIs are intended for remote management, and may not work from within a UWP against localhost due to loopback restrictions in Windows (to prevent an app from attacking the device it's running on).
That said, the Windows.Management.Deployment.PackageManager class provides installation and removal APIs for apps. To launch an app, you can use Windows.System.Launcher. Note that PackageManager is a restricted capability, so the app won't be able to go into the Store without special permissions from Microsoft. It will work in sideloaded scenarios though.
There is no way to close an app from another app with existing APIs. However, Launching the app using the above, then connecting with an AppServiceConnection to manage it, you can send a "Close" message over the AppServiceConnection that causes the app to close itself.

asp.net mvc 4 c# plus mongodb driver

I would like to know if i use my web app in production in shared hosting, will be there a problem to use mongodb driver c# (driver is embedded in the project or need host support for that)?
Because I'm planning to use dedicated mongodb server.
Thanks.
The C# driver is just a set of DLLs, so you're fine.
The only thing to check is that the shared host will allow traffic over whatever MongoDB port (it uses 27017 by default, although you can change that).

Categories