Skip to content

Document azure-dev.commands.getDotEnvFilePath for use in VS Code configurations#5218

Closed
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-5135
Closed

Document azure-dev.commands.getDotEnvFilePath for use in VS Code configurations#5218
Copilot wants to merge 4 commits into
mainfrom
copilot/fix-5135

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2025

This PR adds documentation for the azure-dev.commands.getDotEnvFilePath command, which can be used in VS Code configurations to access environment variables from Azure Developer CLI environments.

Changes:

  • Added a new documentation file for VS Code extension commands at /ext/vscode/docs/commands.md
  • Documented the getDotEnvFilePath command with usage instructions and examples
  • Updated the VS Code extension README to link to the new documentation
  • Added JSDoc comments to the getDotEnvFilePath function for better code-level documentation

Example usage in launch.json:

{
  "configurations": [
    {
      // Your debug configuration
      "envFile": "${input:azdDotenv}"
    }
  ],
  "inputs": [
    {
      "id": "azdDotenv",
      "type": "command",
      "command": "azure-dev.commands.getDotEnvFilePath"
    }
  ]
}

This allows VS Code to use environment variables from an Azure Developer environment's .env file when running or debugging applications, which was previously undocumented but useful functionality.

Fixes #5135.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits May 21, 2025 18:00
Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Copilot AI changed the title [WIP] Should document azure-dev.commands.getDotEnvFilePath Document azure-dev.commands.getDotEnvFilePath for use in VS Code configurations May 21, 2025
Copilot AI requested a review from spboyer May 21, 2025 18:02
@spboyer
Copy link
Copy Markdown
Member

spboyer commented May 22, 2025

@brandom-msft can you review?

@brandom-msft
Copy link
Copy Markdown
Member

@brandom-msft can you review?

Guessing you meant @bwateratmsft?

Copy link
Copy Markdown
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.

@spboyer I wonder if this wouldn't be better fulfilled with a page on https://code.visualstudio.com/docs/?

Comment thread ext/vscode/README.md Outdated
Comment thread ext/vscode/docs/commands.md Outdated
Comment on lines +8 to +34
/**
* Get the path to the .env file for an Azure developer environment.
*
* This can be used in launch.json to provide environment variables to VS Code tasks:
* ```json
* {
* "configurations": [
* {
* "envFile": "${input:azdDotenv}"
* }
* ],
* "inputs": [
* {
* "id": "azdDotenv",
* "type": "command",
* "command": "azure-dev.commands.getDotEnvFilePath"
* }
* ]
* }
* ```
*
* @param context - The VS Code extension action context
* @param args - Optional array containing [environmentName, workingDir]
* - environmentName: Name of the environment to use (uses default if not provided)
* - workingDir: Working directory to find environments (uses first workspace folder if not provided)
* @returns Path to the .env file for the specified environment
*/
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

There's nothing particularly mistaken here, but I am not sure it's even helpful to add this JSDoc. The function cannot be called directly, rather you need to use one of the utils wrappers like callWithTelemetryAndErrorHandling, or in this particular case, registerCommand's wrapping.

@spboyer I'll leave it up to you.

Comment thread ext/vscode/docs/commands.md Outdated
Comment thread ext/vscode/docs/commands.md Outdated
Comment thread ext/vscode/docs/commands.md Outdated
Comment thread ext/vscode/README.md Outdated
For more information about Azure Developer CLI and this VS Code extension, please [see the documentation](https://aka.ms/azure-dev/vscode).

## Extension Documentation
- [Available Commands](docs/commands.md) - Documentation for commands provided by this extension, including utility commands for use in VS Code configurations.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I do not know if a relative link to another doc will work on the marketplace page or in VSCode itself--it needs to be tested.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The relative link format has been kept as-is in commit 6d20ad5. If there are issues with this format in the marketplace or VS Code itself, we can address it in a follow-up PR after testing.

Comment thread ext/vscode/docs/commands.md Outdated
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
@spboyer
Copy link
Copy Markdown
Member

spboyer commented Jun 12, 2025

@kristenwomack how do you want to handle this documentation?
cc:// @alexwolfmsft

@microsoft-github-policy-service microsoft-github-policy-service Bot added the no-recent-activity identity issues with no activity label Aug 15, 2025
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

Hi @@copilot. Thank you for your interest in helping to improve the Azure Developer CLI experience and for your contribution. We've noticed that there hasn't been recent engagement on this pull request. If this is still an active work stream, please let us know by pushing some changes or leaving a comment. Otherwise, we'll close this out in 7 days.

@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

Hi @@copilot. Thank you for your contribution. Since there hasn't been recent engagement, we're going to close this out. Feel free to respond with a comment containing "/reopen" if you'd like to continue working on these changes. Please be sure to use the command to reopen or remove the "no-recent-activity" label; otherwise, this is likely to be closed again with the next cleanup pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-recent-activity identity issues with no activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should document azure-dev.commands.getDotEnvFilePath

4 participants