cancel
Showing results for 
Search instead for 
Did you mean: 
Create Post
Level 12

Use API to change credentials on Application and AppInsight ?

Hello,

Using the API (CreateApplication) we can add an application to a node.

Is it possible to use the API to change the credentials assigned to an application or an appinsight to a node using the API ?

Mathieu

0 Kudos
1 Reply
Level 7

Yes, it is possible to change credentials assignment for both: AppInsights and SAM Applications.

For AppInsights you have to update settings in Orion.APM.ApplicationSettings entity. This can be done with a sample PowerShell script:

# Setting key may differ depending on AppInsight selection.
$query = "SELECT Uri FROM Orion.APM.ApplicationSettings WHERE Key = 'CredentialSetId' AND ApplicationID = {AppInsightID}"
$uri = Get-SwisData $swis $query 
$properties = @{
    #set value for AppInsight level credentials. Credential ID can be taken from Orion.Credential entity
    #There are some special values: None = 0; Inherit_From_Node = -3
    Value = '-3' ;
}
Set-SwisObject $swis $uri $properties

If you would like to change credentials for SAM Application, you have to update credentials property (key = "__CredentialSetId") for each component in the entity: Orion.APM.ComponentSetting