Insight Tech APAC Blog Logo

Microsoft Fabric Capacity IaC

stephentulp
July 23, 2024

2 minutes to read

Background

In this blog post, we will walk through the steps to create a Microsoft Fabric Capacity instance using Bicep. Some quick googling will show that there aren’t many examples or templates yet in this space, so lets go create one.

What is a Microsoft Fabric Capacity

A Microsoft Fabric Capacity is a pool of resources allocated to Microsoft Fabric under a specific tenant. It provides the computing power needed to run various workloads and experiences within the Microsoft Fabric platform. Here are some key points about Microsoft Fabric Capacity:

  • Unified Data Platform: Microsoft Fabric is a unified data platform that offers shared experiences, architecture, governance, compliance, and billing.
  • Scalability: Capacities provide a simple and unified way to scale resources to meet customer demand. You can easily increase capacity by upgrading the SKU.
  • Performance: Capacities ensure great performance and simplified management with features like bursting, which allows consuming extra compute resources to speed up workload execution.
  • Capacity Metrics: Capacity metrics help monitor the performance of workloads and their usage compared to purchased capacity. This feature unifies telemetry from all Fabric workload experiences into a single set of turnkey analytics.
  • Capacity Planning: Capacity planning helps estimate the resources needed to run Microsoft Fabric efficiently, avoiding performance issues and optimizing spending by choosing the right capacity SKU.

In summary, Microsoft Fabric Capacity is essential for managing and scaling the resources required to run various workloads within the Microsoft Fabric platform efficiently.

Create the Bicep Template

As there are limited examples to start with, the best way to get going is to provision the Fabric Capacity resource within the portal and use the Insert Resource option within VS Code.

  • Provision Fabric within the Azure Portal
  • Copy the Resource Id from the deployment
  • Create a fabric.bicepfile
  • Right click in the bicep file and choose Insert Resource

You will see something similar to what is outlined below.

/Fabric Exported

Ok, this is a good start and gives us the Resource Provider and some of the mandatory parameters that we need. Now I can refactor this to clean up the code a little and leverage some GitHub Co-Pilot magic to help make it more complete.

/Fabric Bicep

The Bicep code and templates can be found Here

Conclusion

By leveraging the above, we now have a re-usable Microsoft Fabric IaC template that can be deploy via Azure CLI, PowerShell or CI/CD. While provisioning this in the portal is straight forward, moving away from ClickOps and having your deployments defined in code is always a good thing.

/ClickOps