locked
Why are there no databases found in my project when publishing MVC app to Azure Cloud? RRS feed

All replies

  • Friday, January 19, 2018 7:13 PM
  • User1894682578 posted

    Sadly it really doesn't enlighten the point why I can't see the databases I have locally. Do you need extra information to clarify or do you perhaps have an idea what's wrong?

    Thank you mgebhard,

    Friday, January 19, 2018 7:57 PM
  • User475983607 posted

    I though you could not see the DB on Azure.   So the problem is you cannot find the local DB that you used to develop your application?  Simply open the web.config and look at the DB connection node.  If you are still having issues after looking at the web.config, then contact your mentor as I assume your mentor is the person that setup the connection.

    Friday, January 19, 2018 8:04 PM
  • User1894682578 posted

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    <system.webServer>
    <handlers>
    <add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" />
    </handlers>
    <aspNetCore processPath="dotnet" arguments=".\Groep1D.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />
    </system.webServer>
    </configuration>

    This is all i see sir I see no connection node in the web config file. What's supposed to be done? 

    This below is what I have in the Startup.cs file

    services.AddDbContext<DataContext>(options => options.UseSqlServer("Server=(localdb)\\mssqllocaldb;Database=Groep1D;Trusted_Connection = True;MultipleActiveResultSets = true"));

    Friday, January 19, 2018 8:08 PM
  • User475983607 posted

    Oh, this is an ASP Core app.  That would have been helpful to know.

    Your database name is Groep1D on (localdb)\mssqllocaldb and shown in the original screenshot.

    Friday, January 19, 2018 8:16 PM
  • User1894682578 posted

    I'm very sorry for not informing you about it. This is the first time in my life I'm making an ASP CORE app and using C#/Visual Studio. I have tried installing Visual Studio Professional redoing the same steps, when I click on databases I receive the text "Discovering Data Context" which is my context and after a second it just goes back to the same can't find databases in the project.

    Friday, January 19, 2018 8:23 PM
  • User475983607 posted

    I'm very sorry for not informing you about it. This is the first time in my life I'm making an ASP CORE app and using C#/Visual Studio. I have tried installing Visual Studio Professional redoing the same steps, when I click on databases I receive the text "Discovering Data Context" which is my context and after a second it just goes back to the same can't find databases in the project.

    I'm not sure what problem you are trying to solve and the original post has been removed.

    Friday, January 19, 2018 9:05 PM
  • User283571144 posted

    Hi PacBell,

    PacBell

    I'm very sorry for not informing you about it. This is the first time in my life I'm making an ASP CORE app and using C#/Visual Studio. I have tried installing Visual Studio Professional redoing the same steps, when I click on databases I receive the text "Discovering Data Context" which is my context and after a second it just goes back to the same can't find databases in the project.

    As far as I know, we couldn't use local sql database when you want to publish the MVC web application to azure web app.

    The azure web app couldn't access the local sql database, if you don't enable Hybrid Connections.

    Normally, we could create the azure sql database when publish the web application to azure.

    Like this:

    If you already has the sql database, you could modify the connection string in the publish setting window.

    Like this:

    Best Regards,

    Brando  

     

    Monday, January 22, 2018 6:40 AM
  • User753101303 posted

    Hi,

    Also the publishing wizard is looking at the application config file to find out your db connection strings. Currently the connection string is defined directly in your C# code and can't be found by the publishing wizard.

    Tuesday, January 23, 2018 4:58 PM