I created a Logic Apps that allows me to query the Azure Resource Graph Explorer and send a list of untagged resources through e-mail.
The Logic Apps is parsing JSON and putting the results in CSV. The CSV looks like this:
name | type | location | tags_createdBy |
---|---|---|---|
Resource | microsoft.compute/virtualmachines | westeurope | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | westeurope | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | eastus | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | germanywestcentral | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | westeurope | albert.einstein@contoso.com |
Resource | microsoft.compute/virtualmachines | switzerlandnorth | albert.einstein@contoso.com |
Resource | microsoft.sql/servers/databases | eastus | |
Resource | microsoft.storage/storageaccounts | westeurope | |
Resource | microsoft.storage/storageaccounts | switzerlandnorth | robert.fish@contoso.com |
Resource | microsoft.storage/storageaccounts | eastus | robert.fish@contoso.com |
Resource | microsoft.storage/storageaccounts | germanywestcentral | robert.fish@contoso.com |
Resource | microsoft.storage/storageaccounts | germanywestcentral | robert.fish@contoso.com |
Resource | microsoft.storage/storageaccounts | eastus | |
Resource | microsoft.storage/storageaccounts | eastus | |
Resource | microsoft.storage/storageaccounts | eastus | hello.world@contoso.com |
Resource | microsoft.storage/storageaccounts | eastus | |
Resource | microsoft.storage/storageaccounts | westeurope |
I would like to parse the tags_createdBy column and take a list of e-mails.
In this case in example the e-mails will be only 3:
- albert.einstein@contoso.com
- robert.fish@contoso.com
- hello.world@contoso.com
I then would like to insert those e-mails in the list of recipients because I want them to receive that e-mail, like this:
So the question is how to:
- parse JSON or CSV file
- take each value only one and erase NULLs
- separate each value by a column or semi column
- insert that into the e-mail recipient in Logic App.