31 May 2024 01:13 PM
Hello.
We want to filter the services that are created by Azure Entities (AZ Funtions, App Services etc.) for a specific subscription.
By filtering, we mean either with a tagging rule or management zone.
Has anyone ever done something like this?
Solved! Go to Solution.
31 May 2024 01:58 PM
So you should create a tag called "Subscription:<value>". Then your only option is the entity selector with a from relationship to the Azure subscription included (I assume these services will have the relationship but please check 🙂 ).
Example:
type(CUSTOM_DEVICE),fromRelationships.belongsTo(type("AZURE_SUBSCRIPTION"),azureSubscriptionUuid("<entertheIDhere>"))
A list of all entity types for Azure can be found at the end of this page:
All Azure cloud services - Dynatrace Docs
31 May 2024 02:21 PM
Hi Marina. Actually we want a Service entity and not a custom device. Services are not directly linked to Azure metadata such as Subscription UUID. So basically the query is:
Services that run to Azure App Services that belong to a specific subscription.
01 Jun 2024 05:59 PM - edited 01 Jun 2024 06:01 PM
Hi @Theodore_x86
I think the easiest way to get services into in your Azure App Services for subscription, is configure Services Principal with only one Subscription. 😁but if is not possible, this can useful.
This way it will be much more manageable for you to achieve what you need. In addition, you will have much more information on very useful metrics for each of your services and you will be able to take advantage of it all with Dynatrace.
That way you can get the list of services running in Azure App Services filtered by subscription
I hope it's helpful 💪
03 Jun 2024 11:47 AM
Hello Pierre.
I am not sure I understand completely. If I manage to put a tag in the OneAgent installation will this be attached to the service or to the host running the App Service? And why are you using 2 tags? Shouldn't the first tag with the subscriptionID be enough?
03 Jun 2024 03:59 PM - edited 03 Jun 2024 04:02 PM
We just discovered the following page:
https://docs.dynatrace.com/docs/shortlink/tags-and-management-zones-azure#entity-selector-examples
It basically explains everything and it can be proven quite handy for entity selectors.
For this case the expression should be:
type(SERVICE), fromRelationships.runsOnOsi(type(HOST), toRelationships.isPgAppOf(type(AZURE_FUNCTION_APP),fromRelationships.isAccessibleBy(type(AZURE_SUBSCRIPTION),entityName("Cloud Dev Subcription"))))
Thank you all for your replies!
BR