Base solution for your next web application
Open Closed

Deploying to Azure? Read this #1026


User avatar
0
manifestarium created

So for as long as I've used this framework, I've been baffled as to why I couldn't seem to get any of the samples or a fresh template solution to deploy to Azure and perform migrations. I solved the problem, but I continued thinking I was missing something and that others were doing this successfully.
After reading some forum posts on the subject, I think this just hasn't been confronted yet by the framework's developer. So, here's how you can get your solution to work like you expect on Azure: (Xyz = Name of your app)

  • In your Xyz.EntityFramework.XyzDbContext class > default constructor: DON'T pass "Default". Pass the full namespace and name of the context class. The publish wizard doesn't pick up on the DbContext unless you put it in the Web project directly, UNLESS your connection string in web.config has the same name as the DbContext. That's right, "Xyz.EntityFramework.XyzDbContext" needs to be your connection string name, and the value you pass to the default constructor. You may want to just backup and delete the publishing profile you're working with and create a new one after you make those changes, so it's configured correctly.

1 Answer(s)
  • User Avatar
    0
    apexdodge created

    ...I've had no issues with ABP and Azure Web Apps at all, but maybe it's because of the way I deploy my database.

    My recommendation is to load up sql management studio and export your local database by doing Export Data Tier Application. Then connect to your Azure Database Server also and Import Data Tier Application (the one you just exported). In Visual Studio, do a Web Deploy and choose your Azure Web App and also your DB. It should automatically detect your database. Deploy, and you're good to go.

    No need to futz around with the code to get it to work at all.