Skip to content

Commit

Permalink
Pull resource group name from instance_id
Browse files Browse the repository at this point in the history
  • Loading branch information
esebesto committed Jul 25, 2024
1 parent 184bf82 commit c6e5c08
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nise/generators/azure/azure_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c6e5c08

Please sign in to comment.