Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cost Reporting #450

Closed
7 tasks done
marrobi opened this issue Jul 13, 2021 · 14 comments
Closed
7 tasks done

Cost Reporting #450

marrobi opened this issue Jul 13, 2021 · 14 comments
Assignees
Labels

Comments

@marrobi
Copy link
Member

marrobi commented Jul 13, 2021

Administrators, PMs and Researchers need to have a clear view on spend and know when hitting budget limits.

Description

  • As a TRE Administrator I want to see the Azure spend for each workspace by custom time frame so that I can understand how much I have spent.

  • As a Workspace Owner I want to see the Azure spend for my workspace by custom time frame so I can see how much I have spent

  • As a Workspace Owner I want to see the Azure spend for my workspace split by workspace service

  • As a Workspace Owner I want to be notified when my workspace has hit its budget limit

Acceptance Criteria

  • API endpoint can retrieve spend for all workspaces
  • API endpoint can retrieve spend for a single workspace
  • API endpoint can returns spend split by workspace service
  • API endpoint can return spend over custom time frame

Feature Design

Implementation

@marrobi marrobi added this to the Backlog milestone Jul 13, 2021
@lenisha
Copy link
Member

lenisha commented Sep 27, 2021

would it be possible also to measure how much % workspace used from core shared services and split costs for them ?

@marrobi marrobi changed the title Budget Management Cost Reporting Jan 11, 2022
@daltskin daltskin modified the milestones: Backlog, Release 0.4 Feb 2, 2022
@yorkecp
Copy link

yorkecp commented Feb 4, 2022

Looking at the API calls I think there needs to be the inclusion of one to return the cost of the costs of the TRE Core. This would be useful from the point of view of service providers so that they can easily see the costs.

In the Workspace related calls we need to make sure we return detailed information about the breakdown as there may need to be subsequent filtering depending on any reserved instance provision within the environment.

@joalmeid
Copy link
Contributor

Here it follows a reviewed set on goals and a suggestions for user stories:

Main Goals:

Provide general cost reporting capability to a TRE instance
TRE Admins, TRE Users/Researchers need to have a clear view on TRE spending costs and on budget limits
TRE Workspace users need to have a clear view on Workspace spending costs and on budget limits
TRE users should be able get alerts around costs and budget limits.

Draft user stories:

As a TRE Admin,
I want to be able to query the total azure spend
So that I understand my overall research costs within this TRE instance
- TRE admin can access the costs endpoint for all TRE instance
- TRE admin gets total azure spend discriminated by workspace
- TRE admin gets total azure spend discriminated by shared service
- TRE admin gets total azure spend for TRE Core
- TRE admin must be able to specify custom time frame, being default calendar month

As a TRE Admin or a Workspace Owner
I want to see the Azure spend for a workspace
so that I can understand how much I have spent.
- Workspace Owner can access the costs endpoint for a workspace he owns
- TRE Admin can access the costs endpoint for any workspace
- TRE Admin/Workspace Owner gets total azure spend discriminated by user resources
- TRE Admin/Workspace Owner gets total azure spend discriminated by workspace shared services
- TRE Admin/Workspace Owner must be able to specify custom time frame, being default calendar month

As a TRE Admin/Workspace Owner
I want to set budget limit
so that I get notified with an alert when my workspace has it its budget limit
- Workspace Owner can set a budget limit for a workspace he owns
- TRE Admin can set a budget limit for any workspace
- TRE Admin/Workspace Owner get a proper alert notification when my workspace has it its budget limit

Implementation

Besides the provided suggestions, if implemented in the TRE API, it will allways depend on the billing info available in Azure REST APIs. At the moment there are few possibilities to investigate:

@joalmeid
Copy link
Contributor

joalmeid commented Apr 7, 2022

Related: #417

@guybartal
Copy link
Contributor

guybartal commented Apr 11, 2022

Design Considerations

Azure REST API provides two types of Cost APIs, Azure Cost Management API and Azure Consumption API.

The Azure Cost Management API provide the ability to explore cost and usage data via multidimensional analysis, where creating customized filters and expressions allow you to answer consumption-related questions for your Azure resources. These APIs are currently available for Azure Enterprise customers.

The Azure Consumption API give you programmatic access to cost and usage data for your Azure resources. These APIs currently only support Enterprise Enrollments and Web Direct Subscriptions (with a few exceptions). The APIs are continually updated to support other types of Azure subscriptions.
Currently doesn't support internal, CSP and sponsored subscription types.

Azure TRE currently deploys workspace services and user resources inside the same resource group per workspace.

Azure TRE API is aware of TRE entity types (workspace, workspace service, user resource), underling azure resources are visible only for resource processor.

Azure Cost Management API supports querying with different types of filtering, aggregation and grouping capabilities and different timeframes:

  • Grouping by - Tag or Dimention (valid values for Dimention: 'ResourceGroup','ResourceGroupName','ResourceLocation','ConsumedService','ResourceType','ResourceId','MeterId','BillingMonth','MeterCategory','MeterSubcategory','Meter','AccountName','DepartmentName','SubscriptionId','SubscriptionName','ServiceName','ServiceTier','EnrollmentAccountName','BillingAccountId','ResourceGuid','BillingPeriod','InvoiceNumber','ChargeType','PublisherType','ReservationId','ReservationName','Frequency','PartNumber','CostAllocationRuleName','MarkupRuleName','PricingModel','BenefitId','BenefitName')

  • Filter by - any Tag in array of values or any Dimention (same as above). note: when filtering by Tag, not all Azure Resources are supported in Cost Management (see list of supported resources).

  • Aggregation - valid values: 'UsageQuantity','PreTaxCost','Cost','CostUSD','PreTaxCostUSD'

  • Timeframe - Valid values: BillingMonthToDate, Custom (from-to dates), MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate

Cost Management API requiers "Billing Reader" Role Assignment to be called.

Azure Consumption API (Usage Details)

  • doesn't supports cost aggregation but only list of usage
  • doesn't supports start and end date but only per scope of billing
  • filtering by tags and resource groups will get deprecated.

Design Options

Option 1 Option 2 Option 3 Option 4
Description Group by resource group Group by Workspace / Workspace Service / User Resource Tags Filter by Resource IDs Combine option 2 and 3
tag resources, fetch resource ids
then group by resource ids
Pros Easy to implement Decouple TRE modules Supported by all resource types * Decouple TRE modules
* Supports all resource types
Cons * Supports only workspace level
* Couple with resource processor internal implementation
* Not all azure resources supports tagging in Azure Cost management API
* Complex - need to add tags for every resource
* very complex - need to return resource ID from resoruce processor and store in cosmos * Complex - need to add tags for every resource
* need to traverse tree of workspaces resources to generate the report

Option 4 is the prefered option.

Tagging resources upon creation

Cost report API will rely on Azure tagging to be able to generate cost report for core, shared, workspace, workspace services and user resources.
When creating each one of the above we need to make sure that underling Azure resources are taged with the corresponding tag:

There are two options to be decided for tagging:

Option 1 - allows support for built in budget in azure, but more error prone:

  • Core Services - each core service will have a tag named "tre_core_service_id" with a value of the TRE ID to discriminate all core services per TRE instance
  • Shared Services - each core service will have a tag named "tre_shared_service_id" with a value of the shared service id to discriminate each and every shared service
  • Workspace Services - each workspace service will have:
    • "tre_workspace_id" with a value of the workspace id to discriminate each resource by workspace level
    • "tre_workspace_service_id" with a value of the workspace service id to discriminate each resource by workspace service level
  • User Resource - each user resource will have the following tags:
    • "tre_workspace_id" with a value of the workspace id to discriminate each resource by workspace level
    • "tre_workspace_service_id" with a value of the workspace service id to discriminate each resource by workspace service level
    • "tre_user_resource_id" with a value of the user resource id to discriminate each resource by user resource level

Option 2:

each shared service, workspace service and user resource will get tag "tre_resource_id" with the value of its id when it get generated.
each azure resource will get tre_id tag with the id of tre instance, can be implemented with azure policy on the resource group or by terraform.
default/core services will be identified as resources without tre_resource_id.

TRE Admin Cost Reporting - overall cost report

Description

Get overall cost report for TRE instance (core services), per shared services and per workspace

Authorization

Only TRE Admin can call this url, others will get unauthorized

Input

POST /costs
Payload:

{
    "timePeriod": {"from":"MM/DD/YYYY","to":"MM/DD/YYYY"}, // up to 1 year timespan
    "granularity":"Daily|None" // None will summarize for the timefame
}

Output

{
    "coreServices": [
        {"date":"", "cost":"", "currency":""} // date will return only for Daily granularity
        ],
    "sharedServices": [ {
        "id":"shared service id",
        "name":"shared service name",
        "costs": [
            {"date":"", "cost":"", "currency":""} // date will return only for Daily granularity
            ]
        }],
    "workspaces": [ {
        "id": "workspace id",
        "name": "workspace name", 
        "costs":[
            {"date":"", "cost":"", "currency":""} // date will return only for Daily granularity
            ]}
        ]
}

sequence diagram

image

Get resource ids by tag

GET https://management.azure.com/subscriptions/{{subscriptionId}}/resources?api-version=2021-04-01&$filter=tagName eq 'workspace_id' and tagValue eq '34f28ac6-55a5-4c2f-9d81-22dda52a08cc'

Output example:

{
    "value": [
        {
            "id": "/subscriptions/xxxx/resourceGroups/rg-anatbal6-ws-08cc/providers/Microsoft.Network/networkInterfaces/internal-nic-anatbal6-ws-08cc-svc-71d7",
            "name": "internal-nic-anatbal6-ws-08cc-svc-71d7",
            "type": "Microsoft.Network/networkInterfaces",
            "location": "eastus",
            "tags": {
                "workspace_id": "34f28ac6-55a5-4c2f-9d81-22dda52a08cc",
                "workspace_service_id": "71d7"
            }
        },
        {
            "id": "/subscriptions/xxxx/resourceGroups/rg-anatbal6-ws-08cc/providers/Microsoft.Compute/virtualMachines/windowsvm71d7",
            "name": "windowsvm71d7",
            "type": "Microsoft.Compute/virtualMachines",
            "location": "eastus",
            "identity": {
                "principalId": "45fd0951-08c5-4e49-a704-5227edb18599",
                "tenantId": "72f988bf-86f1-41af-91ab-2d7cd011db47",
                "type": "SystemAssigned"
            },
            "tags": {
                "parent_service_id": "e67c8bf9-442f-406b-b40c-e482f190c1f1",
                "workspace_id": "34f28ac6-55a5-4c2f-9d81-22dda52a08cc",
                "workspace_service_id": "71d7"
            }
        },
      ]
}

Notice that each resource matching query is returned with all its tags.

Cost management API payload

POST https://management.azure.com/subscriptions/{{subscriptionId}}/providers/Microsoft.CostManagement/query?api-version=2021-10-01&$expand=properties/data

Payload:

{
    "type": "Usage",
    "timeframe": "Custom", // can be also BillingMonthToDate|MonthToDate|TheLastBillingMonth|TheLastMonth|WeekToDate according to input
    "timePeriod": {
        "from": "MM/DD/YYYY",
        "to": "MM/DD/YYYY"
    },
    "dataset": {
        "granularity": "Daily",  // can be also "None" for total costs
        "aggregation": {
            "totalCost": {
                "name": "Cost",
                "function": "Sum"
            }
        },
        "filter": {
            "dimensions": {
                "name": "ResourceId",
                "operator": "In",
                "values": [
                    /// List of Azure resource ids as strings
                ]
            }
        }
    }
}

Output example:

{
    "id": "subscriptions/xxxx/providers/Microsoft.CostManagement/query/yyyy",
    "name": "yyy",
    "type": "Microsoft.CostManagement/query",
    "location": null,
    "sku": null,
    "eTag": null,
    "properties": {
        "nextLink": null,
        "columns": [
            {
                "name": "Cost",
                "type": "Number"
            },
            {
                "name": "UsageDate",
                "type": "Number"
            },
            {
                "name": "Currency",
                "type": "String"
            }
        ],
        "rows": [
            [
                0.00032930107526881738,
                20211208,
                "USD"
            ],
            [
                0.0011290322580645167,
                20211209,
                "USD"
            ],
            [
                0.0011290322580645167,
                20211210,
                "USD"
            ],
        ]
    }
}

TRE Admin / Workspace Owner Cost Reporting - specific workspace cost report

Description

Get overall cost report for a specific workspace

Authorization

Only TRE Admin and the workspace owner can call this url, others will get unauthorized

Input

POST /workspace/{workspace_id}/costs
Payload:

{
    "timePeriod": {"from":"MM/DD/YYYY","to":"MM/DD/YYYY"}, // up to 1 year timespan
    "granularity":"Daily|None" // None will summarize for the timefame
}

Output

{
    "sharedServices": [ {
      "sharedServiceId":"",
      "costs": [
          {"date":"", "cost":"", "currency":""} // date will return only for Daily granularity
          ]
      }],
    "workspace": {
      "id": "workspace id",
      "name": "workspace name", 
      "workspaceServices":[{
        "id": "workspace service id",
        "name": "workspace service name", 
          "costs":[{"date":"", "cost":"", "currency":""}], // date will return only for Daily granularity
          "userResources":[{
            "id": "user resource id",
            "name": "user resource name", 
            "costs":[{"date":"", "cost":"", "currency":""}], // date will return only for Daily granularity
          }]
        }]
      }
}

Sequence diagram

image

@eladiw
Copy link
Contributor

eladiw commented Apr 12, 2022

@guybartal does option 3 means you get a cost report per resource? is that what group by resource id means?
and option 3 means the same but instead of asking for the cost of these resource ids, you ask for the tags?

if so, I think that getting the resource cost is too fine grained, I think that the ws service or ws user resource level is better.

@guybartal
Copy link
Contributor

guybartal commented Apr 12, 2022

@guybartal does option 3 means you get a cost report per resource? is that what group by resource id means? and option 3 means the same but instead of asking for the cost of these resource ids, you ask for the tags?

if so, I think that getting the resource cost is too fine grained, I think that the ws service or ws user resource level is better.

Thanks for raising this @eladiw, I changed "Group by" to "Filter By", it was a typo. I meant that the cost will be daily / total for a period and get filtered by a set of resources, it doen't make sense to group by a resource.

@eladiw
Copy link
Contributor

eladiw commented Apr 12, 2022

looks good. I like the fact you dont assume to keep track of the resource ids, and ask them from the management api

@guybartal
Copy link
Contributor

guybartal commented May 1, 2022

Status

  • Draft
  • Proposed
  • Accepted
  • Deprecated

Design Considerations

Azure REST API provides two types of Cost APIs, Azure Cost Management API and Azure Consumption API.

The Azure Cost Management API provide the ability to explore cost and usage data via multidimensional analysis, where creating customized filters and expressions allow you to answer consumption-related questions for your Azure resources. These APIs are currently available for Azure Enterprise customers.

The Azure Consumption API give you programmatic access to cost and usage data for your Azure resources. These APIs currently only support Enterprise Enrollments and Web Direct Subscriptions (with a few exceptions). The APIs are continually updated to support other types of Azure subscriptions.
Currently doesn't support internal, CSP and sponsored subscription types.

Azure TRE currently deploys workspace services and user resources inside the same resource group per workspace.

Azure TRE API is aware of TRE entity types (workspace, workspace service, user resource), underling azure resources are visible only for resource processor.

Cost and usage data is typically available within 8-24 hours and budgets are evaluated against these costs every 24 hours.

Azure Cost Management API supports querying with different types of filtering, aggregation and grouping capabilities and different timeframes:

  • Grouping by - Tag or Dimention (valid values for Dimention: 'ResourceGroup','ResourceGroupName','ResourceLocation','ConsumedService','ResourceType','ResourceId','MeterId','BillingMonth','MeterCategory','MeterSubcategory','Meter','AccountName','DepartmentName','SubscriptionId','SubscriptionName','ServiceName','ServiceTier','EnrollmentAccountName','BillingAccountId','ResourceGuid','BillingPeriod','InvoiceNumber','ChargeType','PublisherType','ReservationId','ReservationName','Frequency','PartNumber','CostAllocationRuleName','MarkupRuleName','PricingModel','BenefitId','BenefitName')

  • Filter by - any Tag in array of values or any Dimention (same as above). note: when filtering by Tag, not all Azure Resources are supported in Cost Management (see list of supported resources).

  • Aggregation - valid values: 'UsageQuantity','PreTaxCost','Cost','CostUSD','PreTaxCostUSD'

  • Timeframe - Valid values: BillingMonthToDate, Custom (from-to dates), MonthToDate, TheLastBillingMonth, TheLastMonth, WeekToDate

Cost Management API requiers "Billing Reader" Role Assignment to be called.

Consumption API (Usage Details)

  • doesn't supports cost aggregation but only list of usage
  • doesn't supports start and end date but only per scope of billing
  • filtering by tags and resource groups will get deprecated.

Design Options

Option 1 Option 2 Option 3
Description Group by resource group Group by Workspace / Workspace Service / User Resource Tags Filter by Resource IDs
Pros Easy to implement Decouple TRE modules Supported by all resource types
Cons * Supports only workspace level
* Couple with resource processor internal implementation
* Not all azure resources supports tagging in Azure Cost management API
* Complex - need to add tags for every resource, developer might miss tags when authoring new template
* very complex - need to return resource ID from resoruce processor and store in cosmos

Option 2 is the prefered option.

Tagging resources upon creation

Cost report API will rely on Azure tagging to be able to generate cost report for core, shared, workspace, workspace services and user resources.
When creating each one of the above we need to make sure that underling Azure resources are taged with the corresponding tag:

  • All resources of a TRE instance should have tre_id with a value of the tre id.
  • Core Services - each core service will have a tag named "tre_core_service_id" with a value of the TRE ID to descriminate all core services per TRE instance
  • Shared Services - each core service will have a tag named "shared_service_id" with a value of the shared service id to descriminate each and every shared service
  • Workspace Services - each workspace service will have:
    • "workspace_id" with a value of the workspace id to descriminate each resource by workspace level
    • "workspace_service_id" with a value of the workspace service id to descriminate each resource by workspace service level
  • User Resource - each user resource will have the following tags:
    • "workspace_id" with a value of the workspace id to descriminate each resource by workspace level
    • "workspace_service_id" with a value of the workspace service id to descriminate each resource by workspace service level
    • "user_resource_id" with a value of the user resource id to descriminate each resource by user resource level

main ACR and Storage Account will not be tagged as those resources are used to spin up more than one Azure TRE Instance.

Tagging this way will allow to define budgets per TRE Resource.

TRE Admin Cost Reporting - overall cost report

Description

Get overall cost report for TRE instance (core services), per shared services and per workspace

Authorization

Only TRE Admin can call this url, others will get unauthorized

Input

GET /api/costs?from=MM/DD/YYYY&to=MM/DD/YYYY&granularity=Daily

Parameters:

  • from, to - time period, up to 1 year timeframe, format MM/DD/YYYY
  • granularity - Daily | None for total count in timeframe (default)

Output

200 OK

When granularity = Daily:

{
    "coreServices": [
        {"date":"", "cost":"", "currency":""} 
        ],
    "sharedServices": [ {
        "id":"shared service id",
        "name":"shared service name",
        "costs": [
            {"date":"", "cost":"", "currency":""} 
            ]
        }],
    "workspaces": [ {
        "id": "workspace id",
        "name": "workspace name", 
        "costs":[
            {"date":"", "cost":"", "currency":""} 
            ]}
        ]
}

When granularity = None:

{
    "coreServices": 
        [{"cost":"", "currency":""}],
    "sharedServices": [ {
        "id":"shared service id",
        "name":"shared service name",
        "costs": [{"cost":"", "currency":""}]
        }],
    "workspaces": [ {
        "id": "workspace id",
        "name": "workspace name", 
        "costs":[{"cost":"", "currency":""}]
        }]
}

TRE Admin / Workspace Owner Cost Reporting - specific workspace cost report

Description

Get overall cost report for a specific workspace

Authorization

Only TRE Admin and the workspace owner can call this url, others will get unauthorized

Input

GET /api/workspaces/{workspace_id}/costs?from=MM/DD/YYYY&to=MM/DD/YYYY&granularity=Daily

Parameters:

  • from, to - time period, up to 1 year timeframe, format MM/DD/YYYY
  • granularity - Daily | None for total count in timeframe (default)

Output

200 OK

When granularity = Daily:

{
      "id": "workspace id",
      "name": "workspace name", 
      "workspaceServices":[{
        "id": "workspace service id",
        "name": "workspace service name", 
          "costs":[{"date":"", "cost":"", "currency":""}], 
          "userResources":[{
            "id": "user resource id",
            "name": "user resource name", 
            "costs":[{"date":"", "cost":"", "currency":""}], 
          }]
        }]
}

When granularity = None:

{
 
      "id": "workspace id",
      "name": "workspace name", 
      "workspaceServices":[{
        "id": "workspace service id",
        "name": "workspace service name", 
          "costs":{"cost":"", "currency":""}, 
          "userResources":[{
            "id": "user resource id",
            "name": "user resource name", 
            "costs":[{"cost":"", "currency":""}]
          }]
        }]
}

TRE Researcher Cost Reporting - specific user resource cost report

Description

Get cost report for a specific user resource

Authorization

Only TRE researcher and the workspace owner, and tre admin can call this url, others will get unauthorized

Input

GET /api/workspaces/{workspace_id}/service/{workspace_service_id}/resource/{user_resource_id}/costs?from=MM/DD/YYYY&to=MM/DD/YYYY&granularity=Daily

Parameters:

  • from, to - time period, up to 1 year timeframe, format MM/DD/YYYY
  • granularity - Daily | None for total count in timeframe (default)

Output

200 OK

When granularity = Daily:

{
            "id": "user resource id",
            "name": "user resource name", 
            "costs":[{"date":"", "cost":"", "currency":""}]
}

When granularity = None:

{
            "id": "user resource id",
            "name": "user resource name", 
            "costs":[{"cost":"", "currency":""}]
}

Sequence Diagrams

image
source

Cost management Query API

Query API will return a flat result of all cost with every tag combination which exists on the filtered resources by the provided tag, meaning that a resource which has tre_id, tre_workspace_id, and tre_workspace_service_id will get be summerized in all three tags.

calls to this API shoud be cached for X hours to reduce load and have better performance.

example

Group costs by tag name and filter only resources which have this tag,
if filtered resources have more tags, the tags will apear in the result.

@SUBSCRIPTION = FILL_YOUR_SUBSCRIPTION_ID

@COST_API_URI = https://management.azure.com/subscriptions/{{SUBSCRIPTION}}/providers/Microsoft.CostManagement
@COST_API_VERSION = 2021-10-01
@TRE_ID = FILL_TRE_ID
@TIME_FROM = MM/DD/YYYY
@TIME_TO = MM/DD/YYYY

POST {{COST_API_URI}}/query?api-version={{COST_API_VERSION}}&$expand=properties/data
Authorization: {{$aadToken $aadV2TenantId}}
Content-Type: application/json

Payload:

{
    "type": "Usage",
    "timeframe": "Custom", // can be also BillingMonthToDate|MonthToDate|TheLastBillingMonth|TheLastMonth|WeekToDate according to input
    "timePeriod": {
        "from": "{{TIME_FROM}}",
        "to": "{{TIME_TO}}"
    },
    "dataset": {
        "granularity": "Daily", // can be also "None" for total costs
        "aggregation": {
            "totalCost": {
                "name": "Cost",
                "function": "Sum"
            }
        },
        "filter": {
            "tags": {
            "name": "tre_id",
            "operator": "In",
            "values" : [
                "{{TRE_ID}}",
                ]
            }
        },
        "grouping": [
            {
                "type": "Tag",
            }
        ]
    }
}

Output example:

{
  "id": "subscriptions/xxxxxxxxxxxxx/providers/Microsoft.CostManagement/query/ec1f0eae-9343-4f4e-a0c0-dd219a66efc4",
  "name": "ec1f0eae-9343-4f4e-a0c0-dd219a66efc4",
  "type": "Microsoft.CostManagement/query",
  "location": null,
  "sku": null,
  "eTag": null,
  "properties": {
    "nextLink": null,
    "columns": [
      {
        "name": "Cost",
        "type": "Number"
      },
      {
        "name": "Tag",
        "type": "String"
      },
      {
        "name": "Currency",
        "type": "String"
      }
    ],
     "rows": [
      [
        3.9306515711531222,
        "\"tre_core_service\":\"guy21\"",
        "USD"
      ],
      [
        11.66335497490112,
        "\"tre_id\":\"guy21\"",
        "USD"
      ],
      [
        0.033,
        "\"tre_shared_service\":\"2fea\"",
        "USD"
      ],
      [
        3.62175702964083,
        "\"tre_shared_service\":\"4a5b\"",
        "USD"
      ],
      [
        0.093523886643774659,
        "\"tre_user_resource_id\":\"126d\"",
        "USD"
      ],
      [
        0.078465743393993009,
        "\"tre_user_resource_id\":\"2627\"",
        "USD"
      ],
      [
        0.20275980676694544,
        "\"tre_user_resource_id\":\"319e\"",
        "USD"
      ],
      [
        0.17165788614506686,
        "\"tre_user_resource_id\":\"3370\"",
        "USD"
      ],
      [
        0.17518017912599823,
        "\"tre_user_resource_id\":\"b2be\"",
        "USD"
      ],
      [
        0.39905729127776768,
        "\"tre_workspace_id\":\"5e86\"",
        "USD"
      ],
      [
        0.98272254462049369,
        "\"tre_workspace_id\":\"af30\"",
        "USD"
      ],
      [
        0.17198963003776765,
        "\"tre_workspace_service\":\"8d0a\"",
        "USD"
      ],
      [
        0.54959787203801058,
        "\"tre_workspace_service\":\"e70d\"",
        "USD"
      ]
    ]
  }
}

@guybartal
Copy link
Contributor

guybartal commented May 3, 2022

@eladiw @tamirkamara @joalmeid @marrobi,
I've updated the design, can you please approve?

@marrobi
Copy link
Member Author

marrobi commented May 3, 2022

@guybartal while adding tags, can everything be tagged with tre_id in the instance where there are multiple TREs this would be useful when filtering resources etc.

Also can we use the format tre_workspace_id and tre_workspace_service_id, to distinguish that these tags are the TRE tags. In some cases there are many, many tags, so if they are grouped together alphabetically makes life easier when working in the portal.

Also not necessarily part of v1, but is there any way we can check that resources that have just been deployed have appropriate tags? Maybe check all resources deployed by the resource processor in the RG have a tre_id and at least a tre_shared_service or tre_workspace_id tag?

Thanks.

@guybartal
Copy link
Contributor

guybartal commented May 3, 2022

@guybartal while adding tags, can everything be tagged with tre_id in the instance where there are multiple TREs this would be useful when filtering resources etc.

Also can we use the format tre_workspace_id and tre_workspace_service_id, to distinguish that these tags are the TRE tags. In some cases there are many, many tags, so if they are grouped together alphabetically makes life easier when working in the portal.

Also not necessarily part of v1, but is there any way we can check that resources that have just been deployed have appropriate tags? Maybe check all resources deployed by the resource processor in the RG have a tre_id and at least a tre_shared_service or tre_workspace_id tag?

Thanks.

Thanks for commenting on this @marrobi, acctually I was counting on this tag for better perfomance upon calling the Cost Management API... I've updated the design.

@guybartal
Copy link
Contributor

guybartal commented May 10, 2022

@joalmeid @marrobi @eladiw @tamirkamara @LizaShak
design updated to reflect cache + gralularity options (daily + totals) between custom time frame

@tamirkamara
Copy link
Collaborator

@guybartal @joalmeid can we close this feature is it's done?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Initial Scope Complete
Development

No branches or pull requests

8 participants