Skip to content

Add ContractCommitment dataset#2130

Draft
flanakin wants to merge 3 commits into
flanakin/focus14from
flanakin/focus14-phase3-contractcommitment
Draft

Add ContractCommitment dataset#2130
flanakin wants to merge 3 commits into
flanakin/focus14from
flanakin/focus14-phase3-contractcommitment

Conversation

@flanakin
Copy link
Copy Markdown
Collaborator

@flanakin flanakin commented May 6, 2026

Summary

Phase 3 of FOCUS 1.4 work (parent: #2120). Adds the FOCUS 1.3 Contract Commitment supplemental dataset end-to-end.

Stacked on phase 2 (#2128). GitHub auto-retargets the base when phase 2 merges.

Files

  • MODIFIED: `IngestionSetup_RawTables.kql` — adds `ContractCommitment_raw` table with the 14 mandatory FOCUS 1.3 columns plus standard hubs source metadata, parquet ingestion mapping, retention policies, and streaming-ingestion disable.
  • MODIFIED: `IngestionSetup_v1_3.kql` — adds `ContractCommitment_transform_v1_3()`, `ContractCommitment_final_v1_3` table, and update policy.
  • MODIFIED: `HubSetup_v1_3.kql` — adds `ContractCommitment_v1_3()` reading the final table directly. No older versions to union.
  • MODIFIED: `HubSetup_Latest.kql` — adds unversioned `ContractCommitment()` aliasing to `ContractCommitment_v1_3()`.

FOCUS 1.3 columns

Column Type
BillingCurrency string
ContractCommitmentCategory string
ContractCommitmentCost real
ContractCommitmentId string
ContractCommitmentPeriodEnd datetime
ContractCommitmentPeriodStart datetime
ContractCommitmentQuantity real
ContractCommitmentType string
ContractCommitmentUnit string
ContractId string
ContractPeriodEnd datetime
ContractPeriodStart datetime
InvoiceIssuerName string
PricingCurrency string

Plus standard hubs add-ons: `x_IngestionTime`, `x_SourceName`, `x_SourceProvider`, `x_SourceType`, `x_SourceVersion`.

Notes

  • Cost Management has not yet shipped a Contract Commitment export, so the `x_Source*` fields default to empty strings. They get populated when an actual export is wired in.
  • The transform is intentionally minimal (passthrough projection) because the column shape is already FOCUS-aligned in the raw table.

Closes #2129

Test plan

  • Pester unit tests pass: 192/192 in HubsIngestionQueries.Tests.ps1
  • Bicep template compiles cleanly
  • Manual smoke test once Cost Management ships a Contract Commitment export.

flanakin and others added 3 commits May 6, 2026 08:07
Adds IngestionSetup_v1_3.kql with Costs/Prices/CommitmentDiscountUsage/
Recommendations/Transactions transforms and final tables renamed for
FOCUS 1.3. Cost and Usage gains 8 new FOCUS 1.3 columns:
AllocatedMethodId/Details/ResourceId/ResourceName/Tags (data-generator
split cost allocation), ContractApplied (per-row contract commitment
application), ServiceProviderName + HostProviderName (replacing the
deprecated ProviderName/PublisherName, with empty-fallback for back
compat).

Costs_raw now carries the new columns so downstream v1_2 transforms
keep working and v1_3 transforms can read them directly. The v1_3
file is wired into the Bicep deployment alongside v1_0 and v1_2.

The unversioned Costs() function still aliases to v1_2 — phase 2
adds Costs_v1_3() and retargets Latest.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds HubSetup_v1_3.kql with Costs_v1_3, Prices_v1_3,
CommitmentDiscountUsage_v1_3, Recommendations_v1_3, and
Transactions_v1_3 that union the new Costs_final_v1_3 with the
existing Costs_final_v1_2 and Costs_final_v1_0 tables.

For v1_2 data unioned into the v1_3 view, the 8 new FOCUS 1.3 columns
default to null/empty and ServiceProviderName/HostProviderName are
populated from the deprecated ProviderName/PublisherName for back
compat. The same defaults apply to the v1_0 union arm on top of the
existing v1_0 -> v1_2 conversion.

HubSetup_Latest.kql aliases now point to *_v1_3 functions so the
unversioned Costs(), Prices(), etc. return the latest schema.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds the FOCUS 1.3 Contract Commitment supplemental dataset:
- ContractCommitment_raw table in IngestionSetup_RawTables.kql with
  the 14 mandatory FOCUS 1.3 columns plus standard hubs source
  metadata.
- ContractCommitment_transform_v1_3 + ContractCommitment_final_v1_3
  in IngestionSetup_v1_3.kql, with update policy mapping raw to final.
- ContractCommitment_v1_3 hub function in HubSetup_v1_3.kql that
  reads the final table directly (no older versions to union).
- Unversioned ContractCommitment alias in HubSetup_Latest.kql.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the FOCUS 1.3 Contract Commitment supplemental dataset to the FinOps hubs KQL deployment end-to-end (raw ingestion table → v1_3 transform/final table → hub function → Latest alias), enabling forward-compatible schema support ahead of a Cost Management export.

Changes:

  • Adds ContractCommitment_raw with parquet ingestion mapping, retention policy, and streaming-ingestion disabled.
  • Adds ContractCommitment_transform_v1_3(), ContractCommitment_final_v1_3, and an update policy from raw → final.
  • Exposes the dataset via ContractCommitment_v1_3() and the unversioned ContractCommitment() alias.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/IngestionSetup_RawTables.kql Defines ContractCommitment_raw schema + ingestion mapping + retention + streaming-ingestion disable.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/IngestionSetup_v1_3.kql Adds v1_3 transform, final table, and update policy for ContractCommitment.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/HubSetup_v1_3.kql Adds ContractCommitment_v1_3() hub function reading the v1_3 final table.
src/templates/finops-hub/modules/Microsoft.FinOpsHubs/Analytics/scripts/HubSetup_Latest.kql Adds unversioned ContractCommitment() alias pointing to ContractCommitment_v1_3().

@flanakin flanakin changed the base branch from flanakin/focus14-phase2-hubs-1.3 to flanakin/focus14 May 6, 2026 23:00
@flanakin flanakin marked this pull request as draft May 6, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs: Review 👀 PR that is ready to be reviewed Skill: KQL KQL queries and Data Explorer integration Tool: FinOps hubs Data pipeline solution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants