locked
new to Azure, get this error, help pls RRS feed

  • Question

  • User-775831949 posted

    I created a new ASP.net website with standard login and uploaded it to Azure.

    The default page loaded normally. Then I click Register and put in correct details and the press Register button.
    Then I get this error below. In my local machine VS2017 development server it can register without error

    What is wrong ? I am using trial Azure. Is it I have to subscribe to SQL Server service too ?

    Thanks

    SqlException (0x80131904): 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: 52 - Unable to locate a Local Database Runtime installation. 
    Monday, May 29, 2017 2:13 PM

Answers

  • User1068175894 posted

    once you create the database as explained in the following link:

    https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal 

    replace in your connection string that looks like the following in web.config

    <add name="XYZ" connectionString="metadata=res://*/ModEntity.csdl|res://*/ModEntity.ssdl|res://*/ModEntity.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=ServerName;Initial Catalog=DatabaseName;Persist Security Info=True;User ID=UserName;Password=SomePassword;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    the server name, databasename, user and password as in the second image in the article

    -------------------------
    Please remember to click "Mark as Answer" the responses that resolved your issue.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 1, 2017 3:22 AM

All replies

  • User1068175894 posted

    your local project most likely references a local database which is not accessible from azure,

    if you want to use sql server yes you have to subscribe to azure sql as well. 

    you could consider using a cheaper storage if that fits your needs like azure table storage.

    -------------------
    Please remember to click "Mark as Answer" the responses that resolved your issue.
    Monday, May 29, 2017 4:34 PM
  • User-775831949 posted

    Thanks a lot.

    Yes my project is pointing to local database on VS2017.

    I thought on publish it will copy everything and modify my web.config to point to the db copy on Azure ?

    So the answer is no ?

    What should I do to fix this ?

    And cheaper storage, thanks for this. Any link for this one ?

    Thanks

    Monday, May 29, 2017 11:54 PM
  • User1068175894 posted

    this is azure table storage pricing:

    https://azure.microsoft.com/en-us/pricing/details/storage/tables/

    this is how to use it:

    https://docs.microsoft.com/en-us/azure/storage/storage-dotnet-how-to-use-tables 

    don't expect a full relational database system, but to store simple data it costs only 0.07 cents per gb

    if you need all the capabilities of a relational database system you can start with basic single database for ~$5 a month

    here is a tutorial on how to create the database

    https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal 

    then change your connection string for the new database

    you could also try changing the publishing configuration to deploy de db automatically

    Tuesday, May 30, 2017 2:08 AM
  • User-775831949 posted

    Thanks for pointing to azure table storage.

    I dont know this before. Great.

    Thanks for the link but after reading they involve super complicated steps for me.

    I use Visual Studio to publish to Azure.

    How should my web.config be modified on the datasource connection ?

    Should I do it in Azure or on VS ?

    Any practical steps in activating this Azure table storage ?

    Tuesday, May 30, 2017 1:04 PM
  • User1068175894 posted

    once you create the database as explained in the following link:

    https://docs.microsoft.com/en-us/azure/sql-database/sql-database-get-started-portal 

    replace in your connection string that looks like the following in web.config

    <add name="XYZ" connectionString="metadata=res://*/ModEntity.csdl|res://*/ModEntity.ssdl|res://*/ModEntity.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=ServerName;Initial Catalog=DatabaseName;Persist Security Info=True;User ID=UserName;Password=SomePassword;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

    the server name, databasename, user and password as in the second image in the article

    -------------------------
    Please remember to click "Mark as Answer" the responses that resolved your issue.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, June 1, 2017 3:22 AM