deploying website doesn't work the database access - sql

I have a website that access a sql database in localhost and it works, but when published in an Azure website, can't reach the database. I've changed the connection string with visual studio on line pointing to a new database created in Azure, but can't reach the database.
There is a way to track the error? because the application only returns to the same webpage (this is the caondition when the connection to the database fails.
Any suggestion?

Check that the Azure firewall has a rule for the IP address of the machine hosting the website. You can do that by either of two methods:
Navigating to your Azure Portal using a browser that is on the same machine that is trying to access your database.
Go to the 'SQL Databases' section and click on the database.
In the 'Design your SQL database' section, click on 'Set up Windows Azure firewall rules for this IP address'.
If the machine already has a rule the portal will indicate that. Otherwise a new rule will be added.
The other way:
From the Management Portal, click SQL Databases. All databases and their corresponding servers are listed here.
Click Servers at the top of the page.
Click the arrow beside the server for which you want to manage firewall rules.
Click Configure at the top of the page.
To add the current computer, click Add to the Allowed IP Addresses.
To add additional IP addresses, type in the Rule Name, Start IP Address, and End IP Address.
To modify an existing rule, click any of the fields in the rule and modify.
Click Save at the bottom of the page to save the changes.
How to: Configure Firewall Settings (Azure SQL Database)

Related

How to disable firewall in Azure SQL database?

I want to disable firewall settings in the Azure SQL database? Most of the documentation shows how to enable? Can't able to find how to disable it?
Can anyone advise?
• You cannot disable firewall in Azure SQL database by the toggling the ‘ON/OFF’ button, but you can surely disable the Azure SQL Database firewall through the firewall rules for sure by following the below steps: -
A) Create an Azure SQL Server level firewall rule to allow all IP addresses through the Azure portal by going to the Azure SQL Server created, select the SQL Database --> Settings --> Firewall --> Set Server Firewall --> Add the IP Address ‘0.0.0.0’ under Start IP and ‘255.255.255.255’ under End IP and give appropriate rule name to the rule --> Save. Also, ensure to check ‘Yes’ to the option for ‘Allow Azure Services and resources to access this server’ which will add a rule from ‘0.0.0.0’ to ‘0.0.0.0’ in rule space and gives access to everyone including the other Azure resources and services to the Azure SQL Server.
B) Secondly, after doing the above, configure the database level firewall rules for ensuring access to everyone thereby successfully proving the firewall useless and ultimately proving it as disabled.
EXECUTE sp_set_database_firewall_rule N'my_db_rule';
,'0.0.0.0'
,'255.255.255.255'
The first parameter is the rule name, followed by the first IP address that you wish to give access to. The third parameter is the last IP address in the range you wish to give access to. Setting the start IP address and the end IP address to the said IP address range will only provide access to that specific IP address range. But to execute the above command successfully, you will have to provide ‘CONTROL’ permissions on the required database. Once the command has been issued to change a rule, the change can take up to 5 minutes to take effect. Similarly, if you want to delete a firewall rule, execute the command below which will delete the said firewall rule thus once again activating the firewall rules to block or allow specific IP addresses.
EXECUTE sp_delete_database_firewall_rule N'my_db_rule';
C) Also, to view the existing firewall rules on a SQL database, execute the below transact-SQL query on the MASTER DB which will display all the rules that are in place currently on the Azure SQL DB and Server.
SELECT * FROM sys.firewall_rules

How to connect Azure SQL database to ASP.NET website hosted on a different server

I have created Sql database from Azure using my subscription. I copied the connection string supplied with my credentials correctly into my code and it work in visual studio but when I deployed to my hosting server for my website it displays connection error. I have set IP range to accept all IP yet not working.
By default, (when you create a new DB), Azure blocks ALL traffic to your database. In order to allow traffic to your database either you need to whitelist all the IP address or the best suggestion in your case is to enable 'Allow access to Azure Services' on the SQL Server settings. Find more details here

Second RDP session on dedicated server

I bought dedicated server by Windows Server 2008 R2. In options, I check "additional IP". I can create two users on my server. How I can connect to them (RDP) at the same time? (using both IP-s?)
//sorry for bad english..
Hard to answer that concisely as you haven't said what is and isn't working currently, but I'll try to cover the obvious possibilities. I'm assuming that you're talking about remote admin.
By default Windows Server 2008 R2 (and other versions) doesn't allow RDP connections, you first have to enable it and grant the relevant users permissions to connect. Select Start then right click on Computer and click Properties. In the System window, click Remote settings on the left hand side of the window. In the Remote tab, ensure that one of the two Allow connections... options has been selected, then click Select Users and add the two users you've created.
By default I believe RDP on the server is configured to listen on all connections on the server, but you can check that by running tsconfig.msc, then in the Connections section right click on RDP-Tcp and select Properties. Go into the Network Adaptor tab and check what is selected, by default this should be "All network adaptors configured with this protocol".
The fact that you've configured the server with two IP addresses (I'm assuming on the same NIC from your description) shouldn't make a difference, the two users should be able to connect via RDP using either using one or both of them.

Problems with simultaneous ODBC connection to web server hosting pages

I have an issue with a SQL Server Express install. I have a test server set up called ASPDEMO running server03, IIS6, SSEE08R2. MgmtStudio installed.
When I access the web site from a computer on the LAN all is well, I can login to the site and hit the db with no problem.
If I try to set up an ODBC connection to ASPDEMO I can connect and link to tables from Access for example, no problem.
But I can't do both at the same time.
Any ideas?
In Management Studio, connect to the database and right-click on the instance. Choose Properties. When the Server Properties window pops up, Click Connections in the list on the left and check the maximum number of connections allowed. Maybe it is set to 1.

Cannot access WSS 3.0 sites after movind Content and Config DBs

Problem:
No access to internal sites after new Instance of SQL was installed on MS SQL Server
Description:
I've got a WSS 3.0 installed on the W2K3 Sever.
Originally, there was only one Instance of MS SQL (MSDE) for Backupexec (bkupexec). Later, we installed WSS 3.0 and instead of installing the new instance of SQL we installed on the same instance (bkupexec). So, at some point all the DBs from Backupexec and DBs from WSS were all together within the same SQL instance.
After we noticed this we wanted to split those two into two separate instances: bcupexec and sharepoint. First, I have done a backup of all DBs within backupexec instance. Then, I installed new SQL Instance and called it Sharepoint and tried to restore all WSS DBs into the new SQL instance. Once that was done I check references in IIS so Content and Config would point into the new instance. But since then no go.
I can access Admin site from within IIS and from the browser. I cannot access any internal WSS sites. It asks for the authentication. All I am using is Windows authentication. Account is in AD.
As I am new to WSS I will be greateful for all suggestions and possible fixes.
If you have changed where the content DB's are located for your site collections you will need to detach and re-attach them using the SharePoint Central Admin.
Navigate to Application Management and switch to the application you're concerned about. Click "Content Databases" under the heading SharePoint Web Application Management. From here you can click "Remove content databse" and hit OK.
This will not remove the physical database from SQL, it will simply disassociate the database with that web application. You can then Add a content database from within the manage content databases screen and type the name of the database you wish to associate the application with.
If the permissions issues persist, ensure that Anonymous access is enabled for the application and that appropriate service account permissions are enabled for the DB's from within SQL and SharePoint.
Not sure this will help, but give this a try...
In central administration make sure you check on the site collection administrator for your site collections and make sure you are using that user.
In IIS Manager, check to make sure that user has access to the IIS web site.