From c6e5c08d0829e963bc0217c681f55daac00f31c8 Mon Sep 17 00:00:00 2001 From: Eva Sebestova Date: Thu, 25 Jul 2024 14:18:38 +0200 Subject: [PATCH] Pull resource group name from instance_id --- nise/generators/azure/azure_generator.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nise/generators/azure/azure_generator.py b/nise/generators/azure/azure_generator.py index 6fd2088e..349bbe4e 100644 --- a/nise/generators/azure/azure_generator.py +++ b/nise/generators/azure/azure_generator.py @@ -419,6 +419,9 @@ def _update_data(self, row, start, end, **kwargs): row, meter_sub, str(amount), str(rate), str(cost), instance_id, service_tier ) + if instance_id and "resourceGroups/" in instance_id: + resource_group = instance_id.split("resourceGroups/")[-1].split("/")[0] + if self.azure_columns is AZURE_COLUMNS_V2_SUBSCRIPTION: row["SubscriptionId"] = self.subscription_guid row["ResourceGroupName"] = resource_group