Sky Chess--Website and users

Source: Internet
Author: User
Tags administrator password management studio sql server management sql server management studio

The previous article "Sky Chess-rushed to the skies" describes how to publish the Sky Chess algorithm service to Azure, as well as provide a chess client that uses the cloud service. The mission is to create a website for Sky Chess on Azure and provide user registration and login capabilities. The following points of knowledge are involved:

    • Create a Web site on Azure
    • Publishing a custom Web site using Visual Studio
    • To connect to an Azure database server by using SQL Server Management Studio
    • Provide membership services for the website

Create a Sky Chess website

Login to the Azure management website, click "+new", "COMPUTE", "WEB SITE", "CUSTOM CREATE" menu. In the pop-up Site Settings screen, url input skychess,region select East Asia. Then click Create WEBSITE, and a website will be built in a few minutes.

Access the newly created site "http://skychess.azurewebsites.net/" with only a few preset prompts.

There are four free, shared, basic, and standard ways to work with azure websites. You can view the working mode on the "Scale" settings page of your website. The current web holsting PLAN mode is "free", that is, freeware mode.

The features of the four modes are briefly described as follows:

    • Sharing mode: Azure maintains a pool of virtual machine resources, all shared-mode sites are deployed on virtual machines in resource pools, and the same virtual machine may be shared by multiple users. Sharing mode has a CPU usage limit that cannot exceed 240 minutes per day. The model is cheap.
    • Free mode: free sharing mode. Each azure subscription is limited to 10 free-mode sites, and the site traffic cannot exceed 165MB,CPU usage time per day for more than 60 minutes.
    • Basic mode: Configurable instance size and number of instances.
    • Standard mode: Automatic scaling can be configured.

In addition to the above CPU, instances, traffic differences, there are custom domain names, SSL, storage, database and other differences, you can refer to the official Azure documentation.

Publishing Sky chess with Visual Studio

Use Visual Studio Update 4 to create an ordinary "ASP. NET Web Forms Application" website that modifies text content such as the title of the website.

On Skychess's "DASHBOARD" Administration page, click on the "Download the Publish Profile" link to download the release profiles.

In Visual Studio, select the publishing site, click Import in the Publish Page window, and select the Publish profile you just downloaded.

After importing the configuration file, you can view the configuration information and click the "Publish" button to publish it. In the automatic pop-up browser window, you can see the homepage of the website and publish successfully.

If you click "Register" or "login" now, the website will error, because the membership database has not been configured yet.

To connect to an Azure database server by using SQL Server Management Studio

Go to the "SQL databases–> SERVERS" page and create a database server from the wizard. In order to connect to the Azure database server using SQL Server Management Studio, you need to set up a firewall for that server.

You can see the IP address of the current client by going to the "CONFIGURE" page of the database server. Clicking "Add to the allowed IP ADDRESSES" quickly adds the IP address to the list of allowed IP addresses.

Open SQL Server Management Studio (SP2) to open the Connect to server window. which

    • The server name is "Servername.database.windows.net", and servername is a randomly generated string of random numbers or letters when creating SQL database server name
    • The login name is "[email protected]", username is the administrator user name set when creating the server
    • Password is the administrator password set when creating the server

Clicking the "Connect" button sometimes causes an error, and the basic information is that an IP address is not added to the list of allowed IP addresses. Although the allowed IP addresses have been added through the configuration page, the IP addresses displayed on the configuration page may not necessarily be the IP addresses that the client eventually accesses to Azure, due to proxies, and so on. In this case, simply add the IP address you are prompted to to allow access to the list.

Once the connection is successful, you can use the familiar SQL Server Management studio to manipulate the SQL Azure database.

Provide membership services for the website

The ASP. NET Membership service is based on a SQL database with the default name of ASPNETDB. In the past you can create with Aspnet_regsql.exe. Because some of the traditional SQL scripts are not fully compatible on Azure SQL, you need to use specific scripts or tools to create the membership service database used on Azure.

Visit http://support.microsoft.com/kb/2006191 for more information and to download SQL scripts to initialize the SQL Azure membership database.

Run Installazure.sql before downloading to create an empty ASPNETDB database. Then select the newly created database, and then run the Installcommon.sql and Installmembership.sql scripts in turn. After running, you can view the tables, views, and stored procedures created by the script in the ASPNETDB database.

Return to Visual Studio for site publishing, fill in the Aspnetdb connection string in DefaultConnection, and republish.

Try to register and login on the website, the website works normally.

Sky Chess--Website and users

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.