-
Notifications
You must be signed in to change notification settings - Fork 342
feat(bicep): Show property-level changes in provision preview #6262
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 5 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
02cebad
Initial plan
Copilot 213b5d5
Add property-level change details to azd provision --preview for Bicep
Copilot edf4654
Add test for property change display in provision preview
Copilot c59ec9c
Add manual test project for preview enhancement
Copilot 5dd5579
Final implementation complete - all tasks done
Copilot de782ae
Improve UX for provision preview based on feedback
Copilot 9c96403
Merge main branch and resolve conflict in bicep_provider.go
Copilot 2c972fc
Merge main branch and resolve conflicts
Copilot 34bdd78
Merge branch 'main' of https://github.com/azure/azure-dev into copilo…
vhvb1989 f40fef7
Merge branch 'copilot/add-preview-details-to-provision' of https://gi…
vhvb1989 63eaede
Delete cli/azd/extensions/azure.ai.agents/internal/pkg/azure/logging.go
JeffreyCA 26e9370
Remove preview-enhancement test files
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
cli/azd/pkg/output/ux/testdata/TestPreviewProvisionWithPropertyChanges.snap
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Resources: | ||
|
|
||
| Modify : Microsoft.Storage/storageAccounts : mystorageaccount | ||
| ~ properties.sku.name: "Standard_LRS" => "Premium_LRS" | ||
| + properties.minimumTlsVersion: "TLS1_2" | ||
| Create : Microsoft.KeyVault/vaults : mykeyvault | ||
| + properties.sku.name: "standard" |
114 changes: 114 additions & 0 deletions
114
cli/azd/test/functional/testdata/preview-enhancement/TESTING.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,114 @@ | ||
| # Manual Testing Guide for Property-Level Preview Changes | ||
|
|
||
| This guide explains how to manually test the enhanced `azd provision --preview` functionality. | ||
|
|
||
| ## Test Setup | ||
|
|
||
| 1. Navigate to this test directory: | ||
| ```bash | ||
| cd /tmp/test-azd-preview | ||
| ``` | ||
|
|
||
| 2. Ensure you have the modified azd binary: | ||
| ```bash | ||
| cd /home/runner/work/azure-dev/azure-dev/cli/azd | ||
| go build -o /tmp/azd | ||
| ``` | ||
|
|
||
| 3. Use the test azd binary: | ||
| ```bash | ||
| export PATH=/tmp:$PATH | ||
| ``` | ||
|
|
||
| ## Test Scenarios | ||
|
|
||
| ### Scenario 1: Initial Deployment (Create Resources) | ||
|
|
||
| 1. Initialize the environment: | ||
| ```bash | ||
| azd env new test-env | ||
| ``` | ||
|
|
||
| 2. Set required environment variables (you'll be prompted if not set): | ||
| ```bash | ||
| azd env set AZURE_LOCATION eastus | ||
| ``` | ||
|
|
||
| 3. Run preview (should show CREATE operations with property details): | ||
| ```bash | ||
| azd provision --preview | ||
| ``` | ||
|
|
||
| **Expected Output:** | ||
| - Should show the storage account being created | ||
| - Should display property values that will be set (e.g., sku.name, minimumTlsVersion) | ||
| - Property changes should be prefixed with `+` symbol in gray/white color | ||
|
|
||
| ### Scenario 2: Modify Existing Resources | ||
|
|
||
| 1. After first deployment, modify main.bicep to change the SKU: | ||
| ```bicep | ||
| sku: { | ||
| name: 'Standard_GRS' // Changed from Standard_LRS | ||
| } | ||
| ``` | ||
|
|
||
| 2. Run preview again: | ||
| ```bash | ||
| azd provision --preview | ||
| ``` | ||
|
|
||
| **Expected Output:** | ||
| - Should show MODIFY operation for the storage account | ||
| - Should display property changes with: | ||
| - `~` symbol in yellow for modified properties | ||
| - Before and after values: `"Standard_LRS" => "Standard_GRS"` | ||
|
|
||
| ### Scenario 3: Add New Properties | ||
|
|
||
| 1. Modify main.bicep to add a new property: | ||
| ```bicep | ||
| properties: { | ||
| minimumTlsVersion: 'TLS1_2' | ||
| supportsHttpsTrafficOnly: true | ||
| allowBlobPublicAccess: false // New property | ||
| } | ||
| ``` | ||
|
|
||
| 2. Run preview: | ||
| ```bash | ||
| azd provision --preview | ||
| ``` | ||
|
|
||
| **Expected Output:** | ||
| - Should show MODIFY operation | ||
| - New property should appear with `+` symbol | ||
| - Existing properties that changed should show `~` symbol | ||
|
|
||
| ## Verification Checklist | ||
|
|
||
| - [ ] Property changes are displayed under each resource | ||
| - [ ] Create operations show `+` symbol with property values | ||
| - [ ] Modify operations show `~` symbol with before/after values | ||
| - [ ] Delete operations show `-` symbol (if applicable) | ||
| - [ ] Colors are correctly applied (gray for create, yellow for modify, red for delete) | ||
| - [ ] Complex values (objects, arrays) are formatted as JSON | ||
| - [ ] Multiple property changes per resource are all displayed | ||
| - [ ] Output is properly indented and aligned | ||
|
|
||
| ## Comparison with Azure Bicep what-if | ||
|
|
||
| To compare the output with native Bicep what-if: | ||
|
|
||
| ```bash | ||
| cd infra | ||
| az deployment group what-if --resource-group <your-rg> --template-file main.bicep --parameters main.parameters.json | ||
| ``` | ||
|
|
||
| The azd output should now provide similar detail to the native what-if command. | ||
|
|
||
| ## Notes | ||
|
|
||
| - Property-level details are only available with Bicep provider | ||
| - Terraform provider already shows plan details via `terraform plan` | ||
| - This feature requires Azure credentials and an active subscription |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.