-
Notifications
You must be signed in to change notification settings - Fork 228
Document azure-dev.commands.getDotEnvFilePath for use in VS Code configurations #5218
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
Co-authored-by: spboyer <7681382+spboyer@users.noreply.github.com>
@brandom-msft can you review? |
Guessing you meant @bwateratmsft? |
There was a problem hiding this 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/?
/** | ||
* 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 | ||
*/ |
There was a problem hiding this comment.
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.
ext/vscode/README.md
Outdated
@@ -5,6 +5,9 @@ This extension makes it easier to run, create Azure Resources, and deploy Azure | |||
## What It Does | |||
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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
Co-authored-by: bwateratmsft <36966225+bwateratmsft@users.noreply.github.com>
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:
/ext/vscode/docs/commands.md
getDotEnvFilePath
command with usage instructions and examplesgetDotEnvFilePath
function for better code-level documentationExample usage in launch.json:
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.