Archive

Archive for the ‘SQL Azure Admin’ Category

Simple Guide to provision SQL Server 2017 on Linux in Azure Virtual Machine

October 12, 2017 1 comment

Hi Everyone, In this article, we will see how to provision SQL Server 2017 on Linux in Azure Virtual Machine

Step 1: Please login to azure portal and go to Virtual Machine blade

capture20171006153829221

Step 2: Please search for SQL Server 2017

capture20171006153917048

Step 3: Please select SQL Server 2017 Developer on Ubuntu Server, I have used Ubuntu linux for this demo but you can use Red Hat or Suse Linux as well

capture20171006153950231

Step 4: Please review the legal terms, select deployment model, I prefer to use Resource Manager, so that management and cleanup is easier, Please also copy the highlighted command which will be helpful for configuring the sa password for SQL Server later

capture20171006154030026

Step 5: Please provide the name of the VM, select Disk type, provide user name and select Authentication Type, in this case I am using Password

Please select the Azure Subscription

For Resource group, I am creating a new one named “SQLLinux” and using Azure data center location as “East US”, please change this according to your region

capture20171006155312325

Step 6: In this step, we need to select the Size of our Linux VM, I am using B2S Standard, which has 2 vCPUs and 4 GB RAM, which is good for our testing, but you can choose the size based on your requirement, after selecting the size, Please click “Select” to proceed

capture20171006155634830

Step 7: In this step, we will review some of the important settings

Virtual Network – For this demo, I am creating a new Virtual Network, but if you already have other VMs running in Azure and you need this SQL Server VM to be accessible for them, Please use the existing Virtual Network

Public IP Address – I have enabled Public IP Address for this demo, but this is optional, Please don’t enable this, if you are planning to use this server only within Azure, so that it will reduce the exposure

Network Security Group (Firewall) – We will see in next step, How to configure firewall to allow external access

Auto Shutdown – This is an useful optional setting for demo or test servers, so that you can configure it to shutdown automatically based on a timing, this will reduce billing of your VM

Time Zone – Please select the time zone based on your region

capture20171006155902614

Step 8: Additional Settings Please enable Monitoring for both Boot diagnostics and Guest OS diagnostics, This will help you see the Boot log for any error or messages, after making required Settings changes, Click “Ok” to proceed

capture20171006155918920

Step 9:  To allow external access to SQL Server,  we need to change Network Firewall setting by adding Inbound and Outbound security rules for MSSQL Service

Note: You can do this change after creating the Virtual machine

capture20171006161838234

capture20171006161922839

Step 10: Review the selection options and click “Purchase” to buy and create the virtual machine

capture20171006160025569

Step 11: You can review the Virtual Machine deployment progress in the screen

capture20171006160058057

If you closed it, you can see from the Top right corner Notifications area

capture20171006160124574

You can also see the status under Virtual Machines blade as well

capture20171006160259721

Once Virtual machine is provisioned and ready, you should see the status as “Running”, see below screenshot

capture20171006160508333

Step 12:  Please click on the Virtual Machine to see the settings and also to monitor the CPU/Network/Disk usage

capture20171006160608869

Step 13: Configuring SQL Server in Azure Linux VM

Please connect to Azure Linux VM using any preferred SSH client, In this demo, I am using Bash Shell on Windows, since its built in Windows 10 now

Command to connect, Please type “Yes” to accept the authenticity of the host

ssh username@serveripaddress

capture20171006160654951

Step 14: After logging in to VM, Please run the below command to check the status of SQL Server

sudo systemctl status mssql-server

Since we haven’t configured SA password, SQL Server is not running, so you seeing the status as “Inactive”

capture20171006160938531

Step 15: Please run below command to configure SA password

sudo /opt/mssql/bin/mssql-conf setup

Please select your preferred edition of SQL Server, in this demo, we will use Developer edition, in next prompt, Please specify the SA password and press enter

capture20171006161516727

Once password is setup, SQL Server 2017 will automatically run, Please run the status command again to review the SQL Server status

sudo systemctl status mssql-server

capture20171006161118193

Step 16: Please run “SELECT @@VERSION” using SQLCMD utility to connect to the server to verify we are able to connect and see SQL Server version

capture20171006161645028

Step 17: Now we can use SQL Server Management Studio to connect using the Public IP Address and SA password provisioned

capture20171006162510369

Once connected, Please create your required databases and database objects and use as needed

capture20171006162600552

capture20171006162708830

SQL Server 2017 Developer Edition is up and running Azure Linux VM now in under 5 minutes

I believe you will find this post useful !!!

Advertisements

Manage SQL Azure server using PowerShell

September 21, 2011 Leave a comment

Windows Azure Platform Powershell Cmdlets has been released and available for download at http://wappowershell.codeplex.com/releases/view/73463

It supports creating SQL Azure server, removing an existing SQL Azure server, managing the firewall and resetting the Administrator password.

For more detailed information, please visit

http://wappowershell.codeplex.com/documentation

How to create Co-Administrator for SQL Azure Server ?

July 15, 2011 Leave a comment

SQL Azure Co-Administrator option has been released in July 2011 Service Release

In this article, we will see How to add a Co-Administrator for your subscription

After logging in to Windows Azure Management Portal, click on “Database” tab

image

After navigating to Database section, click on “User Management” in Tool bar

image

In User Management screen, You can see the currently available Service Administrators and Co-Administrator for all available subscriptions

 image

Click on “Add New Co-Admin”

image

In Add New Co-Administrator screen, specify the new users’ Windows Live ID and then select the subscription he can administer and then click “Ok”

image

Now we have successfully created a new Co-Administrator, Now he can login and create or drop servers, create or drop databases and new co-administrators as well

image

To remove a subscription or remove a Co-Administrator, click on Co-Administrator name and then click on “Manage Co-Admin”

image

If you have multiple subscriptions, you can remove the subscription which the co-admin should not manage, if you remove all subscriptions, the co-admin account will be removed automatically.

Now let us login using Co-Administrator login and see how the users are displayed

image

Since the Co-Administrator already has a subscription, he is displayed as Service Administrator for one of the account and Co-Administrator for other account.

Hope you all find this information helpful !!!

SQL Azure Management Portal Changes–Drop SQL Azure Server

July 13, 2011 Leave a comment

Today while working on SQL Azure Management Portal, I found this new change

While Dropping a server, currently its prompting for Server to confirm that we are deleting the right server

image

If you type the correct server name, then “Drop” button is enabled

image

The Drop button doesn’t get enabled until you type the server name correctly

image

This looks like a small change, but this will be great preventive method to avoid any disaster of dropping the server by mistake !!!

Programmatically Managing SQL Azure using REST API

June 29, 2011 Leave a comment

In May 2011 SQL Azure Service Update 7, SQL Azure Management REST API was released.

SQL Azure Management REST API can be used for

    Currently it support Synchronous calls, there is no support Asynchronous calls.

All calls should be authenticated using X.509 Certificate and this certificate should be added as Management Certificate in Management Portal

Please read this article on How to create a Certificate http://msdn.microsoft.com/en-us/library/gg432987.aspx

Hope you all find this information useful !!!

SQL Azure Query Tool– Part 4–Hannsens SQL Azure Manager

May 27, 2011 Leave a comment

Hannssens’ SQL Azure Manager is a lightweight tool for managing SQL Azure databases.

Its still in Alpha release since 25-Aug-2009 and built on .Net Framework 3.5 and available as ClickOnce installer from the below link

http://hanssens.org/tools/sqlazuremanager/

Step 1: Click “Run” to install the application and Run

clip_image001

Step 2: To login to SQL Azure server, specify the Server Name, Username and password and click on “Connect”

clip_image002

Step 3: In Main screen toolbar, you have the option to switch between databases, you can pick the database which you want to work

clip_image003

Based on the database you selected, the Object Explorer will be refreshed and display the Tables and Views, you can also use “Refresh” option in toolbar to manually refresh as well.

clip_image004

For Tables and View, you have the following 3 options available under Context menu

1. Select Top 100 Records

2. Select All Records

3. Delete the table

clip_image005

Step 4: You can write and run your queries on the Right Side Query pane, the results will be displayed in Grid format, There is no Text format support or messages pane, Error messages will be displayed as Message Popup

clip_image006

Step 5: To Create a new database, click “New Database” option in Toolbar and then specify the Database name and click “Ok”

clip_image007

Step 6: To delete a database, click “Delete Database” in toolbar and then click “Yes” to confirm

clip_image008

Missing Feature:

1. No Message Pane

2. No option to view / Modify or Create Stored Procedures / Functions / Triggers using User Interface

Conclusion:

There are no new releases in last 2 years and  the code was not released to Code Plex or Source Forge, so I am not sure about the future releases of this product.

Its also unstable and crashes.

User Interface is lightweight and nice and fast. It would be good, if they continue the development or release the code under CodePlex or other Open Source community

SQL Azure Database Manager–Project Houston

May 26, 2011 Leave a comment

In the Episode 3 of SQL Azure Query Tool, we will see how to use SQL Azure Database Manager 10.0 (Project Houston), which is part of Windows Azure Management Portal now

Step 1: Login to Windows Azure Portal (https://windows.azure.com/default.aspx ), select the SQL Azure Server and Database and click on “Manage”

clip_image002

Step 2: Accept the Terms and Conditions and data collection agreement and click “Ok” to connect

clip_image003

Step 3: Server name, database name and user name will be pre-populated, Please enter password and click “Connect” to login

clip_image004

Step 4: Start Page will display the database properties (Default Collation, Compatibility Level, Date Created and Read Only) and Server Edition and Version

clip_image006

Click on Left or Right Arrow near to Database Properties to Spin up to Resources view

clip_image008

Step 5: To Query data click on “New Query” in tool bar

New Query

clip_image009

Type the SQL query and click on “Execute” to run the query, you can Save the query as .SQL file for future use as well. Results of the query will be displayed in Bottom pane as Grid

clip_image011

Output Messages can be displayed in the “Message” tab

clip_image012

Step 6: To Create New Table – Click on “New Table” icon in toolbar

clip_image014

Enter the column name, select the data type, size, default value, Specify whether Identity, Required or Primary Key. Click on “+ Column” to add more columns. Once completed the design, click on “Save” to save the table.

Step 7: To add data click on Data View in toolbar

clip_image015

Click on “+ Row” to add rows and enters data. Click Save to store the data.

clip_image016

Step 8: Create New View: To create a new view, click on “New View” button in toolbar

Select Schema, Specify View Name and then type the SQL Query and click “Save”, After saving the query, you can click on “Data” to view the output from View

clip_image018

Step 9: Create New Stored Procedure: To create new Stored Procedure, click on “New Stored Procedure” button in toolbar

Select Schema, specify name of Stored Procedure and then click “New Paramter” or “+ Parameter” to add parameter

Specify the name of the parameter, select data type, specify size (if required), default value, whether output parameter or not

Then define the stored procedure body and click “Save”

clip_image020

Step 10: Execute Stored Procedure: Once saved, you can click “Run” and then specify parameter values and click “Execute”

clip_image021

clip_image023

Conclusion: SQL Azure Database Manager (Project Houston) is a light-weight Management Studio Express with limited functionality to create Table, Views and Stored Procedures and manage Data

Missing Features:

1. No option to define Synonyms

2. No option to define Functions / View functions

3. No option to create Logins

4. No option to create Users or Manage Permissions

5. No option to Import / Export data

I hope in the future versions, these missing features will be added to make it a full fledge and fully functional Database Manager.

I hope you all find this information useful.

%d bloggers like this: