Configure SQL Server for Azure Monitor for SAP solutions (preview)

Important

Azure Monitor for SAP solutions is currently in PREVIEW. See the Supplemental Terms of Use for Microsoft Azure Previews for legal terms that apply to Azure features that are in beta, preview, or otherwise not yet released into general availability.

In this how-to guide, you'll learn to configure a Microsoft SQL Server provider for Azure Monitor for SAP solutions through the Azure portal.

Prerequisites

Open Windows port

Open the Windows port in the local firewall of SQL Server and the network security group (NSG) where SQL Server and Azure Monitor for SAP solutions exist. The default port is 1433.

Configure SQL server

Configure SQL Server to accept logins from Windows and SQL Server:

  1. Open SQL Server Management Studio (SSMS).
  2. Open Server Properties > Security > Authentication
  3. Select SQL Server and Windows authentication mode.
  4. Select OK to save your changes.
  5. Restart SQL Server to complete the changes.

Create Azure Monitor for SAP solutions user for SQL Server

Create a user for Azure Monitor for SAP solutions to log in to SQL Server using the following script. Make sure to replace:

  • <Database to monitor> with your SAP database's name
  • <password> with the password for your user

You can replace the example information for the Azure Monitor for SAP solutions user with any other SQL username.

USE [<Database to monitor>]
DROP USER [AMS]
GO
USE [master]
DROP USER [AMS]
DROP LOGIN [AMS]
GO
CREATE LOGIN [AMS] WITH 
    PASSWORD=N'<password>', 
    DEFAULT_DATABASE=[<Database to monitor>], 
    DEFAULT_LANGUAGE=[us_english], 
    CHECK_EXPIRATION=OFF, 
    CHECK_POLICY=OFF
CREATE USER AMS FOR LOGIN AMS
ALTER ROLE [db_datareader] ADD MEMBER [AMS]
ALTER ROLE [db_denydatawriter] ADD MEMBER [AMS]
GRANT CONNECT TO AMS
GRANT VIEW SERVER STATE TO AMS
GRANT VIEW ANY DEFINITION TO AMS
GRANT EXEC ON xp_readerrorlog TO AMS
GO
USE [<Database to monitor>]
CREATE USER [AMS] FOR LOGIN [AMS]
ALTER ROLE [db_datareader] ADD MEMBER [AMS]
ALTER ROLE [db_denydatawriter] ADD MEMBER [AMS]
GO

Install Azure Monitor for SAP solutions provider

To install the provider from Azure Monitor for SAP solutions:

  1. Open the Azure Monitor for SAP solutions resource in the Azure portal.
  2. In the resource menu, under Settings, select Providers.
  3. On the provider page, select Add to add a new provider.
  4. On the Add provider page, enter all required information:
    1. For Type, select Microsoft SQL Server.
    2. For Name, enter a name for the provider.
    3. For Host name, enter the IP address of the hostname.
    4. For Port, enter the port on which SQL Server is listening. The default is 1433.
    5. For SQL username, enter a username for the SQL Server account.
    6. For Password, enter a password for the account.
    7. For SID, enter the SAP system identifier (SID).
    8. Select Create to create the provider
  5. Repeat the previous step as needed to create more providers.
  6. Select Review + create to complete the deployment.

Next steps