Base solution for your next web application
Open Closed

Deploying Core on Azure from Visual Studio 2017 #2714


User avatar
0
sh0knah created

Looking for tips from anyone who has experience deploying to Azure.

I'm trying from just the raw application, without any customizations or modifications. It's working locally in a development environment. I use the Publish menu from the *.Web.Mvc project.

I can push it successfully to my Azure account.

Once I have everything connected and configured properly on Azure, I fire up the application and I get the "No language defined in this application" message that I would expect from an un-migrated instance.

Now I'm stuck.

There is no option to apply migrations with the Publish from Visual Studio 2017.

I can't apply it remotely from the Package-Manager Console. I get "The EntityFramework package is not installed on project '*.EntityFramework.'"

And I can't do it from the console in Azure. I run dotnet ef database update (or really any dotnet ef command) and I get "Unhandled Exception. Value cannot be null. Parameter name: Path."

So I don't have a way to migrate the database.

I'm not using a virtual machine, so I don't think I can just push Migrator out there.

I'm really trying to come up to speed on Azure. So I might just be missing something obvious.

Any ideas?


4 Answer(s)
  • User Avatar
    0
    JeffMH created

    For Azure, create a blank database first through the Portal.

    Then, inside the AspNetZero solution, under tools, there is a Migrator project. Change the connection string within that project to point to your Azure DB, run it.

    Hope that helps a little.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @JeffMH :). We do it this way as well.

  • User Avatar
    0
    sh0knah created

    Brilliant! Works great! Thank you so much!

    ASP.NET Zero is a great framework. But the community is equally great.

    For any one reading this message later, make sure you authorize your client IP address to Azure SQL Database before you do this.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @Sh0knah :)