【Azure Developer】azd 安装最新版无法登录中国区问题二:本地Windows环境遇问题

问题描述

在本地windows环境中,安装了azd(Azure Developer CLI)最新版后,遇见无法登录Azure中国区。报错和之前在devops的pipeline上错误一样(DevOps上的报错文章请参考:https://www.cnblogs.com/lulight/p/19149913)。

执行命令:

复制代码
#配置azd命令执行环境为中国区Azure
azd config set cloud.name AzureChinaCloud

# 登录
azd up

报错信息:

ERROR: failed to authenticate: unable to resolve an endpoint: ResolveEndpoints(): TenantDiscoveryResponse: issuer from OIDC discovery 'https://login.partner.microsoftonline.cn/{tenantid}/v2.0' does not match authority 'https://login.chinacloudapi.cn/organizations/' or a known pattern

错误截图:

解决方法

最直接的办法是通过命令安装旧版本,比如1.19.0 。在测试使用命令 winget install microsoft.azd --version 1.19.0 安装失败。

最后,通过公网搜索的方式,找到老版本的azd 下载文档地址:Release azure-dev-cli_1.19.0 · Azure/azure-dev

下载msi安装文件,本地安装后。再次使用azd up,就可以正常登录到中国区Azure

注:需要先执行 uninstall 命令卸载最新版本。 执行命令: winget uninstall microsoft.azd

登录成功!

参考资料

使用Azure Developer CLI (azd)部署项目时候遇见无法登录中国区Azure的报错 : https://www.cnblogs.com/lulight/p/19149913

Install or update the Azure Developer CLI: https://learn.microsoft.com/en-us/azure/developer/azure-developer-cli/install-azd?tabs=winget-windows%2Cbrew-mac%2Cscript-linux&pivots=os-windows

azure-dev-cli_1.19.0 : https://github.com/Azure/azure-dev/releases/tag/azure-dev-cli_1.19.0

当在复杂的环境中面临问题,格物之道需:浊而静之徐清,安以动之徐生。 云中,恰是如此!

相关推荐
历程里程碑2 小时前
滑动窗口------滑动窗口最大值
大数据·python·算法·elasticsearch·搜索引擎·flask·tornado
90的程序爱好者5 小时前
Flask 用户注册功能实现
python·flask
编码者卢布16 小时前
【Azure Storage Account】Azure Table Storage 跨区批量迁移方案
后端·python·flask
编码者卢布19 小时前
【Azure Developer】中国区Azure环境中查看用户账号是否可用(accountEnabled)的操作步骤
microsoft·flask·azure
编码者卢布19 小时前
【Azure APIM】如何实现对经过APIM并到达后端服务请求的全链路追踪呢?
python·flask·azure
编码者卢布19 小时前
【Azure Stream Analytic】用 JavaScript UDF 解决 JSON 字段被转成 Record 的关键点
javascript·json·azure
编码者卢布21 小时前
【Azure App Service】部署在应用服务上的WebJob中,为何会多出一个名为“DaaS“的 WebJob呢?
microsoft·azure
晚霞的不甘1 天前
Flutter for OpenHarmony构建全功能视差侧滑菜单系统:从动效设计到多页面导航的完整实践
前端·学习·flutter·microsoft·前端框架·交互
java1234_小锋1 天前
【AI大模型舆情分析】微博舆情分析可视化系统(pytorch2+基于BERT大模型训练微调+flask+pandas+echarts) 实战(下)
人工智能·flask·bert·ai大模型