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 |
|---|---|---|---|---|
|
resource
|
path | True |
string minLength: 1maxLength: 90 |
The name of the resource group. The name is case insensitive. |
|
subscription
|
path | True |
string (uuid) |
The ID of the target subscription. The value must be an UUID. |
|
watcher
|
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 |
Azure operation completed successfully. |
|
| Other Status Codes |
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
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 |
|---|---|
|
created |
The type of identity that created the resource. |
|
Error |
The resource management error additional info. |
|
Error |
The error detail. |
|
Error |
Error response |
|
Resource |
The provisioning state of the alert rule resource. |
|
Sql |
The properties specific to an elastic pool in Azure SQL Database. |
|
Sql |
The properties specific to a database in Azure SQL Database. |
|
Sql |
The properties specific to Azure SQL Managed Instance targets. |
|
system |
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. |
|
Target |
The type of authentication to use when connecting to a target. |
|
Target |
The response of a Target list operation. |
|
Vault |
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 |
The error additional info. |
|
| code |
string |
The error code. |
| details |
The error details. |
|
| message |
string |
The error message. |
| target |
string |
The error target. |
ErrorResponse
Error response
| Name | Type | Description |
|---|---|---|
| error |
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 |
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 |
The type of authentication to use when connecting to a target. |
||
| targetType |
string:
Sql |
Discriminator property for TargetProperties. |
|
| targetVault |
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 |
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 |
The type of authentication to use when connecting to a target. |
||
| targetType |
string:
Sql |
Discriminator property for TargetProperties. |
|
| targetVault |
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 |
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 |
The type of authentication to use when connecting to a target. |
||
| targetType |
string:
Sql |
Discriminator property for TargetProperties. |
|
| targetVault |
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 |
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 |
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 |
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. |