how can I deploy/publish my asp.net MVC application to online - sql-server

how can I deploy/publish my asp.net MVC application made in visual studio 2015 .net version 4.5 ,and sql server database 2016 database using localhost (.) with windows authentication ...to online ..so it can be accessed to everyone ....with code updations and sql server edition..thank you

You can host your application using IIS. IIS can be setup in any machine.
Steps :
Install IIS
Open IIS manager by entering inetmgr in Run(win+R)
Add website by browisng to its location to the published website location. (Hope you know how to publish a website in visual studio)
Edit the web config file to configure the sql server credentials(Sql db could be hosted separately or in the same machine)
Right click the website in IIS Manager and click start.
Click browse to view the website
You could either access the site by localhost:portnumber or by specifying IP:port number in settings of the website in IIS manager
You can access the website from mobile or external devices if you select public IP for your website. Incase you're connected to a local network, then the website could be accessed only from within your work place. Discuss with your network admin about exposing your server to public by providing a public IP address, if you're on local network.
Feel free to revert if you have more doubts.

If you have a VPS or DS us can use this Article it teaches localy but it is same with real VPS or DS
Also if have a Host you should publish your project on your system and upload it to your Host Provider and make backup of your SQL Server Database and set your host provider IP in Web.Config.

Related

When I host 2 apps (Web API and Blazor server) on Windows Server 2019, the API localhost port refuses to connect to SQL Server database on IIS

When I publish both projects to a local Windows IIS, they both run smoothly, but when I publish to Windows Server 2019, I get an error
No connection could be made because the target machine actively refused it.(localhost: 7112)
Please help me - how should I configure my web.config after publishing to the live server?
I enabled websockets on both apps program.cs, I even opened the apps ports on the firewall, it's my first time deploying to a real live server, I'm not sure what I left behind

Deploying Umbraco 8.1.1 to Azure w/SQL Azure DB: Boot Failed

I'm trying to develop an Umbraco 8.1.1 site on Azure and am following these steps:
I create an Azure SQL server database (I don't use any local DB at all).
I create an empty ASP.NET 4.7 Web App locally and add Umbraco 8.1.1 via NuGet
I invoke locally and configure my Umbraco application to use the Azure SQL Server DB. It works without issue. I can see the database from SQL Server Management Studio no problem.
I then publish the site through Visual Studio 2019 to an Azure Web App, and when I visit it, I get the following error:
Server Error in '/' Application.
Boot failed: Umbraco cannot run. See Umbraco's log file for more
details.
-> Umbraco.Core.Exceptions.BootFailedException: A connection string is configured but Umbraco could not connect to the database. at
Umbraco.Core.RuntimeState.DetermineRuntimeLevel(IUmbracoDatabaseFactory
databaseFactory, ILogger logger) in
d:\a\1\s\src\Umbraco.Core\RuntimeState.cs:line 194 at
Umbraco.Core.Runtime.CoreRuntime.DetermineRuntimeLevel(IUmbracoDatabaseFactory
databaseFactory, IProfilingLogger profilingLogger) in
d:\a\1\s\src\Umbraco.Core\Runtime\CoreRuntime.cs:line 259 at
Umbraco.Core.Runtime.CoreRuntime.Boot(IRegister register,
DisposableTimer timer) in
d:\a\1\s\src\Umbraco.Core\Runtime\CoreRuntime.cs:line 146
I'm stumped. How do you configure Umbraco to use an Azure SQL DB?
Check that you've got the connection string registered in the Web App correctly - I suggest looking at the Configuration section for the Web App and setting the configuration string there. Alternatively, download your web.config file via ftp and compare the connection string in the published version vs. your local version.
You should also check the server or database firewall settings and make sure that Azure services have access:
https://learn.microsoft.com/en-us/azure/sql-database/sql-database-firewall-configure#connecting-from-azure

Using Power Desktop with an Azure VM and Enterprise Gateway

I am developing a report in PowerBI Desktop based on data hosted in an Azure SQL Server VM.
When publishing a report, I get the below error:
Publishing succeeded, but the published report cannot connect to the
data source because we were unable to find a gateway. Please install
and configure an enterprise gateway
I believe this is because the enterprise gateway is installed locally on my azure VM, however I'm accessing it from my desktop by going over the web and through the firewall. Therefore I believe the issue is that my pc acceses the machine at
mymachine.cloudapp.net
Whilst the enterprise gateway knows the machine as
netbios-name
Is there any way that I can upload a desktop report to powerBI web using this configuration? The other solution would be to get the machine and sql server to identify itself as "mymachine.cloudapp.net" so that I can use this as the name to connect to through the enterprise gateway, but I'm not sure how to do that (adding the alias to SQL Server isn't enough).
It's a bit hacky, but I've got a work around.
Open the server and edit your hosts file and add the following line:
127.0.0.1 mymachine.cloudapp.net
Make sure that mymachine.cloudapp.net has been configured in SQL Server as an alias.
In PowerBI, add a new enterprise gateway data source, this time, use mymachine.cloudapp.net to connect rather than netbios-name. You will need to use SQL Authentication to connect.
Obviously connecting PowerBI to an Azure VM in this way is not ideal, as it could potentially be unencrypted, but this works around the issue of different host names between PowerBI Desktop and Web.

Upload DBFile.mdf in App_Data to Azure

I have my ASP.NET MVC 3 project with a local database stored in /App_Data directory. This db is SQLExpress file (*-mdf).
I have my connection string working perfectly in my development CPU, the Connection String is:
data source=.\SQLEXPRESS;initial catalog=CFCBBSecurity;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\MYFILE.mdf;User instance=true" providerName="System.Data.SqlClient"
When I upload it to Azure, using VS 2010, all files are in the server, but the application cannot access the Database.
What should I do, change or update?
Thanks in advance.
The problem is that you're referencing a local SQL instance (.\SQLEXPRESS, the 'dot' stands for localhost). I'm assuming you are running SQL Server 2005/2008/2012 Express on your machine and that's why this works locally.
But when you deploy your application to Windows Azure, there's no SQL Server installed on that Web Role/Worker Role/Web Site (this would be a bad idea anyways because Web/Worker Roles are not persistent!).
What you'll need to do is sign up for a 'cloud database' like SQL Azure and use that. Or you could host it yourself in a Windows Azure Virtual Machine (which is IaaS, but this involves more work).
If you're building an MVC 3 application I would suggest you simply start with SQL Azure. Here is a tutorial: Running ASP.NET MVC 3 Applications on Azure (note that this tutorial contains screenshots of the old portal).

Silverlight RIA query failing using authentication & impersonation

Database: Sql Server 2005
Webserver: IIS 5.0
IDE: Visual Studio 2010
I've created a Silverlight RIA application which will allow users of our intranet query one of our databases.
In the config I have set the authentication to windows and enabled impersonation.
In IIS i have disabled anonymous access and only enabled windows authentication.
This all works fine in my development environment and when running it from VS2010.
When i publish it to my local web server and connect to it from my local pc it works too.
However if i access the URL to the application on my local web server from another machine the application does not work. It gives the following error: "Load operation failed '[QueryName]'. Exception type 'System.ServiceModel.DomainServices.Client.DomainOperationException' was thrown.
The database sits on its own server. However i have the same database locally and if i change the connectionstring to local at the local version of that database it works fine.
IIS on my PC does not seem to forward requests to the SQL Server machine. As im running profiler to see what requests come in.
Any help on this would be greatly appreciated. Im sure im missing something.
Thanks
this was an issue was a classic double hop problem when using windows authentication. instead i used annoymous access on IIS and set the App Pool to an account that had access to the database on SQL Server

Resources