官术网_书友最值得收藏!

  • ETL with Azure Cookbook
  • Christian Cote Matija Lah Madina Saitakhmetova
  • 947字
  • 2021-06-11 18:02:38

Creating a SQL Azure database

To do ETL, we need to have a source to query data and a target (often called a sink) to land the transformed data. Our first recipe will create a simple SQL Azure database that will be used as both the source and sink in all recipes of this chapter.

Getting ready

In Chapter 1, Getting Started with Azure and SSIS 2019, you were shown how to install SQL Server on-premises, SQL Server Management Studio (SSMS), and Visual Studio 2019 with the SSIS extension. This chapter will show you how to set up SQL Server in Azure and the recipes will use this version of SQL Server.

How to do it…

In a browser, go to the Microsoft Azure portal using the following URL: https://portal.azure.com/#home.

On the main portal page, we'll create a resource group to group all Azure services together. It's much easier to find and manage them later.:

  1. From the main portal page, click on the + sign to create a new resource, as shown in the following screenshot:

    Figure 2.1 – Create a resource in Azure

  2. In the search box, type resource. Click on the search result Resource group that appears, as in the following screenshot:

    Figure 2.2 – Choose Resource group from the search list

  3. In the Resource group blade, click Create to create a new resource group, as shown in the following screenshot:

    Figure 2.3 – Create a resource group after selection

  4. Select the subscription, give the resource group a name, and choose the region, as shown in the following screenshot:

    Figure 2.4 – New resource group properties

    The region you select here will be the default for all the resources you create in the resource group in the future. Ideally, you should choose a location not too far from where you live. We can always override this setting in each resource we create in the future.

    Click on Review + create at the bottom left of the blade to validate the entries we made. Once validated, click Create to create the resource group.

  5. Once the resource group is created, click Go to resource group from the activity log message that is displayed. Or you can click on Home on the left-hand menu and click on your resource group in the Recent resource list. Once in the resource group, click on Create resources as shown in the following screenshot:

    Figure 2.5 – Add a resource to a resource group

  6. From the blade that appears, select Databases on the left and click on SQL Database as shown in the following screenshot:

    Figure 2.6 – Select SQL Database

  7. The Create SQL Database blade opens. Set the properties as shown in the following screenshot:

    Figure 2.7 – Database properties

    Let's look at the database properties:

    a) Subscription: Your subscription.

    b) Resource group: EtLInAzureCookBook or the resource group created before.

    c) Database name: We're going to restore a sample database that will be used in future recipes. We'll name it AdventureWorksLT.

    d) Server: Click on Create new below the combo list. The New server blade appears:

    Figure 2.8 – New server properties

    Let's look at the server properties:

    a) Server name: You should use something like <yourname> etlinazurecookbook all in lower case. Here's the reference from Microsoft for SQL Server naming: https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/resource-name-rules#microsoftsql.

    b) Server admin login: ETLAdmin.

    c) Password: Create a password.

    d) Confirm password: Confirm the password created.

    e) Location: Select an Azure location. You should use the same region as the resource group created before.

    f) Click on OK to create the server.

    g) Back in the database creation blade, set the SQL elastic pool option to No.

    h) Compute + Storage: Click on the Configure database link. We'll select the Basic configuration for now.

    i) From the Configure blade, click on the Looking for basic, standard, premium? link as shown in the following screenshot:

    Figure 2.9 – Change server capacity

    • Select Basic.
    • On the Create SQL Database blade, click on Networking. The Networking blade appears as shown in the following screenshot:

Figure 2.10 – Server Networking blade

  • Set Connectivity method to Public endpoint.
  • In the Firewall rules section, set Allow Azure services and resources to access this server to Yes. This will be needed in later chapters when we use Azure services such as Azure Data Factory.
  • Also, set Add current client IP address to Yes. This will whitelist your current PC IP address and therefore allow you to connect to the database using SQL Server Management Studio (SSMS) and SQL Server Integration Services (SSIS).
  • Click on Additional settings.
  • The Additional settings blade appears. In the Use existing data setting, click on Sample as shown in the following screenshot:

Figure 2.11 – Server Additional settings

  • Click on Review + create and then Create to create the database.
  1. Now, we'll check whether the sample database has been created correctly. Go into the resource group and click on the AdventureWorksLT (etlinazurecookbook/AdventureWorksLT) resource. The database blade opens. As shown in the following screenshot, click on Query editor (preview):

    Figure 2.12 – Database query editor

    Enter the login and password. The query editor opens. Expand the Tables folder, right-click on any table, and click Select Top 1000 Rows from the submenu that appears, as shown in the following screenshot:

    Figure 2.13 – Database Select Top 1000 Rows

  2. Click the Run button to execute the query.

Let's move on to the next section!

How it works…

We created a SQL server in Azure and we stored a sample database on it: AdventureWorksLT. Everything was done using a web browser, with no need to install anything on a PC. The next recipes will show how to use that database with on-premises software.

主站蜘蛛池模板: 黔江区| 蓬安县| 庆云县| 潜山县| 阜宁县| 上蔡县| 高雄县| 汪清县| 淄博市| 察隅县| 柞水县| SHOW| 新沂市| 苏尼特左旗| 扶沟县| 奉节县| 东乡族自治县| 建湖县| 手游| 麻栗坡县| 拜城县| 瓮安县| 大足县| 沾益县| 阳江市| 乐亭县| 呈贡县| 石城县| 阜城县| 南丹县| 东光县| 灵山县| 博客| 旌德县| 宝鸡市| 庄河市| 台前县| 万山特区| 南阳市| 潼南县| 特克斯县|