Skip to content

feat: Added logic to create workspace based on the flag set in bicep#378

Open
Prajwal-Microsoft wants to merge 1 commit into
mainfrom
prdc-create-workspace
Open

feat: Added logic to create workspace based on the flag set in bicep#378
Prajwal-Microsoft wants to merge 1 commit into
mainfrom
prdc-create-workspace

Conversation

@Prajwal-Microsoft
Copy link
Copy Markdown
Collaborator

Purpose

  • This pull request introduces support for automatic creation and assignment of Microsoft Fabric capacity and workspace resources during deployment, particularly for workshop or demo scenarios. The changes add new parameters and logic to the infrastructure templates and deployment scripts, enabling a fully automated Fabric setup when CREATE_FABRIC_WORKSPACE is set to true. Manual entry of FABRIC_WORKSPACE_ID is no longer required if auto-creation is enabled, and the scripts handle workspace creation, capacity deployment, and assignment seamlessly.

The most important changes are:

Infrastructure as Code (Bicep/ARM/JSON):

  • Added a new module (deploy_fabric_capacity.bicep) and corresponding ARM template logic to deploy a Microsoft Fabric capacity resource, with configurable SKU and admin members. [1] [2]
  • Introduced new parameters (createFabricWorkspace, fabricCapacitySku) and outputs (FABRIC_CAPACITY_ID, FABRIC_CAPACITY_NAME, CREATE_FABRIC_WORKSPACE) to control and expose Fabric capacity deployment in main.bicep, main.json, and main.parameters.json. [1] [2] [3] [4]
  • Updated abbreviations and variables to support Fabric capacity naming conventions. [1] [2] [3]

Deployment Script Enhancements:

  • Updated 00_build_solution.py and 02_create_fabric_items.py to support auto-creation of Fabric workspaces and to handle cases where the workspace ID is not pre-supplied but auto-creation is enabled. Clear error messages and guidance are provided if required values are missing. [1] [2] [3] [4]
  • Implemented logic in 02_create_fabric_items.py to create a Fabric workspace if it does not exist, persist its ID, and assign it to the deployed capacity, including robust checks and status messages.

Configuration and Environment:

  • Updated .env and script environment handling to support the new workflow and ensure correct propagation of workspace and capacity IDs.

These changes streamline the deployment process for scenarios requiring Microsoft Fabric, reducing manual configuration and enabling reproducible, automated setups.

Does this introduce a breaking change?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

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 an automated “Fabric workshop” provisioning path by optionally deploying a Fabric capacity via IaC and letting the scripts auto-create (and capacity-assign) a workspace when CREATE_FABRIC_WORKSPACE=true.

Changes:

  • Introduces createFabricWorkspace / fabricCapacitySku parameters and outputs for Fabric capacity deployment (Bicep + generated ARM).
  • Updates build + Fabric item creation scripts to support auto-creating a workspace and assigning it to a deployed capacity.
  • Enhances .env generation to auto-detect Fabric capacity in a resource group and emit corresponding env vars.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
scripts/generate_env_from_azure.py Auto-detects Fabric capacity and emits related env vars into generated .env content.
scripts/02_create_fabric_items.py Adds workspace auto-creation + capacity assignment flow when CREATE_FABRIC_WORKSPACE=true.
scripts/00_build_solution.py Skips requiring FABRIC_WORKSPACE_ID when auto-create flag is enabled.
scripts/.env Clears the placeholder workspace ID to support the new flow.
infra/main.parameters.json Wires new params/env vars into deployment parameterization.
infra/main.json Generated ARM template updates for new Fabric capacity deployment and outputs.
infra/main.bicep Adds Fabric capacity module + related params/outputs.
infra/deploy_fabric_capacity.bicep New module to deploy Microsoft.Fabric/capacities.
infra/abbreviations.json Adds Fabric capacity naming abbreviation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread infra/main.bicep
param deployingUserPrincipalType string = 'User'

// ========== Fabric Capacity (optional, for workshop mode) ========== //
var fabricCapacityAdminMembers = contains(deployerInfo, 'userPrincipalName') ? [deployerInfo.userPrincipalName] : []
"deployingUserPrincipalType": {
"value": "${DEPLOYING_USER_PRINCIPAL_TYPE=User}"
},
"useUserAccessToken":{
Comment on lines +66 to +69
"value": "${USE_USER_ACCESS_TOKEN}"
},
"createFabricWorkspace": {
"value": "${CREATE_FABRIC_WORKSPACE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants