Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting simple membership to work with azure web sites

I am wanting to use the simple membership providers as if i was connecting to a local mdf file for this mvc project, except i want the memebership tables on the free azure trial db

UserProfile
webpages_membership
webpages_OAuthMembership
webpages_Roles
webpages_UsersInRoles

how should the connection string look for making this connection.

when connecting locally to a local mdf it works like the cats ass, but trying to get the tables built on azure is not well documented.

anyone done this?

ok i needed to make sure the conn string name was the same as the one being passed into the WebSecurity.InitializeDatabaseConnection method of the Filters > InitializeSimpleMembershipAttribute.cs file, by default it is DefaultConnection so it must align with the connection string you give it in azure db conn string.

so now i have f5'd out of VS and the tables get created, i even locally tested my facebook login and it works.

but... when i deploy the application to azure web sites, the site times out with a 504 error like it can't connect to sql, this happens to me for both the sql database within Azure as well as i spun up a virtual server that had sql installed and enabled the tcp port 1433 - like i said this works locally when i run out of VS, just not up on the azure cloud.

i get Error.

An error occurred while processing your request.

fiddler shows it as a 504 error gateway timeout. Anyone got an mvc 4 site running on Azure with the simple login membership api?

like image 333
Biz Brown Avatar asked Nov 24 '12 02:11

Biz Brown


1 Answers

ok there are 2 places the connection string needs to be changed, the one from the InitializeSimpleMembershipAttribute.cs and the one in the AccountModels.cs file public UsersContext() : base("DefaultConnection") { } swap out DefaultConnection with your conn string name

like image 110
Biz Brown Avatar answered Oct 03 '22 06:10

Biz Brown