Skip to main content
Tutorial

Use Azure SQL Single Database

  • Dec 16, 2022 12:03 PM UTC
  • 0 replies
  • 10 views

Forum|alt.badge.img

Azure SQL Single Database is a fully managed, database-as-a-service in the Microsoft Azure Cloud.

This service is always running the latest SQL Engine, never require patches or updating and can be deployed in minutes.

When configured using the "Serverless" Compute Tier, the database can even scale and pause automatically based on workload.

It is an ideal solution for most cloud-based data warehouses utilizing fewer than billion row tables and requiring less than several terabytes of storage. 

In this article you will learn how to:

 

Configure an Azure SQL Database

 

Create an Azure SQL Database. Using the "Serverless" Compute Tier, the database can even scale and pause automatically based on workload.

Note: There are two common issues when using Serverless tier with TimeXtender:

  1. Initial Execution may fail when Serverless is set to 0.5 - to fix this issue, set it to be Min 1 vCore. It can be a good idea to enable retires in your execution package with a 2-3 minute delay as well.
  2. Repeat executions may fail when serverless is scaling.  This is because the processing speed at lower vCores is still too slow.  To fix it, ensure the Min vCores is raised to a reasonable limit, or very close to the Max vCores.

 

Configure SQL users & Permissions

 

You will need to create users in Azure SQL Database with the necessary permissions. Alternatively, you can use Azure Active Directory.

 

Setup a ODX Instance to use a shared Azure SQL Database

 

  1. Give the ODX Instance a name
  2. Change the Storage type to Azure SQL database storage
  3. Add the Server name.
  4. Add the name of your Azure SQL Database created in previous steps.
  5. Add a SQL Server Authentication user name and the password of this.
  6. Set the Connection timeout to 60 or 120.
  7. Set the Command timeout to 1800 or 3600. That is 30 minutes or an hour.
  8. If you want Azure AD members to be located in the security setup turn on this checkbox.
    1. Add the company's Tenant id. Find Tenant ID
    2. Add an Application Client ID in the Application ID.

      The basic rights are enough, but for full access you will need the ones requiring Admin Consent.

    3. Add the Secret key of the App you have created.

 

Setup a Data Warehouse instance in a shared Azure SQL Database

 

  1. Add the instance name you want the DWH instance to have
  2. Add the server name.
  3. Add the name of your Azure SQL Database created in previous steps.
  4. Set Authentication to SQL Server authentication and add the user and password for this.
  5. Set the Command timeout to a higher value such as 1800 equal 30 minutes.

Once this is saved you can connect to it in TimeXtender.

To use it click on the instance and open it.

When it is open you can add Data Areas. Each area will automatically use the name you give the area as the schema, but otherwise it will share the same database. It will also automatically use Direct Read between these.

 

Allow read access to the Database

 

The first step in the process is to give admin privileges to the user making the initial changes.

Learn More in Microsoft Docs

  1. Identify the SQL Server instance in your resource group where the database is.
  2. Inside the instance click on the Azure Active Directory in the settings tab.
  3. To set your user as the admin click on the Set admin option-> Search and select the name in the dialogue box.
  4. In your SSMS Login to the Azure SQL as the Azure Active Directory admin specified above
  5. Run the below script in SSMS in the same instance-
    1. CREATE USER [Azure AD Group Name] FROM EXTERNAL PROVIDER;
  6. In TimeXtender desktop application where the Azure SQL DB, expand Security right click on the Database Role to Add: Add Database Role ➡ Add Manually ➡ Enter the same AD Group Name used in the SSMS
  7. To Provide the users in the Group access to only the valid schemas, right click Database Roles ➡ Object Security Setup ➡ Click on Schemas and check UserAccessRole to the valid schema
  8. Deploy the security tab

 

Optionally, to give the users read access to all the tables in the database, run the below script in SSMS

EXEC sp_addrolemember 'db_datareader',  ‘AD Azure Group’;