Thursday, August 26, 2010 1:58 AM
I would like to test authentication on my dev machine, and I believe this only works when you deploy the app?
So here's my situation. Prior to installing LS I did not have SQL Server installed, now I do. I'm a domain administrator. I used SSMS to login, create a database, add some tables, import some data etc. I created a test LS app, connected to the DB, wrote some queries etc. and now ready to go.
When I start the deployment wizard i'm asked first where to create the website. I haven't got Web Deployment Tool installed so I created a package on disk. Next comes the question: Will this be a new database or update an existing. The answer is neither, I want the existing database left as-is.
As I don't have a third choice, and I don't have another SQL instance kicking around I chose new database and gave it a name. The next option about authentication I picked yes, as I believe this is not already set-up.Finally the Connection Settings are shown which look correct as they are pointing to my existing data source.
After publishing the app I go to IIS Admin, create a new application and select deploy, import, choose the the zip file and select the contents. All items are ticked by default so I just leave them alone and click next.
Then comes the fun bit. I'm first asked to enter the name of the Database Server. What would that be? Further down in the config the connection string already specifies the server so i'm puzzled here? Anyway I enter the same server: .\SQLEXPRESS.
Next is the primary database. As I had to choose a new database instead of not doing anything at all, which was my preferred option, I had to pick a new database name. This value is entered here.
Then comes the database user & password. As I mentioned earlier the SSE was installed automatically. I didn't configure it in any way. I logged in using Windows Authentication. So I don't have a user/password. I don't appear to be able to create the new database using Windows Authentication.
That's about as far as I get. The issue is that I don't want to copy the database, but as i'm forced to do so I then need to configure SSE logins to be able to continue. If I skip the database stuff and just deploy the app, the authentication is not configured so I can't run it.
I only wanted to deploy anyway because authentication does not work during development so I think a scenario has been overlooked here for development/testing.
Thursday, August 26, 2010 2:10 AM
I also tried another option of selecting update existing database and gave the connection string of my existing database. I connected and checked using Test Connection, then stepped through and completed the wizard. At the end I got the following error:
An exception occurred when publishing the database for the application. Cannot open database "Application1" requested by the login. The login failed. Login failed for user 'EXALTGROUP\ndobson'.
Am I right in thinking that for deployment the database must be moved from the local SSE instance to another?
Surely in most scenarios, apart from first configuring authentication, there is no need to move around any data but just configure the connection strings?
Tuesday, August 31, 2010 7:59 PM
Thanks for the questions Neil. I will see if I can help. As a note we are aware that the package based deployment experience isn't ideal and the feature team is currently considering ways that we might make that easier. First things first the spot that you end up at where it is asking for a user name and password uncovered a bug. We don't have a way for you to use Integrated Security (the default for your SSE instance) in the deployment step. More details on the rest of the mail appear below.
First I didn't see whether you chose Windows Auth or Forms Auth for your LS app (this is set on the Application Properties pages of your LS app). The choice doesn't make a huge difference for the prupose of this explanation but I wanted to just mentions that.
The New vs Existing question in the wizard refers specifically to the intrinsic database that is maintained by every LS application. Even in the event that you only attach to an existing DB (as you did here) we maintain a DB behind the app to store our application authentication database. For the first deployment of the application you are almost always going to want to select the "New Database" option as you won't have one created yet. If you are publishing an update to an existing app the "Use Existing" option makes more sense. We never touch an attached DB so you shouldn't worry about us messing with your existing tables, etc through your choice on this page of the wizard.
Your Authentication page question is similar to that of the Database. We want to know if we should add an Admin user to the authentication store. The first time you publish the application there won't be one available so you want to choose Yes so that we can add it. If you were publishing directly from the IDE rather than the package we would prompt you in the wizard for the name of the admin user (and a password in the event you are using Forms auth). Since you published to a package we don't ask for this information in the wizard since we want to avoid storing that data in the package for security reasons. We defer that until you run the package (which is the username/password prompt you receive, more on that in a bit). Once again if you are publishing an update to an exisiting app you probably want to say No to this question as you have most likely already setup Admin users and don't need to add another one.
Now the fun part as you point out, running the package. The first prompt for a database server refers to the server that will host the built in database for the LS app. This can point to any SQL Server 2005/2008 Server (or express version) where you would like to host the built in DB.
The first part of the information you are prompted for defines the server on which you would like the builtin DB to live. We appear to have a bug that prevents you from being able to use Integrated Security while deploying the built in database. You would need to enable SQL Auth on the SSE DB. We have logged an issue on our side to help address this. You will then be prompted for the connections strings for your primary data source (the built in DB) and any datasources you attached to (incase they need to change connection strings between your development and production environments). Lastly we ask you for the information that identifies the initial Admin user you want for your DB.
I hope this helps.
Kris Langohr | SDET Lead | LightSwitch QA
- Marked As Answer by Beth MassiMicrosoft Employee, Owner Wednesday, September 08, 2010 6:18 PM