Getting Started with Azure

This page introduces you to Cisco Cloud Observability Connections API resources and provides instructions to make your first API request. You'll learn how to create and manage an Azure connection. Examples will be shown using the command line with cURL commands.

Standard REST methods are supported on the Cisco Cloud Observability Connections API, which include POST, GET, PATCH, and DELETE operations through HTTPS. All payloads to and from the REST interface must be in JSON format.

Base URI

Every API request begins with this base URI:

https://{tenant_name}.observe.appdynamics.com/cloud/v2

1. Register a Client Application in the Azure Portal

To start creating and managing Azure connections, you'll first need to Register a Client Application in the Azure Portal.

You'll need to provide the tenant ID, subscription ID, client ID, and client secret key from the Azure portal in the following steps.

2. Create a Connection

To create a connection, provide the connection display name, description, tenant ID, subscription ID, client ID, and client secret key in the following request.

Request

curl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections' \
--data-raw '{
"type": "azure",
"displayName": "<display_name>",
"description": "<description>",
"details": {
    "clientId": "<client_id>",
    "clientSecret": "<client_secret>",
    "tenantId": "<tenant_id>",
    "subscriptionId": <subscription_id>"
}
}'

The response returns the connection id. Save this value. You'll need to provide it in the following steps.

Example Response

Expand
{
  "id": "1f52dfe8-0b79-443c-94fb-89c61a9fa57e",
  "createdAt": "2023-07-28T20:32:02.171Z",
  "updatedAt": "2023-07-28T20:32:02.171Z",
  "displayName": "TestAzureConn",
  "description": "Azure connection",
  "type": "azure",
  "state": "PENDING CONFIGURATION",
  "stateMessage": "Finish configuring your connection.",
  "details": {
      "clientId": "25e9de7c-e99c-40a3-b181-a27736d20621",
      "clientSecret": "*******************",
      "tenantId": "79edab66-eb8c-40b5-b907-b788a9b76fc0",
      "subscriptionId": "1d744bdf-5e57-47b9-bb2f-e6dde57bc643"
  },
  "configurationId": ""
}

3. Create a Configuration

To create a configuration, you'll first need to obtain a list of the supported Azure hosting regions and services that you want to monitor.

3a. Get Azure Regions

Request

Obtain the list of supported Azure hosting regions using the following request:

curl --location --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/regions?type=azure' \
--header 'Authorization: Bearer token-generated in auth step' 

Example Response

Expand
{
  "items": [
      {
          "id": "eastus",
          "displayName": "East US"
      },
      {
          "id": "eastus2",
          "displayName": "East US 2"
      },
      {
          "id": "southcentralus",
          "displayName": "South Central US"
      },
      {
          "id": "westus2",
          "displayName": "West US 2"
      },
      {
          "id": "westus3",
          "displayName": "West US 3"
      },
      {
          "id": "australiaeast",
          "displayName": "Australia East"
      },
      {
          "id": "southeastasia",
          "displayName": "Southeast Asia"
      },
      {
          "id": "northeurope",
          "displayName": "North Europe"
      },
      {
          "id": "swedencentral",
          "displayName": "Sweden Central"
      },
      {
          "id": "uksouth",
          "displayName": "UK South"
      },
      {
          "id": "westeurope",
          "displayName": "West Europe"
      },
      {
          "id": "centralus",
          "displayName": "Central US"
      },
      {
          "id": "northcentralus",
          "displayName": "North Central US"
      },
      {
          "id": "westus",
          "displayName": "West US"
      },
      {
          "id": "southafricanorth",
          "displayName": "South Africa North"
      },
      {
          "id": "centralindia",
          "displayName": "Central India"
      },
      {
          "id": "eastasia",
          "displayName": "East Asia"
      },
      {
          "id": "japaneast",
          "displayName": "Japan East"
      },
      {
          "id": "jioindiawest",
          "displayName": "Jio India West"
      },
      {
          "id": "koreacentral",
          "displayName": "Korea Central"
      },
      {
          "id": "canadacentral",
          "displayName": "Canada Central"
      },
      {
          "id": "francecentral",
          "displayName": "France Central"
      },
      {
          "id": "germanywestcentral",
          "displayName": "Germany West Central"
      },
      {
          "id": "norwayeast",
          "displayName": "Norway East"
      },
      {
          "id": "switzerlandnorth",
          "displayName": "Switzerland North"
      },
      {
          "id": "uaenorth",
          "displayName": "UAE North"
      },
      {
          "id": "brazilsouth",
          "displayName": "Brazil South"
      },
      {
          "id": "centralusstage",
          "displayName": "Central US (Stage)"
      },
      {
          "id": "eastusstage",
          "displayName": "East US (Stage)"
      },
      {
          "id": "eastus2stage",
          "displayName": "East US 2 (Stage)"
      },
      {
          "id": "northcentralusstage",
          "displayName": "North Central US (Stage)"
      },
      {
          "id": "southcentralusstage",
          "displayName": "South Central US (Stage)"
      },
      {
          "id": "westusstage",
          "displayName": "West US (Stage)"
      },
      {
          "id": "westus2stage",
          "displayName": "West US 2 (Stage)"
      },
      {
          "id": "asia",
          "displayName": "Asia"
      },
      {
          "id": "asiapacific",
          "displayName": "Asia Pacific"
      },
      {
          "id": "australia",
          "displayName": "Australia"
      },
      {
          "id": "brazil",
          "displayName": "Brazil"
      },
      {
          "id": "canada",
          "displayName": "Canada"
      },
      {
          "id": "europe",
          "displayName": "Europe"
      },
      {
          "id": "france",
          "displayName": "France"
      },
      {
          "id": "germany",
          "displayName": "Germany"
      },
      {
          "id": "global",
          "displayName": "Global"
      },
      {
          "id": "india",
          "displayName": "India"
      },
      {
          "id": "japan",
          "displayName": "Japan"
      },
      {
          "id": "korea",
          "displayName": "Korea"
      },
      {
          "id": "norway",
          "displayName": "Norway"
      },
      {
          "id": "southafrica",
          "displayName": "South Africa"
      },
      {
          "id": "switzerland",
          "displayName": "Switzerland"
      },
      {
          "id": "uae",
          "displayName": "United Arab Emirates"
      },
      {
          "id": "uk",
          "displayName": "United Kingdom"
      },
      {
          "id": "unitedstates",
          "displayName": "United States"
      },
      {
          "id": "eastasiastage",
          "displayName": "East Asia (Stage)"
      },
      {
          "id": "southeastasiastage",
          "displayName": "Southeast Asia (Stage)"
      },
      {
          "id": "centraluseuap",
          "displayName": "Central US EUAP"
      },
      {
          "id": "eastus2euap",
          "displayName": "East US 2 EUAP"
      },
      {
          "id": "westcentralus",
          "displayName": "West Central US"
      },
      {
          "id": "southafricawest",
          "displayName": "South Africa West"
      },
      {
          "id": "australiacentral",
          "displayName": "Australia Central"
      },
      {
          "id": "australiacentral2",
          "displayName": "Australia Central 2"
      },
      {
          "id": "australiasoutheast",
          "displayName": "Australia Southeast"
      },
      {
          "id": "japanwest",
          "displayName": "Japan West"
      },
      {
          "id": "jioindiacentral",
          "displayName": "Jio India Central"
      },
      {
          "id": "koreasouth",
          "displayName": "Korea South"
      },
      {
          "id": "southindia",
          "displayName": "South India"
      },
      {
          "id": "westindia",
          "displayName": "West India"
      },
      {
          "id": "canadaeast",
          "displayName": "Canada East"
      },
      {
          "id": "francesouth",
          "displayName": "France South"
      },
      {
          "id": "germanynorth",
          "displayName": "Germany North"
      },
      {
          "id": "norwaywest",
          "displayName": "Norway West"
      },
      {
          "id": "switzerlandwest",
          "displayName": "Switzerland West"
      },
      {
          "id": "ukwest",
          "displayName": "UK West"
      },
      {
          "id": "uaecentral",
          "displayName": "UAE Central"
      },
      {
          "id": "brazilsoutheast",
          "displayName": "Brazil Southeast"
      }
  ]
}

3b. Get Azure Services

Request

Obtain the list of supported Azure services using the following request:

curl --location --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/services?type=azure' \
--header 'Authorization: Bearer token-generated in auth step'

Example Response

Expand
{
  "items": [
      {
          "id": "vm",
          "displayName": "Azure Virtual Machine",
          "description": "Azure Virtual Machines (VM) is one of several types of on-demand, scalable computing resources that Azure offers."
      },
      {
          "id": "lb",
          "displayName": "Azure Load Balancer",
          "description": "An Azure load balancer is a Layer-4 (TCP, UDP) load balancer that provides high availability by distributing incoming traffic among healthy VMs. A load balancer health probe monitors a given port on each VM and only distributes traffic to an operational VM."
      },
      {
          "id": "disk",
          "displayName": "Azure Disk Storage",
          "description": "Azure Virtual Machines use disks as a place to store an operating system, applications, and data. All Azure virtual machines have at least two disks: An operating system disk, and a temporary disk."
      },
      {
          "id": "postgresql",
          "displayName": "Azure Database for PostgreSQL",
          "description": "Azure Database for PostgreSQL servers."
      },
      {
          "id": "sql",
          "displayName": "Azure SQL Database",
          "description": "Azure SQL Databases and Data Warehouses."
      },
      {
          "id": "app_service",
          "displayName": "Azure App Service",
          "description": "Azure App Service can be used to quickly and easily create enterprise-ready web and mobile apps for any platform or device, and deploy them on a scalable and reliable cloud infrastructure."
      },
      {
          "id": "app_service_plan",
          "displayName": "Azure App Service Plan",
          "description": "Azure App Service Plan defines a set of compute resources for a web app to run."
      },
      {
          "id": "applicationGateway",
          "displayName": "Azure Application Gateway",
          "description": "Azure Application Gateway is a web traffic load balancer that enables you to manage traffic to your web applications."
      },
      {
          "id": "service_bus",
          "displayName": "Azure Service Bus",
          "description": "Azure Service Bus is a fully managed enterprise message broker with message queues and publish-subscribe topics."
      },
      {
          "id": "container_instance",
          "displayName": "Azure Container Instance",
          "description": "Azure Container Instances runs Docker containers  on-demand in a managed, serverless environment without orchestration."
      },
      {
          "id": "mysql",
          "displayName": "Azure Database for MySQL",
          "description": "Azure Database for MySQL is a fully managed MySQL, compatible with the latest community editions, that provides maximum flexibility for database operations."
      }
  ]
}

3c. Create a Configuration

Note: The default polling interval is 5 minutes. This interval is currently not configurable.

Create a configuration by providing the supported Azure hosting regions and services that you want to monitor in the following request. You can also specify if a tag filter for services or environments should be used.

Request

curl --location -g --request POST 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/configurations' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "<display_name>",
"description": "<description>",
"details": {
  "polling": {
    "interval": <interval_number>,
    "unit": "<unit>"
  },
  "services": [
    {
      "name": "<service_name>",
      "polling": {
        "interval": <interval_number>,
        "unit": "<unit>"
    },
  "tagFilter": "tags(<service>)" } ],
  "regions": [
    "eastus" ],
  "resourceGroups": [<resource_groups>],
  "tagFilter": "tags(<env>)"
  }
  }'

The response returns the configuration id. Save this value. You'll need to provide it in the following steps.

Example Request

Expand
curl --location -g --request POST 'https://{tenan_name}.observe.appdynamics.com/cloud/v2/configurations' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "azure-configuration-test",
"description": "A description for this connection/configuration",
"details": {
  "polling": {
    "interval": 5,
    "unit": "minute"
  },
  "services": [
    {
      "name": "vm",
      "polling": {
        "interval": 5,
        "unit": "minute"
    },
  "tagFilter": "tags(service)" } ],
  "regions": [
    "eastus" ],
  "resourceGroups": [],
  "tagFilter": "tags(env)"
  }
  }'

Example Response

Expand
{
  "id": "1b6d8f5c-f524-436c-b398-0387c2294f05",
  "type": "azure",
  "displayName": "TestAzureConfig",
  "description": "",
  "details": {
      "polling": {
          "interval": 5,
          "unit": "minute"
      },
      "services": [
          {
              "name": "vm",
              "polling": {
                  "interval": 5,
                  "unit": "minute"
              },
              "tagFilter": ""
          }
      ],
      "importTags": {
          "enabled": true,
          "excludedKeys": []
      },
      "regions": [],
      "resourceGroups": [],
      "tagFilter": ""
  },
  "createdAt": "2023-07-28T20:33:07.327Z",
  "updatedAt": "2023-07-28T20:33:07.327Z"
}

4. Update a Connection

To start data collection, you'll need to update the connection to add the configuration ID.

You can also update the following editable and immutable fields during this step:

Connection Type Field Editable? Notes
Azure Connection Name YES
Description YES
Client ID YES AuthN
Client Secret YES AuthN
Tenant ID NO
Subscription ID NO
Type NO

Any combination of editable fields can be given in the PATCH request.

Request

Provide the connection ID and configuration ID in the following request:

curl --location -g --request PATCH 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections/<connection_Id>' \
--header 'Content-Type: application/json' \
--data-raw '{
"displayName": "<display_name>",
"description": "<description>",
"details": {        
    "clientId": "<client_id>",
    "clientSecret": "<client_secret>",
    "tenantId": "<tenant_id>",
    "subscriptionId": "<subscription_id>"    
},
"configurationId": "<configuration_id>"
}'

Example Response

Expand
{
  "id": "1f52dfe8-0b79-443c-94fb-89c61a9fa57e",
  "createdAt": "2023-07-28T20:32:02.171Z",
  "updatedAt": "2023-07-28T20:35:39.534Z",
  "displayName": "TestAzureConn",
  "description": "Azure connection",
  "type": "azure",
  "state": "CONFIGURED",
  "stateMessage": "Start the connection to begin collecting data.",
  "details": {
      "clientId": "25e9de7c-e99c-40a3-b181-a27736d20621",
      "clientSecret": "*******************",
      "tenantId": "79edab66-eb8c-40b5-b907-b788a9b76fc0",
      "subscriptionId": "1d744bdf-5e57-47b9-bb2f-e6dde57bc643"
  },
  "configurationId": "1b6d8f5c-f524-436c-b398-0387c2294f05"
}

5. List Your Connections

Next, list your connections to obtain the connection ID of a connection that you want to delete.

Request

curl --location -g --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections'

Example Response

Expand
{
  "items": [
      {
          "id": "56c462f4-5012-445b-8e63-e2952c5ade7b",
          "createdAt": "2023-07-24T18:18:27.034Z",
          "updatedAt": "2023-07-24T18:18:27.034Z",
          "displayName": "TestAzureConn",
          "description": "Azure connection",
          "type": "azure",
          "state": "ACTIVE",
          "stateMessage": "[{\"service\":\"azure_virtualmachines_scalesets_instances\",\"statusMessage\":\"Successful Collection\"},{\"service\":\"azure_virtualmachines\",\"statusMessage\":\"Successful Collection\"}]",
          "details": {
              "clientId": "25e9de7c-e99c-40a3-b181-a27736d20621",
              "clientSecret": "*******************",
              "tenantId": "79edab66-eb8c-40b5-b907-b788a9b76fc0",
              "subscriptionId": "1d744bdf-5e57-47b9-bb2f-e6dde57bc643"
          },
          "configurationId": "8963981d-8695-46dc-823b-0531f9e49547"
      }
  ]
}

6. Delete a Connection

Use the connection id field from the previous response to delete the connection using the following request.

Note: When you delete a connection, the corresponding configuration is also deleted if it is not used by any other connection.

curl --location -g --request DELETE 'https://{tenant_name}>.observe.appdynamics.com/cloud/v2/connections/<connection_id>' \
--header 'Content-Type: application/json'

7. Verify that Connection is Deleted

To verify that the connection is deleted, list your connections again:

curl --location -g --request GET 'https://{tenant_name}.observe.appdynamics.com/cloud/v2/connections'

If the connection does not appear in the list of connections, it has been successfully deleted.