Ideally, I'd like to use Azure table storage as the provider, but SQL Azure will also work. Anything I've dug up so far is over a year old, using deprecated approaches. I.e., outdated code samples, SDKs and IDEs.
As the title states, this would be applied to an MVC2 app running in Azure. Examples, code, 开发者_如何学Golinks, etc. do not necessarily have to be for MVC. Anything related to a .Net 4.0 web app using Forms Authentication on Azure will do.
Microsoft originally released a set of sample providers with the PDC08 SDK - but these definitely are not recommended for commercial use.
Recently this project has produced some new ones - http://azureproviders.codeplex.com/ - I'd recommend going with that one as it is "live code" - you might also be able to contribute something back to it.
If you do use these providers, please be aware that Azure charges per transaction - at a base rate of $0.01 per 10000 transactions - and that the logic within these providers can cause "quite a few" transactions to occur. So if your site is busy and has a lot of membership activity, then it could work out quite expensive to operate.
If you are using SQL Azure membership, then the membership SQL is standard - http://support.microsoft.com/kb/2006191 - the only differences in the ASP SQL scripts is in the Session storage (since Session uses SQL Agent to clear sessions - and SQL agent is not supported on SQL Azure)
Personally, I've use the Table storage for test/demo sites - but for anything "real" I've moved towards SQL Azure - it's easier to query, to run reports, to backup, etc
Unfortunately, unless you role your own provider, the only sample I have seen is the outdated one you mentioned. For user authentication (RoleProvider), it is not too bad (i.e. no bugs I have heard about). However, for Session state, it has some issues. I don't think it does any sort of encryption however, so the passwords might be in plaintext. Worst case scenario, you could at least use it as starting point for your own.
A quick look around and I can't even find the 'Additional Samples' anymore. They might have been lost when Code Gallery did an update awhile back. I know it is still used in http://phluffyfotos.codeplex.com, so you could pull it from the source there at least.
I would not use ATS Forms authentication, because of transaction cost associated, if your site is going to have alot of authentication requests (even token authorization requires check against ATS)
I would use Forms Authentication against SQL Azure with standard SqlMembershipProvider
It works just fine. I've manually migrated necessary aspnet tables & stored procs over to SQL Azure from a local SQL server instance without problems. Just update the aspnet_schemaversions table to have this content:
common 1 1
membership 1 1
personalization 1 1
profile 1 1
role manager 1 1
精彩评论