英文:
Unable to use Azure Developer CLI (azd) in vsCode even after extensions installed
问题
我一直在尝试在Visual Studio Code(VSCode)中集成和使用Azure DevOps(AZD)进行我的开发工作。尽管尝试了多种方法和方式,但我一直遇到阻止成功利用的问题。
主要问题是,每次我尝试在VSCode中使用AZD时,操作都会失败。无论我尝试使用AZD的特定功能或功能是什么,这个问题都会持续存在。失败似乎与AZD扩展内的特定操作或命令无关。
我已经按照多个在线教程和官方文档来设置和在VSCode中使用AZD,确保所有必要的先决条件和设置都已正确配置。尽管如此,问题仍未解决。
powershell -ex AllSigned -c "Invoke-RestMethod 'https://aka.ms/install-azd.ps1' | Invoke-Expression"
VERBOSE: 从 https://azure-dev.azureedge.net/azd/standalone/release/latest/azd-windows-amd64.msi 下载构建
VERBOSE: 验证 D:\Users303906\AppData\Local\Tempofthncj.h02\azd-windows-amd64.msi 的签名
VERBOSE: 安装 MSI
VERBOSE: 清理临时安装目录: D:\Users303906\AppData\Local\Tempofthncj.h02
已成功安装 azd
Azure Developer CLI(azd)已成功安装。您可能需要重新启动运行的程序以使安装生效。
- 对于Windows Terminal,请启动新的Windows Terminal实例。
- 对于VSCode,请关闭所有VSCode实例,然后重新启动。
Azure Developer CLI会收集使用数据并将该使用数据发送给Microsoft,以帮助我们改善您的体验。
您可以通过在您使用的shell中将AZURE_DEV_COLLECT_TELEMETRY环境变量设置为'no'来选择退出遥测。
但当我尝试验证时,我仍然遇到了问题:
azd auth login
azd: 术语 'azd' 被识别为不是cmdlet、函数、脚本文件或可执行程序的名称。
请检查名称的拼写,或者如果包含了路径,请验证路径是否正确,然后重试。
英文:
I have been attempting to integrate and utilize Azure DevOps (AZD) within Visual Studio Code (VSCode) for my development work. Despite trying multiple methods and approaches, I have consistently encountered issues that prevent successful utilization.
The main problem is that every time I attempt to use AZD in VSCode, the operation fails. This issue persists regardless of the specific function or feature of AZD I'm trying to use. The failure does not seem to be tied to a specific action or command within the AZD extension.
I have followed several online tutorials and official documentation to set up and use AZD in VSCode, ensuring that all the necessary prerequisites and settings are correctly configured. Despite this, the problem remains unresolved.
-
Install the standalone Azure Developer CLI via the following command in vscode terminal.
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:\Users03906\AppData\Local\Tempofthncj.h02\azd-windows-amd64.msi
VERBOSE: Installing MSI
VERBOSE: Cleaning temporary install directory: D:\Users03906\AppData\Local\Tempofthncj.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.
But when I tried to verify, I still met the issue:
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.
答案1
得分: 2
"当我尝试在我的环境中复现相同情况时,我得到了相同的错误。"
我遵循的安装Azure开发者CLI的步骤:
- 在Visual Studio Code中安装Azure开发者CLI->扩展:
要修复错误:
The term azd is not recognized as the name of the cmdlet
通过运行以下命令安装az
模块:
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
"现在,可以登录到azd:"
"初始化了一个新项目:"
参考资料:
安装Azure开发者CLI
英文:
When I tried to reproduce the same in my environment, I was getting the same error.
Steps I followed to install Azure Developer CLI:
- Installed Azure Developer CLI in visual studio code->Extensions:
To fix the error:
>The term azd is not recognized as the name of the cmdlet
Install az
module by running the below command:
Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force
Now, able to login to azd:
Initialized a new project:
References:
Install Azure Developer CLI
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论