Example 2: Configuring the Azure Plugin with a Custom Action

In this example, we are going to configure the Azure Asset Discovery Plugin by creating and executing a custom action through the BigFix WebUI.

Like in the AWS example described in Example 1: Configuring the AWS Plugin we can assume that we already installed the Azure Plugin.

See below the details reported by the WebUI about the Azure Plugin.



We want to create a custom action for configuring two users, foo and bar, for which we have their TenantID, SubscriptionID, ClientID and ClientSecret available.

Under WebUI > Apps > Custom, click Create Custom Content.

Type in a Name and a Description for the item, if you want.



Then, we could add the following relevances to ensure that we target the right device (which should always be the Plugin Portal on which the Azure Plugin is installed):
if exists property "in proxy agent context" then ( not in proxy agent context ) else true

version of registration server >= "10.0"

version of client >= "10.0"

exists plugin portal service

((exists plugin store "AzureAssetDiscoveryPlugin") and (exists key "Base_Version" of plugin store 
"AzureAssetDiscoveryPlugin")) or (exists true whose(if true then (exists file "AzureAssetDiscoveryPlugin.dll" of folder 
"AzureAssetDiscoveryPlugin" of folder "Plugins" of folder of plugin portal service) else false)) or (exists file 
"/opt/BESPluginPortal/Plugins/AzureAssetDiscoveryPlugin/AzureAssetDiscoveryPlugin.so")


Now, similarly to what we did for the AWS Plugin, let us build the action script for the configuration.
Note: The values that you must replace are only the ones wrapped by angled brackets, like <myTenantID1>.
parameter "firstLabel" = "foo"
parameter "secondLabel" = "bar"

parameter "tenantID" = "Credentials_TenantID"
parameter "clientID" = "Credentials_ClientID"
parameter "secret" = "Credentials_ClientSecret"
parameter "subscriptionID" = "Credentials_SubscriptionID"

plugin store "AzureAssetDiscoveryPlugin" set "{parameter "tenantID"}_{parameter "firstLabel"}" value "<myTenantID1>" on "{parameter "action issue date" of action}"
plugin store "AzureAssetDiscoveryPlugin" set "{parameter "clientID"}_{parameter "firstLabel"}" value "<myClientID1>" on "{parameter "action issue date" of action}"
plugin store "AzureAssetDiscoveryPlugin" set encrypted "{parameter "secret"}_{parameter "firstLabel"}" value "<myClientSecret1>" on "{parameter "action issue date" of action}"
plugin store "AzureAssetDiscoveryPlugin" set "{parameter "subscriptionID"}_{parameter "firstLabel"}" value "<mySubscriptionID1>" on "{parameter "action issue date" of action}"

plugin store "AzureAssetDiscoveryPlugin" set "{parameter "tenantID"}_{parameter "secondLabel"}" value "<myTenantID2>" on "{parameter "action issue date" of action}"
plugin store "AzureAssetDiscoveryPlugin" set "{parameter "clientID"}_{parameter "secondLabel"}" value "<myClientID2>" on "{parameter "action issue date" of action}"
plugin store "AzureAssetDiscoveryPlugin" set encrypted "{parameter "secret"}_{parameter "secondLabel"}" value "<myClientSecret2>" on "{parameter "action issue date" of action}"
plugin store "AzureAssetDiscoveryPlugin" set "{parameter "subscriptionID"}_{parameter "secondLabel"}" value "<mySubscriptionID2>" on "{parameter "action issue date" of action}"
Note: foo and bar are just invented names for our labels. However, Credentials_TenantID, Credentials_ClientID, Credentials_ClientSecret and Credentials_SubscriptionID are real setting names. We are defining these four parameters because, by combining them, we can define the keys that we need to set the user key and password like specified above.

Now let us copy and paste the whole script in the Action box, ensuring that we select all lines of action script have completed successfully:



We can now choose the Site we want and then click Save.



Now we can just go back to the WebUI > Apps > Custom application and deploy the newly created Task to configure the Plugin.

After completing this, you should be able to see the new users in the Plugin Management panel: