There are times when we would like to search the content of our web resources to look for specific unsupported code or to just search for specific content.
Typically, this would be done by searching a source code repository and looking for matching files. While this works, sometimes it would be easier and would save time if we could pass in multiple keywords and generate a file that lists all the web resources with those keywords. This is particularly helpful when you have clients upgrading to newer version of Dynamics 365.
How to Search Web Resources
The approach below describes how we can search by using the Dynamics 365 Service. Alternatively, if you have an On-Premises environment you could request your Administrator to run the SQL query and return the results.
1. Let’s define the keywords we want to search and any web resources we want to exclude from the search. This would usually be third party solutions that we have added, etc.
2. We can now use a Query to retrieve the content of web resources from Dynamics 365 by specifying our criteria to only return the web resources we are interested in. Since we cannot directly query the content of the web resource, we would have to query it after we convert it from the base 64 string.
3. Once we have the web resource content mapped to the name of the web resource, we can use the keywords we have defined to start searching. Since a web resource could match on multiple keywords, we get the distinct one in the last step.
4. Now that we have the list of all the web resources, we can output this information to a file easily.
Happy Dynamics 365’ing!