How to Consume Azure REST API in ServiceNow OutBound REST Message

Narasinhak
Tera Expert

I need to call following azure API from ServiceNow REST Message.

https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Compute/virtualMachines/{vmName}/start?api-version=2021-03-01

What are the steps to achieve this?

 

 

1 ACCEPTED SOLUTION

Ben Carlsten -
Giga Guru
Have you tried using the links in the REST API reference to try the call? It will give you the command to use in the Try it space, just need to translate it to a REST call from servicenow from there. https://docs.microsoft.com/https://docs.microsoft.com/en-us/rest/api/compute/virtual-machines/list-all-us/rest/api/compute/virtual-machines/start

View solution in original post

6 REPLIES 6

Rahul Priyadars
Giga Sage
Giga Sage

Refer Below URL for steps .

https://helpcentre.buttonwood.net/hc/en-us/articles/360000338036-ServiceNow-Example-How-to-Create-REST-API-Requests

Regards

RP

Narasinhak
Tera Expert

I am looking specifically for Azure REST API integration, including steps to create access token as well.

what is your end goal ?

Concept remains same whether REST END POINT is of AZURE or Any system which support REST using basic auth or OAUTH.

Regards

RP

Conceptually I am aware of the flow. But during implementation I am getting following error:

"error": {
        "code": "InvalidAuthenticationTokenAudience",
        "message": "The access token has been obtained for wrong audience or resource '00000002-0000-0000-c000-000000000000'. It should exactly match with one of the allowed audiences 'https://management.core.windows.net/','https://management.core.windows.net','https://management.azure.com/','https://management.azure.com'."
    }
 
So not sure which step I am missing out.