This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

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

  • 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