Skip to content

architecture

github-actions edited this page Oct 21, 2023 · 3 revisions

FinOps toolkit uses Azure Bicep templates and PowerShell scripts to deploy Azure resources. Each solution utilizes different Azure services to meet specific requirements.

Starter templates that are optimized for customization will be customizable and may offer multiple deployment options. Advanced solutions, like FinOps hubs, may have fewer options to ensure the highest quality and completeness.

On this page:


๐Ÿ“‚ Folder structure

Name Description
docs Public-facing toolkit docs.
docs-wiki Repo wiki for internal dev docs.
src Source code and dev docs.
โ”œโ”€ bicep-registry Bicep registry modules.
โ”œโ”€ open-data Open data.
โ”œโ”€ power-bi Power BI reports.
โ”œโ”€ powershell PowerShell module functions.
โ”œโ”€ templates ARM deployment templates.
โ”‚ ย ย  โ””โ”€ finops-hub FinOps hub template.
โ””โ”€ workbooks Azure Monitor workbooks.
ย  ย ย  โ”œโ”€ governance Governance workbook.
ย  ย ย  โ””โ”€ optimization Optimization workbook.

Files and folders should use kebab casing (e.g., this-is-my-folder). The only exception is for RP namespaces in module paths.


๐ŸŽ About Bicep

FinOps toolkit templates are comprised of Bicep modules. Bicep is a domain-specific language that uses declarative syntax to define and deploy Azure resources. For a guided learning experience, start with the Fundamentals of Bicep.

We prefer Bicep modules published in the official Bicep Registry, however since there are many resource types not yet available, we also use:

Note the above sources are non-authoritative. You are free to use them as a starting point, but each should be validated and tested before use. Each module we bring in should be tuned to our specific scenarios and is not expected to have any traceability back to the original source.


๐Ÿงฎ Telemetry

Every FinOps toolkit template includes a defaultTelemetry deployment. These should be enabled by default using an input parameter that callers can disable. Telemetry deployments are tracked using a specific ID made up of the FinOps toolkit prefix (00f120b5-2007-6120-0000-) followed by a 12-digit hexadecimal representation of the solution (e.g., h0b000000000 for FinOps "hubs").

Include the following as the last parameter in each module and replace the <hex-module-name> and <version> placeholders:

@description('Optional. Enable telemetry to track anonymous module usage trends, monitor for bugs, and improve future releases.')
param enableDefaultTelemetry bool = true
// The last segment of the telemetryId is used to identify this module
var telemetryId = '00f120b5-2007-6120-0000-<hex-module-name>'
var finOpsToolkitVersion = '<version>'

Include the following as the first resource in each module:

// Telemetry used anonymously to count the number of times the template has been deployed.
// No information about you or your cost data is collected.
resource defaultTelemetry 'Microsoft.Resources/deployments@2022-09-01' = if (enableDefaultTelemetry) {
  name: 'pid-${telemetryId}-${uniqueString(deployment().name, location)}'
  properties: {
    mode: 'Incremental'
    template: {
      '$schema': 'https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#'
      contentVersion: '1.0.0.0'
      metadata: {
        _generator: {
          name: 'FinOps toolkit'
          version: finOpsToolkitVersion
        }
      }
      resources: []
    }
  }
}