添加链接
link之家
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

Azure SQL Database is an intelligent, scalable, relational database service built for the cloud. SQL Database is a fully managed platform as a service (PaaS) database engine that handles most database management functions such as upgrading, patching, backups, and monitoring without user involvement.

Using an Azure free account, you can try Azure SQL Database for free for 12 months with the following monthly limit :

  • 1 S0 database with 10 database transaction units and 250 GB storage
  • This article shows you how to create and use an Azure SQL Database for free using an Azure free account .

    Prerequisites

    To try Azure SQL Database for free, you need:

  • An Azure free account. If you don't have one, create a free account before you begin.
  • Create a database

    This article uses the Azure portal to create a SQL Database with public access. Alternatively, you can create a SQL Database using PowerShell, the Azure CLI or an ARM template .

    To create your database, follow these steps:

  • Sign in to the Azure portal with your Azure free account.

  • Search for and select SQL databases . Select + Create .

  • On the Basics tab of the Create SQL Database form, under Project details , select the free trial Azure Subscription, for example, Azure subscription 1 .

  • For Resource group , select Create new , enter myResourceGroup , and select OK .

  • For Database name , enter mySampleDatabase .

  • For Server , select Create new , and fill out the New server form to create a new Azure SQL Database logical server. Use the following values:

  • Server name : Enter mysqlserver , and add some characters for uniqueness, for example, today's date. We can't provide an exact server name to use because server names must be globally unique for all servers in Azure, not just unique within a subscription. So enter something like mysqlserver12345 , and the Azure portal lets you know if it's available or not.
  • Choose a desired Location for the logical server from the dropdown list.
  • For Authentication method , choose Use both SQL and Azure AD authentication to configure both SQL Authentication and Azure Active Directory authentication.
  • Select yourself as the admin for Set Azure AD admin . You can also choose a group.
  • Server admin login : Enter azureuser for the SQL authentication server admin login.
  • Password : Enter a password that meets complexity requirements, and enter it again in the Confirm password field.
  • Select OK .

  • Leave Want to use SQL elastic pool? set to No .

  • Under Compute + storage , select Configure database .

  • For the free trial, under Service Tier select Standard . Set DTUs to 10 and Data max size (GB) to 250 , and then select Apply .
  • Select Next: Networking at the bottom of the page.

  • On the Networking tab, for Connectivity method , select Public endpoint .

  • For Firewall rules , set Allow Azure services and resources to access this server set to Yes and set Add current client IP address to Yes .

  • Leave Connection policy set to Default .

  • For Encrypted Connections , leave Minimum TLS version set to TLS 1.2 .

  • Select Next: Security at the bottom of the page.

  • Select Next: Additional settings at the bottom of the page.

  • On the Additional settings tab, in the Data source section, for Use existing data , select Sample . This creates an AdventureWorksLT sample database so there are some tables and data to query and experiment with, as opposed to an empty blank database.

  • Select Review + create at the bottom of the page.

    Important

    While creating the SQL Database from your Azure free account, you will still see an Estimated cost per month in the Compute + Storage : Cost Summary blade and Review + Create tab. But, as long as you are using your Azure free account, and your free service usage is within monthly limits, you won't be charged for the service. To view usage information, review Monitor and track free services usage later in this article.

  • When the deployment is complete, select Go to resource .

    Query the database

    Once your database is created, you can use the Query editor (preview) in the Azure portal to connect to the database and query data.

  • In the portal, search for and select SQL databases , and then select your database from the list.

  • On the page for your database, select Query editor (preview) in the navigation menu.

  • Enter your SQL server authentication server admin login information or use Azure Active Directory authentication .

  • Enter the following query in the Query editor pane.

    SELECT TOP 20 pc.Name as CategoryName, p.name as ProductName
    FROM SalesLT.ProductCategory pc
    JOIN SalesLT.Product p
    ON pc.productcategoryid = p.productcategoryid;
    
  • Select Run, and then review the query results in the Results pane.

    Monitor and track service usage

    You are not charged for the Azure SQL Database included with your Azure free account unless you exceed the free service limit. To remain within the limit, use the Azure portal to track and monitor your free services usage.

    To track usage, follow these steps:

  • In the Azure portal, search for Subscriptions and select the free trial subscription.

  • On the Overview page, scroll down to see the tile Top free services by usage, and then select View all free services.

    Meter Identifies the unit of measure for the service being consumed. For example, the meter for Azure SQL Database is SQL Database, Single Standard, S0 DTUs, which tracks the number of S0 databases used per day, and has a monthly limit of 1. Usage/limit The usage of the meter for the current month, and the limit for the meter. Status The current status of your usage of the service defined by the meter. The possible values for status are:
    Not in use: You haven't used the meter or the usage for the meter hasn't reached the billing system.
    Exceeded on <Date>: You've exceeded the limit for the meter on <Date>.
    Unlikely to Exceed: You're unlikely to exceed the limit for the meter.
    Exceeds on <Date>: You're likely to exceed the limit for the meter on <Date>.

    Important

  • With an Azure free account, you also get $200 in credit to use in 30 days. During this time, any usage of the service beyond the free monthly amount is deducted from this credit.
  • At the end of your first 30 days or after you spend your $200 credit (whichever comes first), you'll only pay for what you use beyond the free monthly amount of services. To keep getting free services after 30 days, move to pay-as-you-go pricing. If you don't move to pay as you go, you can't purchase Azure services beyond your $200 credit and eventually your account and services will be disabled.
  • For more information, see Azure free account FAQ.
  • Clean up resources

    When you're finished using these resources, you can delete the resource group you created, which will also delete the server and single database within it.

    To delete myResourceGroup and all its resources using the Azure portal:

  • In the portal, search for and select Resource groups, and then select myResourceGroup from the list.
  • On the resource group page, select Delete resource group.
  • Under Type the resource group name, enter myResourceGroup, and then select Delete.
  • Next steps

    Connect and query your database using different tools and languages:

    Connect and query using SQL Server Management Studio

    Connect and query using Azure Data Studio

  •