共用方式為


ASP.NET Provider Scripts for SQL Azure

If you want to use the ASP.NET Providers (membership, role, personalization, profile, web event provider) with SQL Azure, you'll need to use the the following scripts or aspnet-regAzure.exe tool to setup the database: https://support.microsoft.com/default.aspx/kb/2006191

Currently the only provider which is not supported on SQL Azure is the session state provider.

Personally, I like using SSMS 2008 R2 to connect to SQL Azure and using the Query window to run the scripts. (if you already have SSMS 2008 installed, you can use that as well, just connect from the Query window itself, not the Object Explorer as that will fail)

Note: I use SQL Server Authentication with the following credentials:

  • Server name: <servername>.database.windows.net
  • Login: <username>@<servername>)

Comments

  • Anonymous
    December 07, 2009
    How do you get the providers to use a connection string specified in the cscfg file instead of web.config?

  • Anonymous
    December 08, 2009
    You can modify the source code that does the lookup or you can use the workaround below: This key: internal static readonly string DefaultBlobStorageEndpointConfigurationString = "BlobStorageEndpoint"; Is only used in TryGetAppSettings, where it looks from web/app.config rather than cscfg:                blobBaseUri = Configuration.TryGetAppSetting(Configuration.DefaultBlobStorageEndpointConfigurationString); If the key cannot be found in web/app.config, another key name is used: blobServiceBaseUri. This time, it searches from cscfg: _blobServiceBaseUri = Configuration.GetStringValue(config, "blobServiceBaseUri", null, true);                ret = RoleEnvironment.GetConfigurationSettingValue(configName); So the simples fix is to add three new keys in csdef and cscfg: sharedKey, blobServiceBaseUri, and tableServiceBaseUri.

  • Anonymous
    December 15, 2009
    That's what I had done to get the Azure providers to read from cscfg, but I am trying to figure out how to get the ASP.NET providers (using SQL Azure, not Azure Table Storage) to read from cscfg. Thanks.

  • Anonymous
    December 15, 2009
    Oh I see, you won't be able to switch that without re-writing the actual provider as the SQL Server based providers don't know about the cscfg file.