Skip to main content

Scenario 2 - Single Azure Virtual Machine on Azure SQL DB

Written by Giuseppe

Step 1: Create a Windows virtual machine in an availability zone with an Azure portal

based on the Microsoft article

Note: This process uses the Azure portal to create a virtual machine in an Azure availability zone. An availability zone is a physically separate zone in an Azure region. Use availability zones to protect your apps and data from an unlikely failure or loss of an entire data center.

To use an availability zone, create your virtual machine in a supported Azure region.

Log in to the Azure portal at https://portal.azure.com. Click Create a resource in the upper left-hand corner of the Azure portal. Select Compute, and then select Windows Server 2016 Datacenter. Enter the virtual machine information. The user name and password entered here are used to log in to the virtual machine. The password must be at least 12 characters long and meet the defined complexity requirements. Choose a Location such as East US 2 that supports availability zones. When complete, click OK.

Choose a size for the VM. Select a recommended size or filter based on features. Confirm the size is available in the zone you want to use.

Under Settings > High availability, select one of the numbered zones from the Availability zone dropdown, keep the remaining defaults, and click OK.

On the summary page, click Create to start the virtual machine deployment. The VM will be pinned to the Azure portal dashboard. Once the deployment has been completed, the VM summary automatically opens. Confirm zone for managed disk and IP address When the VM is deployed in an availability zone, a managed disk for the VM is created in the same availability zone. By default, a public IP address is also created in that zone. You can confirm the zone settings for these resources in the portal. Click Resource groups and then the name of the resource group for the VM, such as myResourceGroup. Click the name of the Disk resource. The Overview page includes details about the location and availability zone of the resource.

Click the name of the Public IP address resource. The Overview page includes details about the location and availability zone of the resource.

Step 2: Create an Azure SQL database based on Microsoft article

Based on the Microsoft article

Azure SQL Database is a Database-as-a-Service offering that enables you to run and scale highly available SQL Server databases in the cloud. In this process, using Azure portal and SQL Server Management Studio (SSMS) will allow you to:

  • Create a database in the Azure portal

  • Set up a server-level firewall rule in the Azure portal

  • Connect to the database with SSMS

  • Create tables with SSMS

  • Query data with SSMS

Note: Please make sure that the latest version of SQL Server Management Studio has been installed.

Sign in to the Azure portal. Follow these steps to create a blank SQL database.

Note: An Azure SQL database is created with a defined set of compute and storage resources. The database is created within an Azure resource group and in an Azure SQL Database logical server.

1. Click Create a resource in the upper left-hand corner of the Azure portal.

2. On the New page, select Databases in the Azure Marketplace section, and then click SQL Database in the Featured

3. Fill out the SQL Database form with the following information, as shown on the above screenshot:

Setting       Suggested value

Database name your database (ie: NavoriSQL)

Subscription your subscription

Resource group yourResourceGroup

Select source Blank database

4. Click Server to use an existing server or create and configure a new server for your database. Either select the server or click Create a new server and fill out the New server form with the following information:

Setting       Suggested value

Server name Any globally unique name

Server admin login Any valid name

Password Any valid password

Location Any valid location

Click Select.

5. Click Pricing tier to specify the service tier, the number of DTUs or vCores, and the amount of storage. You may explore the options for the number of DTUs/vCores and storage that is available to you for each service tier. By default, the Standard DTU-based purchasing model.

Note: More than 1 TB of storage in the Premium tier is currently available in all regions except the following: UK North, West Central US, UK South2, China East, USDoDCentral, Germany Central, USDoDEast, US Gov Southwest, US Gov South Central, Germany Northeast, China North, US Gov East. In other regions, the storage max in the Premium tier is limited to 1 TB

After selecting the appropriate service tier, the number of DTUs, and the amount of storage, click Apply.

6. Enter a Collation for the blank database (for this process, we use the default value).

7. Now that you've completed the SQL Database form, click Create to provision the database. This step may take a few minutes.

8. On the toolbar, click Notifications to monitor the deployment process.

Create a firewall rule The SQL database service creates a firewall at the server level. The firewall prevents external applications and tools from connecting to the server and any databases on the server. To enable external connectivity to your database, you must first add a rule for your IP address to the firewall.

Note: The SQL database communicates over port 1433. If you are trying to connect from within a corporate network, outbound traffic over port 1433 may not be allowed by your network's firewall. If so, you cannot connect to your Azure SQL Database server unless your administrator opens port 1433.

1. After the deployment completes, click SQL databases from the left-hand menu and then click your database on the SQL databases The overview page for your database opens, showing you the fully qualified Server name (such as yourserver.database.windows.net) and provides options for further configuration.

2. Copy this fully qualified server name for use to connect to your server and databases from SQL Server Management Studio.

3. Click Set server firewall on the toolbar. The Firewall settings page for the SQL database server opens.

a. Click Add client IP on the toolbar to add your current IP address to a new firewall rule. A firewall rule can open port 1433 for a single IP address or a range of IP addresses.

b. Click Save. A server-level firewall rule is created for your current IP address opening port 1433 on the logical server.

c. Click OK and then close the Firewall settings

Your IP address can now pass through the firewall. You can now connect to the SQL database server and its databases using SQL Server Management Studio or another tool of your choice. Be sure to use the server admin account you created previously.

Note: By default, access through the SQL database firewall is enabled for all Azure services. Click OFF on this page to disable all Azure services.

Connect to the database using SQL Server Management Studio Use SQL Server Management Studio to establish a connection to your Azure SQL database server.

1. Open SQL Server Management Studio.

2. In the Connect to Server dialog box, enter the following information:

Server name: The fully qualified server name (i.e. tcp:yourserver.database.windows.net,1433)

Authentication: SQL Server Authentication

Login: The server admin account

Password: The password for your server admin account

a. Click Options in the Connect to Server dialog box. In the Connect to database section, enter your database to connect to this database.

b. Click Connect. The Object Explorer window opens in SSMS.

3. In Object Explorer, expand Databases and then expand yourDatabase to view the objects in the sample database.

Step 3: Create the Azure storage account & container

based on Microsoft article

Note: This process includes the creation of BLOB storage, set up to be synchronized with QL Server €™s local storage. It serves as a backup and provides direct downloads, to reduce IIS €™ workload).

Every storage account must belong to an Azure resource group. A resource group is a logical container for grouping your Azure services. When you create a storage account, you have the option to either create a new resource group or use an existing resource group. This process shows how to create a new resource group.

A general-purpose v2 storage account provides access to all Azure Storage services: blobs, files, queues, tables, and disks. The process creates a general-purpose v2 storage account, but the steps to create any type of storage account are similar. To create a general-purpose v2 storage account in the Azure portal, follow these steps: In the Azure portal, select All services. In the list of resources, type Storage Accounts. As you begin typing, the list filters based on your input. Select Storage Accounts. On the Storage Accounts window that appears, choose Add. Select the subscription in which to create the storage account. Under the Resource group field, select Create new. Enter a name for your new resource group, as shown in the following image.

Next, enter a name for your storage account. The name you choose must be unique across Azure. The name also must be between 3 and 24 characters in length and can include numbers and lowercase letters only. Select a location for your storage account, or use the default location. Leave these fields set to their default values:

Field

Value

Deployment model

Resource Manager

Performance

Standard

Account kind

StorageV2 (general-purpose v2)

Replication

Locally redundant storage (LRS)

Access tier

Hot

Select Review + Create to review your storage account settings and create the account. Select Create.

Next, create a container within your storage account

All access to Azure Storage takes place through a storage account.

To create a container in the Azure portal, follow these steps:

  1. Navigate to your new storage account in the Azure portal.

  2. In the left menu for the storage account, scroll to the Data storage section, then select Containers.

  3. Select the “+ Container” button.

  4. Give your new container the name “mediaupload”. For more information about container and blob names, see Naming and referencing containers, blobs, and metadata.

  5. Set the level of public access to the container. The default level is Private (no anonymous access).

  6. Select “Create” to create the container.

Screenshot showing how to create a container in the Azure portal

Screenshot showing how to create a container in the Azure portal

Step 4: Navori QL Installation

Now that the environment is ready, you can launch the Navori QL Server Installer, and proceed as described in the Navori QL Server Installation Guide, with the following deviation:

After Launching the Navori QL Installer and accepting the license agreement, the SQL Server configuration details should be entered as follows:

Instance: Server name as set in Step 2 (Example – tcp:yourserver:database.windows.net,1433)

Login : userlogin@yourserver

Password: your password

Check the Azure DB checkbox and click on Verify to validate your configuration.

Then proceed as normal as detailed in the installation guide.

Please note for new installations please follow following instruction to connect QL server with SMB storage:

  • Create mapped drive on VM using the Azure File Share (SMB) provided script.

  • Assign the network path ("\\" instead of "https:\\") of the SMB drive in the connection settings tab (mediafolder path) of the QLConfigHelper.

  • Azure storage account username + access key (key 1) need to be used for:

    • Creating a local user of the same name, using key 1 as password (password set to NOT expire). Make sure to add this user to the Administrators group.

    • Apply this newly created local user to the ASP .NET v4 application pool in IIS as the Identity. **Careful, if needing the powerpoint integration with QL, you will need to assign the license Microsoft Office to this user or change the Identity to the user with the appropriate license**

    • Also apply this newly created local user to the Connect as... option for the "setup" page (right-click on the application main page and select "edit application" to find this option).

Step 5: Connecting your QL Server to the storage

When you create a storage account, Azure generates two 512-bit storage account access keys. These keys can be used to authorize access to your storage account via a Shared Key. You can rotate and regenerate the keys without any interruption to your applications, and Microsoft recommends that you do so regularly.

Note: Your storage account key is similar to the root password for your storage account. Always be careful to protect your account key. Avoid distributing it to other users, hard-coding it, or saving it anywhere in plain text that is accessible to others. Regenerate your account key using the Azure portal if you believe it may have been compromised.

Microsoft recommends using Azure Active Directory (Azure AD) authentication for your Blob and Queue storage applications (preview) when possible for enhanced security. For more information, see Authenticate access to Azure blobs and queues using Azure Active Directory (preview).

To view your storage account credentials:

1. Navigate to the Azure portal.

2. Locate your storage account.

3. In the Settings section of the storage account overview, select Access keys. Your account access keys appear, as well as the complete connection string for each key.

4. Find the Key value under key1, and click the Copy button to copy the account key.

5. Alternately, you can copy the entire connection string. Find the Connection string value under key1 and click the Copy button to copy the connection string.

Microsoft recommends that you regenerate your access keys periodically to help keep your storage account secure. Two access keys are assigned so that you can rotate your keys. When you rotate your keys, you ensure that your application maintains access to Azure Storage throughout the process.

Note: Regenerating your access keys can affect any applications or Azure services that are dependent on the storage account key. Any clients that use the account key to access the storage account must be updated to use the new key, including media services, cloud, desktop and mobile applications, and graphical user interface applications for Azure Storage, such as Azure Storage Explorer.

Follow this process to rotate your storage account keys:

1. Update the connection strings in your application code to use the secondary key.

2. Regenerate the primary access key for your storage account. On the Access Keys blade in the Azure portal, click Regenerate Key1, and then click Yes to confirm that you want to generate a new key.

3. Update the connection strings in your code to reference the new primary access key.

4. Regenerate the secondary access key in the same manner.

Once the access key has been retrieved from the Azure portal, you need to log into your QL Manager interface, using your administrator access. In the System menu on the bottom left corner, click on Server >Properties, and navigate to the second tab Click on Enable in the content delivery network section, and enter the name of the storage account as it appears in the Azure Portal under User Account. Copy Key1 from the Azure portal and paste it into the Key field.

Click Test to validate the connection. Your Server should now be ready for use.

Did this answer your question?