Share via


Targets - List By Watcher

List Target resources by Watcher

GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseWatcher/watchers/{watcherName}/targets?api-version=2025-01-02

URI Parameters

Name In Required Type Description
resourceGroupName
path True

string

minLength: 1
maxLength: 90

The name of the resource group. The name is case insensitive.

subscriptionId
path True

string (uuid)

The ID of the target subscription. The value must be an UUID.

watcherName
path True

string

pattern: ^[a-zA-Z0-9]{1}[a-zA-Z0-9-_]{3,60}$

The database watcher name.

api-version
query True

string

minLength: 1

The API version to use for this operation.

Responses

Name Type Description
200 OK

TargetListResult

Azure operation completed successfully.

Other Status Codes

ErrorResponse

An unexpected error response.

Security

azure_auth

Azure Active Directory OAuth2 Flow.

Type: oauth2
Flow: implicit
Authorization URL: https://login.microsoftonline.com/common/oauth2/authorize

Scopes

Name Description
user_impersonation impersonate your user account

Examples

Targets_ListByWatcher_MaximumSet

Sample request

GET https://management.azure.com/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.DatabaseWatcher/watchers/databasemo3ej9ih/targets?api-version=2025-01-02

Sample response

{
  "value": [
    {
      "id": "/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-px9ma7/providers/Microsoft.DatabaseWatcher/watchers/databasemo3d9sgt/targets/monitoringzkndgm",
      "name": "monitoringzkndgm",
      "type": "microsoft.databasewatcher/watchers/targets",
      "properties": {
        "targetType": "SqlDb",
        "targetAuthenticationType": "Aad",
        "connectionServerName": "sqlServero1ihe2",
        "sqlDbResourceId": "/subscriptions/49e0fbd3-75e8-44e7-96fd-5b64d9ad818d/resourceGroups/apiTest-ddat4p/providers/Microsoft.Sql/servers/m1/databases/m2",
        "provisioningState": "Succeeded"
      },
      "systemData": {
        "createdBy": "enbpvlpqbwd",
        "createdByType": "User",
        "createdAt": "2024-07-25T15:38:47.092Z",
        "lastModifiedBy": "mxp",
        "lastModifiedByType": "User",
        "lastModifiedAt": "2024-07-25T15:38:47.092Z"
      }
    }
  ],
  "nextLink": "https://microsoft.com/a"
}

Definitions

Name Description
createdByType

The type of identity that created the resource.

ErrorAdditionalInfo

The resource management error additional info.

ErrorDetail

The error detail.

ErrorResponse

Error response

ResourceProvisioningState

The provisioning state of the alert rule resource.

SqlDbElasticPoolTargetProperties

The properties specific to an elastic pool in Azure SQL Database.

SqlDbSingleDatabaseTargetProperties

The properties specific to a database in Azure SQL Database.

SqlMiTargetProperties

The properties specific to Azure SQL Managed Instance targets.

systemData

Metadata pertaining to creation and last modification of the resource.

Target

Concrete proxy resource types can be created by aliasing this type using a specific property type.

TargetAuthenticationType

The type of authentication to use when connecting to a target.

TargetListResult

The response of a Target list operation.

VaultSecret

The vault specific details required if using SQL authentication to connect to a target.

createdByType

The type of identity that created the resource.

Value Description
User
Application
ManagedIdentity
Key

ErrorAdditionalInfo

The resource management error additional info.

Name Type Description
info

object

The additional info.

type

string

The additional info type.

ErrorDetail

The error detail.

Name Type Description
additionalInfo

ErrorAdditionalInfo[]

The error additional info.

code

string

The error code.

details

ErrorDetail[]

The error details.

message

string

The error message.

target

string

The error target.

ErrorResponse

Error response

Name Type Description
error

ErrorDetail

The error object.

ResourceProvisioningState

The provisioning state of the alert rule resource.

Value Description
Succeeded

Resource has been created.

Failed

Resource creation failed.

Canceled

Resource creation was canceled.

SqlDbElasticPoolTargetProperties

The properties specific to an elastic pool in Azure SQL Database.

Name Type Default value Description
anchorDatabaseResourceId

string (arm-id)

The Azure resource ID of the anchor database used to connect to an elastic pool.

connectionServerName

string

maxLength: 200

The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately.

provisioningState

ResourceProvisioningState

The provisioning state of the resource.

readIntent

boolean

False

Set to true to monitor a high availability replica of specified target, if any.

sqlEpResourceId

string (arm-id)

The Azure resource ID of an Azure SQL DB elastic pool target.

targetAuthenticationType

TargetAuthenticationType

The type of authentication to use when connecting to a target.

targetType string:

SqlEp

Discriminator property for TargetProperties.

targetVault

VaultSecret

To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.

SqlDbSingleDatabaseTargetProperties

The properties specific to a database in Azure SQL Database.

Name Type Default value Description
connectionServerName

string

maxLength: 200

The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately.

provisioningState

ResourceProvisioningState

The provisioning state of the resource.

readIntent

boolean

False

Set to true to monitor a high availability replica of specified target, if any.

sqlDbResourceId

string (arm-id)

The Azure resource ID of an Azure SQL DB database target.

targetAuthenticationType

TargetAuthenticationType

The type of authentication to use when connecting to a target.

targetType string:

SqlDb

Discriminator property for TargetProperties.

targetVault

VaultSecret

To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.

SqlMiTargetProperties

The properties specific to Azure SQL Managed Instance targets.

Name Type Default value Description
connectionServerName

string

maxLength: 200

The FQDN host name of the server to use in the connection string when connecting to a target. For example, for an Azure SQL logical server in the Azure commercial cloud, the value might be 'sql-logical-server-22092780.database.windows.net'; for an Azure SQL managed instance in the Azure commercial cloud, the value might be 'sql-mi-39441134.767d5869f605.database.windows.net'. Port number and instance name must be specified separately.

connectionTcpPort

integer (int32)

1433

The TCP port number to optionally use in the connection string when connecting to an Azure SQL Managed Instance target.

provisioningState

ResourceProvisioningState

The provisioning state of the resource.

readIntent

boolean

False

Set to true to monitor a high availability replica of specified target, if any.

sqlMiResourceId

string (arm-id)

The Azure resource ID of an Azure SQL Managed Instance target.

targetAuthenticationType

TargetAuthenticationType

The type of authentication to use when connecting to a target.

targetType string:

SqlMi

Discriminator property for TargetProperties.

targetVault

VaultSecret

To use SQL authentication when connecting to targets, specify the vault where the login name and password secrets are stored.

systemData

Metadata pertaining to creation and last modification of the resource.

Name Type Description
createdAt

string (date-time)

The timestamp of resource creation (UTC).

createdBy

string

The identity that created the resource.

createdByType

createdByType

The type of identity that created the resource.

lastModifiedAt

string (date-time)

The timestamp of resource last modification (UTC)

lastModifiedBy

string

The identity that last modified the resource.

lastModifiedByType

createdByType

The type of identity that last modified the resource.

Target

Concrete proxy resource types can be created by aliasing this type using a specific property type.

Name Type Description
id

string (arm-id)

Fully qualified resource ID for the resource. E.g. "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}"

name

string

The name of the resource

properties TargetProperties:

The resource-specific properties for this resource.

systemData

systemData

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type

string

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

TargetAuthenticationType

The type of authentication to use when connecting to a target.

Value Description
Aad

The Azure Active Directory authentication.

Sql

The SQL password authentication.

TargetListResult

The response of a Target list operation.

Name Type Description
nextLink

string (uri)

The link to the next page of items

value

Target[]

The Target items on this page

VaultSecret

The vault specific details required if using SQL authentication to connect to a target.

Name Type Description
akvResourceId

string (arm-id)

The Azure resource ID of the Key Vault instance storing database authentication secrets.

akvTargetPassword

string

pattern: ^[a-zA-Z0-9-]{1,127}$

The path to the Key Vault secret storing the password for authentication to a target.

akvTargetUser

string

pattern: ^[a-zA-Z0-9-]{1,127}$

The path to the Key Vault secret storing the login name (aka user name, aka account name) for authentication to a target.