Azure Infrastructure: Tagging Azure Resources for Billing

Objective: In this tutorial, you will learn how to update the cost center information in Databricks and tag Azure resources for billing purposes. By the end of this tutorial, you will have successfully updated the cost center details and tagged Azure resources, ensuring accurate billing for the resources.

Prerequisites

Before starting this tutorial, ensure that you have:

  • Access to the Azure portal.
  • Access to the Databricks workspace.
  • Necessary permissions to create and tag resources in Azure.
  • Permissions to update tables in Databricks.

Step 1: Understanding the Billing Process

I2DB generates a monthly billing report using tags on Azure resources. These tags help associate the resource usage with specific Wash U cost centers. Resources within the Databricks workspace are automatically included in this billing report, but those managed outside this workspace need to be manually tagged. Resources hosted in

Important

Resources hosted Azure subscriptions managed by external teams do not need to be added to the I2DB billing report.

For any of the resources to be included in the billing report, the department and cost center must be included in the cost_centers table.

Step 2: Updating the Cost Center in Databricks

Before tagging Azure resources, ensure that the cost center information is updated in the config.billing.cost_centers table in Databricks. This step ensures that the billing report correctly maps the tags to the appropriate cost centers.

  1. Access Databricks: Log in to your Databricks workspace.

  2. Open a SQL Editor: Navigate to a notebook or use the SQL editor to run the following SQL command.

  3. Insert Cost Center Information:

    • Run the following SQL command to insert the cost center information into the config.billing.cost_centers table:

      INSERT INTO cost_centers (departmentName, costCenter, mainContact, notes)
      VALUES ('Department/Team/Project Name', 'CC000XXXX', 'someone@wustl.edu', 'optional notes');
    • Replace 'Department/Team/Project Name', 'CC000XXXX', and 'someone@wustl.edu' with your specific department name, cost center code, and main contact email, respectively. The notes field is optional and can be left blank or used for additional information.

  4. Verify the Insertion: After executing the command, verify that the cost center information has been correctly inserted into the table by querying the table:

    SELECT * FROM cost_centers 
    WHERE departmentName = 'Department/Team/Project Name';

    Ensure the output displays the correct details you’ve entered.

Step 3: Tagging Azure Resources

After updating the cost center information in Databricks, you can now tag the Azure resources that need to be billed. Follow these steps to tag a resource:

  1. Log in to the Azure Portal: Navigate to the Azure portal and sign in with your credentials.

  2. Create or Select a Resource:

    • If creating a new resource, proceed with the resource creation process.
    • If tagging an existing resource, locate and select the resource you want to tag.
  3. Access the Tags Section:

    • For a new resource: During the creation process, you will find a "Tags" tab.
    • For an existing resource: In the resource’s menu, find and select "Tags" under the "Settings" section.
  4. Add Billing Tags:

    • In the "Tags" section, add the required tag. The key tags to be added include:
      • WusmDepartment: Name of the department or project. Note: this must match the department name inserted into the table in the previous step.
  5. Save the Tags: After adding the tags, click on "Save" to apply them to the resource.

Step 4: Review and Confirm

Once you have tagged the Azure resources and updated the cost center in Databricks, review the resources to confirm that everything has been set up correctly. This ensures that the billing report will accurately reflect the costs associated with each resource.

Once the billing report process has ran, the new department will be available in the WUSM Datalake Billing Dashboard in the data lake.

Conclusion

You have successfully updated the billing cost centers in Databricks and tagged Azure resources. This setup will ensure that the monthly billing report accurately reflects the usage and costs associated with your department's resources.


Updated on August 12, 2025