Skip to content

Conversation

@spboyer
Copy link
Member

@spboyer spboyer commented Dec 22, 2025

Introduces significant improvements to the Azure Developer CLI VS Code extension, focusing on enhanced environment management, improved resource navigation, and better user experience.

📋 Summary of Changes

🆕 New Features

1. Standalone Environments View

  • Added a dedicated Environments view separate from the workspace view
  • Provides a unified interface for managing all azd environments across projects
  • Includes environment status indicators and management commands

2. Extensions Management View

  • New Extensions view for managing azd CLI extensions
  • Support for installing, uninstalling, and upgrading extensions
  • Visual status indicators for installed extensions

3. "Show in Azure Portal" Command

  • Quick navigation from VS Code directly to Azure resources in the portal
  • Context menu integration for services
  • Automatic portal URL construction with proper resource ID handling

4. Enhanced Environment Operations

  • Unified command support across workspace and standalone views
  • Commands: env-refresh, env-edit, env-delete, revealAzureResourceGroup
  • Automatic view synchronization after operations
  • Dual refresh mechanism ensures both views stay in sync

🔧 Improvements

Resource Navigation

  • Extended revealAzureResourceGroup to support standalone environments
  • Improved RevealStep with:
    • Automatic Azure extension activation based on resource type
    • Tree refresh mechanisms before reveal attempts
    • Multi-attempt reveal logic with fallback options
    • Resource group pre-expansion for better navigation
    • User-friendly error messages with action buttons

User Experience

  • Removed automatic environment selection on click for better control
  • Enhanced error messages with "Copy Resource ID" and "Open in Portal" actions
  • Improved context menu organization with proper grouping
  • Updated Help and Feedback links to point to AZD Blog Posts
  • Better visual feedback for environment status

Code Quality

  • ESLint compliance fixes (naming-convention warnings resolved)
  • Improved regex patterns for better linting compliance
  • Added comprehensive debug logging throughout wizard steps
  • Added documentation comments explaining API limitations
  • Better type handling with EnvironmentTreeItem support

📊 Commits Included

  1. bec9154f - Remove Environments from My Project view
  2. 89d29243 - Add extensions view and enhanced environment management
  3. ab57695c - Update Help and Feedback link from Resources to AZD Blog Posts
  4. 15197c3d - Add 'Show in Azure Portal' command for services
  5. a9f3d191 - Integrate environment commands with standalone Environments view

🧪 Testing Checklist

  • Environment creation from standalone view
  • Environment deletion and refresh operations
  • Resource group reveal from standalone environments
  • "Show in Azure Portal" command functionality
  • View synchronization after operations
  • Extension management operations
  • Cross-view command compatibility
  • Error handling and user feedback
  • Context menu integrations

🔍 Related Issues

<- Improved regex patterns in RevealStep for better linting compliance Link any related issues here -->

📝 Notes

This is a work in progress. Additional testing and refinement may be needed before final review.

- Add new Extensions view with tree data provider for managing azd extensions
- Implement extension commands: install, uninstall, and upgrade
- Add ExtensionProvider service for interacting with azd extension APIs
- Add environment variables tree node for displaying env vars in workspace
- Enhance environment tree views with toggle visibility and .env file viewing
- Add inline actions to environment view (view .env, select environment)
- Add navigation buttons to view titles (new environment, install extension)
- Improve tree view type checking with isTreeViewModel utility
- Update telemetry IDs for new extension and environment operations
- Refactor command handlers to support both workspace and environment tree views
…g Posts

- Rename 'Resources' link to 'AZD Blog Posts' in Help and Feedback view
- Update URL to point to Azure SDK blog filtered by azure-developer-cli tag
- Update command title to 'Open AZD Blog Posts'
- Added new command to open Azure resources directly in the Azure Portal
- Created OpenInPortalStep wizard step to handle portal URL opening
- Enhanced RevealStep with improved resource tree navigation and error handling
- Added debug logging throughout wizard steps for better diagnostics
- Improved error handling in PickResourceStep and PickResourceGroupStep
- Updated command registration and package.json with new command
- Added localized command title in package.nls.json
- Modified reveal.ts to support both TreeViewModel and direct service item inputs
- Enhanced RevealStep to activate required Azure extensions and refresh tree before reveal
- Added fallback mechanisms when automatic reveal fails (copy ID, open in portal options)
…ents view

- Extended environment commands to support both workspace and standalone views
- Added refresh functionality to Environments view after environment operations
- Connected env-refresh, env-edit, env-delete, and revealResourceGroup commands to standalone environments
- Updated reveal.ts to handle EnvironmentTreeItem for resource group navigation
- Modified env.ts to accept EnvironmentTreeItem in all environment operations
- Added view refresh commands after env operations (delete, new, select, refresh)
- Removed automatic env-select on click for non-default environments
- Fixed ESLint warnings with naming-convention for Azure provider types
- Added comment explaining focusGroup limitation in RevealStep
- Improved regex patterns in RevealStep for better linting compliance

This unifies the experience across both the workspace environments and the standalone
environments view, ensuring users can perform the same operations from either location.
Copy link
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

This WIP PR introduces significant improvements to the Azure Developer CLI VS Code extension, adding a new dedicated activity bar view with multiple panels for managing environments, extensions, and resources. The changes focus on providing a standalone interface for environment management and adding convenient navigation features to Azure Portal.

Key Changes:

  • Adds a new activity bar container with four views: My Project, Environments, Extensions, and Help and Feedback
  • Implements environment variable visibility toggle functionality with hidden-by-default behavior
  • Adds "Show in Azure Portal" command for quick navigation from services
  • Extends reveal commands to work with both workspace and standalone environment views

Reviewed changes

Copilot reviewed 35 out of 38 changed files in this pull request and generated 20 comments.

Show a summary per file
File Description
package-lock.json Empty lock file added at repository root (should be removed)
ext/vscode/ext/vscode/package-lock.json Empty lock file in duplicate nested path (should be removed)
ext/vscode/package-lock.json Lock file dependency updates (peer dependencies unmarked)
.vscode/settings.json Added aspire settings (unrelated to PR scope)
ext/vscode/package.json Registered new views container, views, commands, and menus for enhanced UI
ext/vscode/package.nls.json Added localization for new "Show in Azure Portal" command
ext/vscode/src/extension.ts Integrated new view registration in activation
ext/vscode/src/views/registerViews.ts New file registering all tree data providers and view commands
ext/vscode/src/views/myProject/MyProjectTreeDataProvider.ts New provider for My Project view without environments
ext/vscode/src/views/environments/EnvironmentsTreeDataProvider.ts New standalone environments view with variable visibility toggle
ext/vscode/src/views/extensions/ExtensionsTreeDataProvider.ts New extensions management view
ext/vscode/src/views/helpAndFeedback/HelpAndFeedbackTreeDataProvider.ts New help and feedback view with links
ext/vscode/src/views/workspace/AzureDevCliApplication.ts Added environment variables provider and optional environment inclusion
ext/vscode/src/views/workspace/AzureDevCliEnvironment.ts Enhanced with collapsible environment variables child node
ext/vscode/src/views/workspace/AzureDevCliEnvironments.ts Added env values provider integration
ext/vscode/src/views/workspace/AzureDevCliEnvironmentVariables.ts New classes for environment variable tree items with visibility toggle
ext/vscode/src/views/workspace/AzureDevCliWorkspaceResourceBranchDataProvider.ts Added visibility state management
ext/vscode/src/services/AzureDevEnvValuesProvider.ts New service to fetch environment variable values via CLI
ext/vscode/src/services/AzureDevExtensionProvider.ts New service to list installed azd extensions
ext/vscode/src/commands/registerCommands.ts Registered new extension management and portal navigation commands
ext/vscode/src/commands/extensions.ts New command implementations for extension install/uninstall/upgrade
ext/vscode/src/commands/env.ts Extended environment commands to support standalone view items
ext/vscode/src/commands/azureWorkspace/reveal.ts Extended reveal commands with EnvironmentTreeItem support and portal navigation
ext/vscode/src/commands/azureWorkspace/wizard/OpenInPortalStep.ts New wizard step for opening resources in Azure Portal
ext/vscode/src/commands/azureWorkspace/wizard/RevealStep.ts Enhanced with extension activation, retry logic, and better error handling
ext/vscode/src/commands/azureWorkspace/wizard/PickEnvironmentStep.ts Added debug logging
ext/vscode/src/commands/azureWorkspace/wizard/PickResourceStep.ts Added error handling and debug logging
ext/vscode/src/commands/azureWorkspace/wizard/PickResourceGroupStep.ts Added error handling and improved error messages
ext/vscode/src/commands/up.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/down.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/deploy.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/provision.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/restore.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/packageCli.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/pipeline.ts Added support for AzureDevCliModel type guard
ext/vscode/src/commands/monitor.ts Added support for AzureDevCliModel type guard
ext/vscode/src/utils/isTreeViewModel.ts Added isAzureDevCliModel type guard function
ext/vscode/src/telemetry/telemetryId.ts Added telemetry IDs for extension management commands
Files not reviewed (2)
  • ext/vscode/ext/vscode/package-lock.json: Language not supported
  • ext/vscode/package-lock.json: Language not supported

spboyer and others added 9 commits December 22, 2025 12:13
Added unit tests for:
- OpenInPortalStep: Tests portal URL construction for various Azure resource types
  * Web Apps, Storage Accounts, Cosmos DB, Container Apps, Resource Groups
  * Error handling for missing resource IDs
  * Priority configuration

- RevealStep: Tests Azure resource reveal functionality
  * Extension activation for different Azure providers
  * Resource group pre-expansion logic
  * Multi-attempt reveal with fallback
  * Error handling and user notifications
  * Tree refresh mechanisms

- EnvironmentsTreeDataProvider: Tests standalone environments view
  * Environment listing and hierarchy
  * Default environment marking
  * Environment variable visibility toggling
  * Tree refresh events
  * Integration with environment providers

- ExtensionsTreeDataProvider: Tests extensions management view
  * Extension listing and display
  * Version information
  * Tree item creation
  * Refresh functionality

All tests use proper mocking with sinon, follow established patterns,
and provide comprehensive coverage of success and error paths.
- Add sinon and @types/sinon for test mocking
- Remove unused telemetryId parameter from registerActivityCommand
- Add documentation for telemetry tracking in commands
- Fix isAzdCommand to handle undefined input
- Add TEST_COVERAGE.md documentation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

@bwateratmsft bwateratmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot There is throughout the PR a general pattern of editing files just to add overly-verbose logging, and all of it via console.log which is not correct.

Where the logs are valuable to the user, it should instead be changed to ext.outputChannel.

Otherwise, where the substance of the file hasn't changed--and just overly-verbose logging is added--please revert the files to their original state. We can add things back in a separate PR if we desire.

Fixes Azure#5691

Implements friendly azure.yaml/azure.yml validation within the extension
to catch errors before they cause unfriendly error dialog pop-ups.

Changes:
- Enhanced diagnostic provider with comprehensive validation
- Improved error handling in AzureDevShowProvider
- Added 17 new test cases (all passing)
- Updated README.md and TESTING_GUIDE.md with validation features
- All lint, tests, and cspell checks passing

Key features:
- Empty file detection with helpful guidance
- YAML parsing errors with user-friendly messages
- Missing required properties validation
- Invalid service properties detection
- Directs users to Problems panel instead of showing pop-ups
- Remove all console.log/console.error statements, replace with ext.outputChannel.appendLog where appropriate
- Add category to new commands in package.json
- Remove redundant CI test step from copilot-instructions.md
- Delete unnecessary TEST_COVERAGE.md file
- Delete duplicate ext/vscode/package-lock.json
- Update README.md Getting Started with extension install command option
- Update minimum AZD version requirement to 1.8.0
@spboyer
Copy link
Member Author

spboyer commented Jan 7, 2026

@bwateratmsft addressed most if not all feedback. Thanks for the review!

Copy link
Contributor

@bwateratmsft bwateratmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None of the playwright tests that were added provide any real value. They should just be removed, along with the playwright dev dependency.

- Remove Playwright e2e testing infrastructure
- Update extension icon
- Add copyright header requirement to Copilot instructions
- Convert unit tests from assert to Chai assertions
- Merge azureYamlValidation.test.ts into azureYamlDiagnostics.test.ts
- Update .vscodeignore and .gitignore
@spboyer
Copy link
Member Author

spboyer commented Jan 8, 2026

Thanks @bwateratmsft, made the needed changes. Good call on the playwright feedback (trying to be too fancy)

  • Removed Playwright e2e testing infrastructure
  • Update extension icon to new version and svg
  • Add copyright header to missing locationa and added the requirement to Copilot instructions
  • Convert unit tests from assert to Chai assertions
  • Merge azureYamlValidation.test.ts into azureYamlDiagnostics.test.ts
  • Updated .vscodeignore and .gitignore

@bwateratmsft
Copy link
Contributor

I see the latest build is failing, I'm guessing it's referring to not wanting the extension icon to be an SVG. The activity bar icon definitely can be an SVG.

@spboyer
Copy link
Member Author

spboyer commented Jan 8, 2026

I see the latest build is failing, I'm guessing it's referring to not wanting the extension icon to be an SVG. The activity bar icon definitely can be an SVG.

yea, fixed that.

- Rename WorkspaceViewExtensionResolve to ExtensionsViewResolve (correct view ID)
- Remove fragile caching test from azureDevTemplateProvider.test.ts
- Add copyright headers to view providers
- Add vscode.l10n.t() for user-visible strings in HelpAndFeedbackTreeDataProvider
- Rename toggle commands to toggleEnvVarVisibility for clarity
- Make Help and Feedback view collapsed by default
- Use specific context values for templates to avoid conflicts
- Consolidate duplicate environment menu entries using regex alternation
- Add NLS strings to package.nls.json for new commands
- Fix refresh command registration (define command, remove @1)
- Restore telemetryId parameter in registerActivityCommand
- Remove redundant azureWorkspace.refresh from refreshEnvironment
- Add comments explaining hard-coded delays in RevealStep.ts
@spboyer
Copy link
Member Author

spboyer commented Jan 12, 2026

@bwateratmsft - all comments addressed

  • Rename WorkspaceViewExtensionResolve to ExtensionsViewResolve (not in workspace view)
  • Remove fragile caching test from azureDevTemplateProvider.test.ts
  • Add copyright headers to view providers (HelpAndFeedback, Environments, MyProject, registerViews)
  • Add vscode.l10n.t() for user-visible strings in HelpAndFeedbackTreeDataProvider
  • Rename toggle commands to toggleEnvVarVisibility for clarity
  • Make Help and Feedback view collapsed by default
  • Use specific context values for templates (ms-azuretools.azure-dev.views.templateTools.template)
  • Consolidate duplicate environment menu entries using regex alternation
  • Add NLS strings to package.nls.json for new commands
  • Fix refresh command registration (remove @1, define command properly)
  • Restore telemetryId parameter in registerActivityCommand
  • Remove redundant azureWorkspace.refresh from refreshEnvironment
  • Add explanatory comments for hard-coded delays in RevealStep.ts (Azure Resources API limitation)

@spboyer spboyer enabled auto-merge (squash) January 13, 2026 15:58
@azure-sdk
Copy link
Collaborator

VSCode Extension Installation Instructions

  1. Download the extension at https://azuresdkartifacts.z5.web.core.windows.net/azd/vscode/pr/6425/azure-dev-0.11.0-alpha.1.vsix
  2. Extract the extension from the compressed file
  3. In vscode
    a. Open "Extensions" (Ctrl+Shift+X)
    b. Click the ...\ menu at top of Extensions sidebar
    c. Click "Install from VSIX"
    d. Select location of downloaded file

@spboyer
Copy link
Member Author

spboyer commented Jan 16, 2026

@bwateratmsft just need you to do a final check here and sign off and we can discuss how to move foward here.

Copy link
Contributor

@bwateratmsft bwateratmsft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still some things, most important is the file watchers thing, and checking if those tree refreshes are needed (note to self)

public shouldExecute(wizardContext: RevealResourceWizardContext | RevealResourceGroupWizardContext): boolean {
return true;
const should = !!wizardContext.azureResourceId;
ext.outputChannel.appendLog(vscode.l10n.t('RevealStep shouldExecute: {0}, azureResourceId: {1}', should, wizardContext.azureResourceId || 'undefined'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is pretty excessive in terms of logging

Comment on lines 37 to 61
if (provider) {
const extensionMap: Record<string, string> = {
// eslint-disable-next-line @typescript-eslint/naming-convention
'Microsoft.App': 'ms-azuretools.vscode-azurecontainerapps',
// eslint-disable-next-line @typescript-eslint/naming-convention
'Microsoft.Web': 'ms-azuretools.vscode-azurefunctions',
// eslint-disable-next-line @typescript-eslint/naming-convention
'Microsoft.Storage': 'ms-azuretools.vscode-azurestorage',
// eslint-disable-next-line @typescript-eslint/naming-convention
'Microsoft.DocumentDB': 'ms-azuretools.azure-cosmos',
};

const extensionId = extensionMap[provider];
if (extensionId) {
ext.outputChannel.appendLog(vscode.l10n.t('Activating extension: {0}', extensionId));
const extension = vscode.extensions.getExtension(extensionId);
if (extension && !extension.isActive) {
await extension.activate();
ext.outputChannel.appendLog(vscode.l10n.t('Extension activated'));
// Delay to allow the extension to register its tree data provider.
// The Azure Resources API doesn't provide an event for when provider registration completes.
await new Promise(resolve => setTimeout(resolve, 1000));
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Activating the client extension is done by the Resources extension; it is not necessary to do it here.

- Remove root-level package-lock.json (unnecessary)
- Reduce excessive logging in RevealStep.ts
  - Remove verbose appendLog calls throughout
  - Use .debug() and .error() for appropriate log levels
  - Remove unnecessary extension activation (Resources extension handles it)
- Update addService.ts to use context.ui.showInputBox/showQuickPick
  - Add vscode.l10n.t() to all user-facing strings
- Update extensions.ts to use context.ui.showInputBox
- Update Copilot instructions with UI best practices
  - Document l10n requirement for user-facing strings
  - Document context.ui usage instead of vscode.window
  - Note FileSystemWatcher scarcity
@spboyer spboyer force-pushed the feature/side-panel-view branch from 92f9899 to b7ecc73 Compare January 20, 2026 17:52
- Extract duplicated language list to shared constant (languages.ts)
  - Use SUPPORTED_LANGUAGES constant in AzureYamlCodeActionProvider
  - Eliminates hardcoded ['python', 'js', 'ts', 'csharp', 'java', 'go'] arrays

- Add l10n (internationalization) to user-facing strings:
  - AzureYamlCodeActionProvider: All UI strings, tooltips, and commands
  - TemplateToolsTreeDataProvider: All tree item labels and tooltips
  - EnvironmentsTreeDataProvider: Environment variable labels and tooltips
  - AzureDevTemplateProvider: Category display names

- Consolidate FileSystemWatcher usage:
  - Create shared FileSystemWatcherService to manage watchers
  - FileSystemWatchers are a limited resource (few hundred per system)
  - TemplateToolsTreeDataProvider now uses shared service
  - EnvironmentsTreeDataProvider now uses shared service
  - MyProjectTreeDataProvider now uses shared service
  - Reduces watcher count from 3+ individual watchers to shared pool

These changes improve code maintainability, enable proper localization,
and reduce system resource consumption as requested in PR review.
- Remove playwright.config.js.map
- Fix extensions.ts to use context.ui.showInputBox
- Add vscode.l10n.t() for user-facing strings in AzureDevCliEnvironmentVariables.ts
- Add vscode.l10n.t() for error message in AzureDevTemplateProvider.ts
- Move view titles from package.json to package.nls.json
- Simplify RevealStep.ts by removing excessive logging and retry logic
- Fix test files to pass FileSystemWatcherService to providers
- Fix registerViews.ts to use vscode.window.showTextDocument()
- Remove unused templateProvider parameter from TemplateItem and CategoryGroupItem
- Add extractEnvironmentContext() utility to extract environment info from tree items
- Add refreshAllEnvironmentViews() to consolidate view refresh logic
- Apply DRY principle to deleteEnvironment, selectEnvironment, newEnvironment, refreshEnvironment
- Remove unnecessary AzureDevExtensionProvider interface
- Class now directly returns AzureDevExtension[] as suggested
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider converting this to ext/vscode/AGENTS.md to work across different agents

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.

6 participants