This project is read-only.

Azure Deployment

Oct 2, 2012 at 1:12 PM
Edited Oct 2, 2012 at 1:17 PM

I was wondering if anyone had had any luck getting this to deploy to Azure.

I changed the EntityPersistorInstaller.EntityCodeFirstConfig datasource to the azure database connection.

I also updated the following section in the web.config which i'm not sure makes a difference or not :

<entityFramework>   

 <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework">      <parameters>       

<parameter value="Data Source=.\MSSQLSERVER2008; Integrated Security=True; MultipleActiveResultSets=True" />     

</parameters>   

</defaultConnectionFactory> 

</entityFramework>

 

So far I am just getting an internal server error which i am trying to troubleshoot.

Oct 2, 2012 at 1:49 PM

I have certainly run Naked Objects MVC on Azure  -   and can think of no reason why Restful Objects for .NET should be any different, since the latter is just an alternative 'viewer' for the former, and is also built on MVC.  See this blog posting: http://blog.nakedobjects.net/?p=127   (ignore the comment about 'licensed version' as this was before we went open source).  Note, however, that that was using an earlier version of ASP.NET MVC, so the configuration details will have changed.

Oct 2, 2012 at 2:33 PM

In the blog that you linked it looked like the database was already setup rather than getting EF to create it.

I will try this as well as potentially it may be having problems creating the database in Azure.

If I set CodeFirst to false in the EntityPersistorInstaller, I assume it does not need the CodeFirstConfig anymore and it gets its connection from web.config ?

Oct 2, 2012 at 2:39 PM

"I will try this as well as potentially it may be having problems creating the database in Azure."

That could well be.

"If I set CodeFirst to false in the EntityPersistorInstaller, I assume it does not need the CodeFirstConfig anymore and it gets its connection from web.config ?"

Correct, but FYI please note that in Naked Objects 5.0  (released a couple of hours ago!) the approach to configuring for Code First has changed.  (Approach for Model First or Database first is unchanged).

Oct 2, 2012 at 6:43 PM

I finally got this working using codefirst , you have to break out the connection string that azure gives you to get it to work :

Azure Connection String from management portal :

Server=tcp:<host>.database.windows.net,1433;Database=<db>;User ID=<user>@<host>;Password=<pass>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30;

This translates into following for codefirst constructor :

CodeFirstConfig = new[] {
                    new EntityPersistorInstaller.EntityCodeFirstConfig {AssemblyName = "Model", 
                        DataSource = @"tcp:<host>.database.windows.net,1433",
                        Security=@"User ID=<user>@<host>;Password=<pass>;Trusted_Connection=False;Encrypt=True;Connection Timeout=30",
                        DatabaseName = "<db>"}}