gpt4 book ai didi

azure - 即使安装扩展后也无法在 vsCode 中使用 Azure Developer CLI (azd)

转载 作者:行者123 更新时间:2023-12-03 05:11:50 28 4
gpt4 key购买 nike

我一直在尝试在 Visual Studio Code (VSCode) 中集成和利用 Azure DevOps (AZD) 来进行我的开发工作。尽管尝试了多种方法和途径,但我始终遇到阻碍成功利用的问题。

主要问题是每次我尝试在 VSCode 中使用 AZD 时,操作都会失败。无论我尝试使用 AZD 的特定功能或特性如何,此问题仍然存在。该故障似乎与 AZD 扩展中的特定操作或命令无关。

我按照几个在线教程和官方文档在 VSCode 中设置和使用 AZD,确保正确配置所有必要的先决条件和设置。尽管如此,问题仍然没有解决。

  1. 安装** Azure Developer CLI ** 扩展:
    enter image description here

  2. 通过 vscode 终端中的以下命令安装独立的 Azure 开发人员 CLI。

powershell -ex AllSigned -c“Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression”

VERBOSE: Downloading build from https://azure-dev.azureedge.net/azd/standalone/release/latest/azd-windows-amd64.msi
VERBOSE: Verifying signature of D:\Users\2303906\AppData\Local\Temp\4ofthncj.h02\azd-windows-amd64.msi
VERBOSE: Installing MSI
VERBOSE: Cleaning temporary install directory: D:\Users\2303906\AppData\Local\Temp\4ofthncj.h02
Successfully installed azd
Azure Developer CLI (azd) installed successfully. You may need to restart running programs for installation to take effect.
- For Windows Terminal, start a new Windows Terminal instance.
- For VSCode, close all instances of VSCode and then restart it.

The Azure Developer CLI collects usage data and sends that usage data to Microsoft in order to help us improve your experience.
You can opt-out of telemetry by setting the AZURE_DEV_COLLECT_TELEMETRY environment variable to 'no' in the shell you use.

但是当我尝试验证时,我仍然遇到了问题:

azd auth login

azd: The term 'azd' is not recognized as a name of a cmdlet, function, script file, or executable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.

最佳答案

当我尝试在我的环境中重现相同的情况时,我遇到了相同的错误。

enter image description here

安装 Azure Developer CLI 所遵循的步骤:

  1. 在 Visual Studio Code 中安装了 Azure Developer CLI->扩展:

enter image description here

enter image description here

修复错误:

The term azd is not recognized as the name of the cmdlet

通过运行以下命令安装 az 模块:Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

enter image description here

现在可以登录 azd:

enter image description here

初始化了一个新项目:

enter image description here

引用文献: Install Azure Developer CLI

关于azure - 即使安装扩展后也无法在 vsCode 中使用 Azure Developer CLI (azd),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/76379624/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com