jsn / ServiceNow, simplified.
AustraliaREFERENCE GUIDE

Discovery for Microsoft Azure

On this page

Discovery for Microsoft Azure

If your cloud resources are in an Azure cloud, you must create a user identity called a service principal that grants permissions to the MID Server to access selected resources.

Azure management groups and subscriptions

An Azure management group contains other management groups and subscriptions. The management groups in an Azure Cloud environment form a hierarchy, but don’t contain volumes or virtual machines. Subscriptions contain cloud resources, such as virtual machines. The subscriptions that belong to management groups are called sub-accounts.

The advantages of using management groups are:

Easy population of sub-accounts

After you configure the management group and supply the necessary credentials, you can test the account. If the test succeeds, Discovery returns a list of subscriptions in that management group. From this list, you can choose one or more subscription sub-accounts to include in the Discovery schedule using the management group. For more information on the hierarchy of management groups and subscriptions, see Organize your resources with Azure management groups

Discovery of sub-account resources using dynamically acquired credentials

When you run Discovery on your subscriptions, you do not need separate credentials for each sub-account. Discovery finds the credentials for the management group and maps them to all of the subscription sub-accounts. The Cloud Discovery process handles credentials automatically by acquiring a temporary credential for each sub-account via an Azure API. You can elect to use the default configuration or customize the MID Server to assume other roles for additional controls and security. In addition, Discovery can automatically refresh the list of sub-accounts and datacenters covered in a discovery schedule. For more information, see the KB article Retrieve newer accounts/sub-accounts automatically via Cloud Discovery.

A service principal for Azure cloud services is similar to a Microsoft Windows service account that enables Windows processes to communicate with each other within an Active Directory domain.

To create the Azure service principal in your ServiceNow instance, copy the service principal credential values from the Azure portal into a text editor, and then transfer those values into the instance.

[Omitted image “azure-text-file.png”] Alt text: Text file that temporarily holds Azure service principal credential values

This table shows you the Azure Service Principal value and the location in Azure where you can find the values you need for the credentials.

Cloud Provisioning and Governance setting Azure Service Principal value Location of the Azure value Tenant ID Azure Directory ID value from the text file. Azure Active Directory > Properties > Directory ID Client ID Azure Application ID value from the text file. Azure Active Directory > App registrations > Registered App.Application ID Secret Key Azure Application key value from the text file. Azure Active Directory > App registrations > Registered App > Settings > Keys (hidden) Account ID Azure Subscription ID associated with the Tenant ID. Azure Active Directory > Subscriptions > Subscription ID

Verify the REST API permissions

Download the Cloud Discovery patterns spreadsheet so you can grant user permissions required for running the Discovery patterns. In addition to permissions, the spreadsheet also includes useful information such as pattern names, types, CI Classes, and links to vendor documentation. New patterns are available quarterly, so check periodically to be sure you have the latest version of the spreadsheet.

Data collected by Service Mapping during top-down discovery

To include discovered components into service instances, enable CI relationships used in tag-based discovery by Service Mapping. These CI relationships are available from the 1.0.68 release on the ServiceNow Store. For operational steps, see Tag-based discovery configuration.

Service Mapping uses tag-based discovery to create service instance maps including the Cloud components. The Service Mapping application comes with the following preconfigured CI relationships used for tag-based discovery. These CI relationships are available from the 1.0.68 release on the ServiceNow Store.

CI Relationship CI Configuration Item [cmdb_ci] Hosted on::Hosts Logical Datacenter [cmdb_ci_logical_datacenter] Logical Datacenter [cmdb_ci_logical_datacenter] Hosted on::Hosts Cloud Service Account [cmdb_ci_cloud_service_account]

Azure Cloud Discovery API list

<table id=“table_mr2_1qm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

response.name

</td></tr><tr><td>

name

</td><td>

response.name

</td></tr><tr><td>

region

</td><td>

response.displayName

</td></tr><tr><td>

status

</td><td>

Installed

</td></tr></tbody> </table><table id=“table_md1_hqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

response.id

</td></tr><tr><td>

name

</td><td>

response.name

</td></tr><tr><td>

status

</td><td>

Installed/ Retired

</td></tr><tr><td>

state

</td><td>

</td></tr></tbody> </table><table id=“table_q1s_3qm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

state

</td><td>

available

</td></tr><tr><td>

status

</td><td>

Installed/ Retired

</td></tr></tbody> </table><table id=“table_c5j_jqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

state

</td><td>

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

cidr

</td><td>

properties.addressSpace.addressPrefixes

</td></tr></tbody> </table><table id=“table_nfw_jqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

subnetName

</td><td>

response.name

</td></tr><tr><td>

subnetId

</td><td>

response.id

</td></tr><tr><td>

resourceGroup

</td><td>

response.properties.resourceGuid

</td></tr><tr><td>

networkId

</td><td>

response.id.split(‘/subnets/’)

</td></tr><tr><td>

networkName

</td><td>

getNetwork(networkId)

</td></tr><tr><td>

cidrBlock

</td><td>

response.properties.addressSpace.addressPrefixes

</td></tr></tbody> </table><table id=“table_i3l_kqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

state

</td><td>

properties.provisioningState

</td></tr><tr><td>

storage_type

</td><td>

properties.BlobType

</td></tr><tr><td>

volume_id

</td><td>

id

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

size_bytes

</td><td>

properties.diskSizeGB * 1024 * 1024 * 1024

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

size

</td><td>

response.properties.diskSizeGB

</td></tr><tr><td>

“volume_container”

</td><td>

containerName

</td></tr><tr><td>

status

</td><td>

Installed/ Retired

</td></tr></tbody> </table><table id=“table_wdg_lqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

state

</td><td>

properties.provisioningState

</td></tr></tbody> </table><table id=“table_flf_mqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

memory

</td><td>

properties.hardwareProfile.vmSize

</td></tr><tr><td>

state

</td><td>

The instance statuses:- succeeded: on - running: succeeded/stopping - deallocating: stopping/stopped - deallocated: off - terminated: error

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

cpus

</td><td>

properties.hardwareProfile.vmSize

</td></tr><tr><td>

disks

</td><td>

properties.storageProfile.dataDisks

</td></tr><tr><td>

nics

</td><td>

properties.networkProfile.networkInterfaces[].size

</td></tr><tr><td>

vm_inst_id

</td><td>

properties.vmId

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

status

</td><td>

Installed/ Retired

</td></tr></tbody> </table><table id=“table_g25_mqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

object_id

</td><td>

name

</td></tr><tr><td>

vcpus

</td><td>

numberOfCores

</td></tr><tr><td>

memory_mb

</td><td>

memoryInMB

</td></tr><tr><td>

local_storage_gb

</td><td>

resourceDiskSizeInMB

</td></tr><tr><td>

cores

</td><td>

numberOfCores

</td></tr></tbody> </table><table id=“table_udj_nqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

response.id

</td></tr><tr><td>

name

</td><td>

response.name

</td></tr><tr><td>

public_dns

</td><td>

properties.dnsSettings.fqdn

</td></tr><tr><td>

public_ip_address

</td><td>

properties.ipAddress

</td></tr></tbody> </table><table id=“table_jkz_rqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

“properties.frontendIPConfigurations.properties.privateIPAddress OR properties.frontendIPConfigurations.properties.publicIPAddress, then call Public IP Address API”

</td></tr><tr><td>

name

</td><td>

“properties.frontendIPConfigurations.properties.privateIPAddress OR properties.frontendIPConfigurations.properties.publicIPAddress, then call Public IP Address API”

</td></tr><tr><td>

ipaddress_type

</td><td>

“properties.frontendIPConfigurations.properties.privateIPAddress ==> Private IP Address OR properties.frontendIPConfigurations.properties.publicIPAddress ==> Public IP Address”

</td></tr><tr><td>

status

</td><td>

Installed

</td></tr></tbody> </table><table id=“table_jrd_tqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

private_ip

</td><td>

properties.ipConfigurations

</td></tr><tr><td>

public_dns

</td><td>

call public ip address api - properties.dnsSettings.fqdn

</td></tr><tr><td>

state

</td><td>

properties.provisioningState

</td></tr><tr><td>

is_static

</td><td>

properties.ipConfigurations

</td></tr><tr><td>

mac_address

</td><td>

properties.macAddress

</td></tr><tr><td>

public_ip

</td><td>

call public ip address api -

</td></tr></tbody> </table><table id=“table_irp_wqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

name

</td><td>

response.id

</td></tr><tr><td>

object_id

</td><td>

response.name

</td></tr><tr><td>

guest_os

</td><td>

properties.storageProfile.osDisk.osType

</td></tr><tr><td>

image_source

</td><td>

id

</td></tr><tr><td>

status

</td><td>

Installed/ Retired

</td></tr></tbody> </table><table id=“table_sf4_yqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

name

</td><td>

name

</td></tr><tr><td>

object_id

</td><td>

id

</td></tr><tr><td>

sku_name

</td><td>

sku.name

</td></tr><tr><td>

state

</td><td>

properties.provisioningState

</td></tr></tbody> </table><table id=“table_kcf_zqm_qmb”><tbody><tr><td>

CI Attributes

</td><td>

Azure Attributes

</td></tr><tr><td>

object_id

</td><td>

response.id

</td></tr><tr><td>

name

</td><td>

response.name

</td></tr><tr><td>

state

</td><td>

</td></tr><tr><td>

dns_name

</td><td>

properties.

</td></tr><tr><td>

fqdn

</td><td>

</td></tr><tr><td>

canonical_hosted_zone_name

</td><td>

</td></tr></tbody> </table>## Useful information

Keep exploring.

Find another answer, or bring this documentation into your own tools.