Skip to content

Commit

Permalink
Fix issue with login command where PATH isn't being modified (#1735)
Browse files Browse the repository at this point in the history
* Fix login command missing `PATH` entry

* More info in changelog

* Update CHANGELOG.md

---------

Co-authored-by: Victor Vazquez <[email protected]>
  • Loading branch information
bwateratmsft and vhvb1989 committed Mar 15, 2023
1 parent da13744 commit 10392b6
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 12 deletions.
18 changes: 12 additions & 6 deletions ext/vscode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
# Release History

## 0.5.0-alpha.1 (Unreleased)

### Features Added

### Breaking Changes
## 0.4.2 (2023-03-15)

### Bugs Fixed

### Other Changes
- [[#1735]](https://github.com/Azure/azure-dev/pull/1735) Fixed an issue with the login command not working immediately after install.

## 0.4.1 (2023-03-14)

### Bugs Fixed

- [[#1724]](https://github.com/Azure/azure-dev/pull/1724) Refine conditions for displaying the prompt to install the CLI.

## 0.4.0 (2023-03-08)

### Added

- [[#853]](https://github.com/Azure/azure-dev/pull/853) Integration with the Azure Resources extension's workspace view. Requires version 0.6.1 of the [Azure Resources](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-azureresourcegroups) extension.
- [[#1644]](https://github.com/Azure/azure-dev/pull/1644) Added a walkthrough experience for using the extension.

## 0.3.0 (2022-09-14)

### Added

- [[#493]](https://github.com/Azure/azure-dev/pull/493) Show README file after successful init/up.

### Fixed

- [[#498]](https://github.com/Azure/azure-dev/pull/498) Use `azd template list` to populate template list in VS Code (now always consistent with the CLI).
- [[#556]](https://github.com/Azure/azure-dev/pull/556) Improve error message when no environments are found.

## 0.2.0 (2022-08-02)

### Changed

- [[#189]](https://github.com/Azure/azure-dev/pull/189) Bump bicep minimum version to v0.8.9

### Added

- [[#151]](https://github.com/Azure/azure-dev/pull/151) Detect and warn the user if `azd` CLI is not installed.

### Fixed

- [[#159]](https://github.com/Azure/azure-dev/pull/159) Enable user feedback via surveys.
- [[#170]](https://github.com/Azure/azure-dev/pull/170) Enable gradual rollout of new features.

Expand Down
4 changes: 2 additions & 2 deletions ext/vscode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ext/vscode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "azure-dev",
"displayName": "Azure Developer CLI",
"description": "Makes it easy to run, provision, and deploy Azure applications using the Azure Developer CLI",
"version": "0.5.0-alpha.1",
"version": "0.4.2",
"license": "MIT",
"icon": "resources/icon.png",
"preview": true,
Expand Down
11 changes: 9 additions & 2 deletions ext/vscode/src/commands/loginCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
// Licensed under the MIT License.

import { IActionContext } from '@microsoft/vscode-azext-utils';
import { createAzureDevCli } from '../utils/azureDevCli';
import { TelemetryId } from '../telemetry/telemetryId';
import { createAzureDevCli, onAzdLoginAttempted } from '../utils/azureDevCli';
import { executeAsTask } from '../utils/executeAsTask';
import { getAzDevTerminalTitle } from './cmdUtil';

export async function loginCli(context: IActionContext, shouldPrompt: boolean = true): Promise<void> {
const azureCli = await createAzureDevCli(context);
const command = azureCli.commandBuilder.withArg('login');
await executeAsTask(command.build(), getAzDevTerminalTitle(), { alwaysRunNew: true, focus: true });
await executeAsTask(command.build(), getAzDevTerminalTitle(), {
focus: true,
alwaysRunNew: true,
env: azureCli.env
}, TelemetryId.LoginCli).then(() => {
onAzdLoginAttempted();
});
}
3 changes: 3 additions & 0 deletions ext/vscode/src/telemetry/telemetryId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ export enum TelemetryId {
// Extra data captured: whether the "purge" option was used.
InfraDeleteCli = 'azure-dev.commands.cli.infra-delete.task',

// Reported when 'login' CLI command is invoked.
LoginCli = 'azure-dev.commands.cli.login-cli.task',

// Reported when 'pipeline config' CLI command is invoked.
PipelineConfigCli = 'azure-dev.commands.cli.pipeline-config.task',

Expand Down
7 changes: 6 additions & 1 deletion ext/vscode/src/utils/azureDevCli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,12 @@ export function scheduleAzdYamlCheck(): void {
export function onAzdInstallAttempted(): void {
azdInstallAttempted = true;

// Clear the install state so we'll check again at the next command
// Clear the install+login state so we'll check again at the next command
azdLoginChecker.clear();
}

export function onAzdLoginAttempted(): void {
// Clear the install+login state so we'll check again at the next command
azdLoginChecker.clear();
}

Expand Down

0 comments on commit 10392b6

Please sign in to comment.