feat: Added logic to create workspace based on the flag set in bicep#378
Open
Prajwal-Microsoft wants to merge 1 commit into
Open
feat: Added logic to create workspace based on the flag set in bicep#378Prajwal-Microsoft wants to merge 1 commit into
Prajwal-Microsoft wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
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/fabricCapacitySkuparameters 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
.envgeneration 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.
| 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}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
CREATE_FABRIC_WORKSPACEis set totrue. Manual entry ofFABRIC_WORKSPACE_IDis 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):
deploy_fabric_capacity.bicep) and corresponding ARM template logic to deploy a Microsoft Fabric capacity resource, with configurable SKU and admin members. [1] [2]createFabricWorkspace,fabricCapacitySku) and outputs (FABRIC_CAPACITY_ID,FABRIC_CAPACITY_NAME,CREATE_FABRIC_WORKSPACE) to control and expose Fabric capacity deployment inmain.bicep,main.json, andmain.parameters.json. [1] [2] [3] [4]Deployment Script Enhancements:
00_build_solution.pyand02_create_fabric_items.pyto 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]02_create_fabric_items.pyto 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:
.envand 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?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information