Before you add a Managed Instance into monitoring, make sure you have given SQL Governor the permissions to access them.
To add a Manage Instance, open SQL Server Management Studio and execute the following script:
USE DB_GOVERNOR
GO
EXEC [usp_AZ_AZURE_RESOURCE_INSERT]
@FRIENDLY_NAME = 'GovernorMItest2', -- THIS TEXT WILL BE SHOWN IN THE USER INTERFACE
@SOURCE_TYPE = 'AZURE_MI', -- AZURE MANAGED INSTANCE
@SERVER_NAME = 'governormisource.21f54c597882.database.windows.net', -- FULLY QUALIFIED SERVER NAME
@PORT = 3342,
@LOGIN_NAME = 'gov_azure_collector', -- SQL LOGIN
@PASSWORD = 'xxxxxxxxxxxxxxxxx'
To update the connection string later, run the following script:
USE DB_GOVERNOR
GO
EXEC [dbo].[usp_AZ_AZURE_RESOURCE_UPDATE]
@FRIENDLY_NAME = 'GovernorMISource',
@PORT = 3342
The changeable settings are @SERVER_NAME, @PORT, @LOGIN_NAME, @PASSWORD.
To remove a Managed Instance from monitoring, run the following script:
USE DB_GOVERNOR
GO
EXEC [usp_AZ_AZURE_RESOURCE_DELETE]
@FRIENDLY_NAME = 'GovernorMISource'