0

It works perfect when I run in Local and SQL Azure DB. But when I publish the website to azure it gives me error as following.

My web Config:

<configuration>
  <connectionStrings>
    <add name="systemReposConnectionString" connectionString="Server=tcp:ewsserver.database.windows.net,1433;Database=systemRepos;User ID=xxxdb@ewsserver;Password=xxxx;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;" providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>

    <customErrors mode="Off"></customErrors>
    <compilation targetFramework="4.5" debug="true"/>
    <httpRuntime targetFramework="4.5" />
  </system.web>



</configuration>

Error that I get as below: A network-related or instance-specific error occurred while establishing a connection to SQL Server.

The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)

I have set the firewall setting for my azure SQL server from 0.0.0.0 and 254.254.254.254

Thanks

2 Answers 2

3
  • Go to Azure portal > Your SQL server > Firewall Settings
  • Look for 'Allow access to Azure services'. Make sure 'On' is selected.

This would allow the other Azure services to reach the SQL server, without the need to set the allowed IP range on the your Azure Website's web config. A normal connection string will suffice.

Sign up to request clarification or add additional context in comments.

1 Comment

Try to open your site, however could not get the error you provide on your origin post. Is your issue fixed? From my experience, Frankie's reply could help this type issue.
0

CONFIGURING ALLOWED IP ADDRESSES There are three points that must be configured in Web.config:

  • Set the allowUnlisted option to “false”.
  • Set the denyAction to“Unauthorized”.
  • Add a line for each allowed IP address or network. enter image description here

This configuration will allow access from both the local machine and the 10.200.7.x network, this however is only half of the story as the IP addresses that Azure and AWS use are vast and numerous, they are also published online.

For more Information ,please refer https://azure.microsoft.com/en-us/blog/ip-and-domain-restrictions-for-windows-azure-web-sites/

2 Comments

Please Put in your DB Password
tried this.. but still didnt work.... I m still getting the same error...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.