การเข้าสู่ระบบ az devops แฮงค์
ฉันกำลังทำงานกับ Windows 10, โมดูล Azure PowerShell Az, ส่วนขยาย DevOps 0.18.0
ฉันลงชื่อเข้าใช้อินสแตนซ์ DevOps และสามารถเรียกใช้คำสั่งที่เกี่ยวข้องทั้งหมดได้ ตอนนี้ฉันต้องลงชื่อเข้าใช้องค์กร / โครงการอื่น ทุกครั้งที่เรียกใช้คำสั่งย่อย login หน้าต่างค้างและล็อกฉันต้องรีสตาร์ท PowerShell ISE เพื่อลองอีกครั้ง
คำสั่งที่ฉันใช้ (ฉันลองหลายรูปแบบแล้ว) ได้แก่ :
> az login
> $env:AZURE_DEVOPS_EXT_PAT ='{PAT}'
> az devops login --organization https://dev.azure.com/{org} --debug
HANGS ที่นี่ !!
บันทึกการแก้ปัญหาด้านล่าง
az devops เข้าสู่ระบบ - องค์กร https://dev.azure.com/{org} --debug
CategoryInfo : NotSpecified: (Command argumen...nn', '--debug']:String) [], RemoteException + FullyQualifiedErrorId : NativeCommandError Event: Cli.PreExecute [] Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x03A171E0>, <function OutputProducer.on_global_arguments at 0x03B3AA98>, <function CLIQuery.on_global_arguments at 0x03B5CCD8>] Event: CommandInvoker.OnPreCommandTableCreate [] Modules found from index for 'devops': ['azext_devops'] Loading command modules: Name Load Time Groups Commands Total (0) 0.000 0 0 These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_ai_did_you_mean_this'] Loading extensions: Name Load Time Groups Commands Directory azure-devops 0.110 60 191 C:\Users\{username}\.azure\cliextensions\azure-devops Total (1) 0.110 60 191 Loaded 60 groups, 191 commands. Found a match in the command table for 'devops login' Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03C2B978>] az_command_data_logger : command args: devops login --organization {} --debug metadata file logging enabled - writing logs to 'C:\Users\{username}\.azure\commands'. Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x03D69660>] Event: CommandInvoker.OnPostArgumentLoad [] Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x03D69618>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x03D69E40>] Event: CommandInvoker.OnCommandTableLoaded [] Event: CommandInvoker.OnPreParseArgs [] Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x03B3AAE0>, <function CLIQuery.handle_query_parameter at 0x03B5CD20>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x03D69DF8>, <function DevCommandsLoader.post_parse_args at 0x03CF6150>] az_command_data_logger : extension name: azure-devops az_command_data_logger : extension version: 0.18.0
- ฉันรีสตาร์ท windows 10 แล้ว
- ฉันออกจากระบบ az (az logout)
- ฉันออกจากระบบ devops (az devops logout)
- ฉันเรียกใช้ PowerShell ISE ในการอนุญาตระดับสูง (ผู้ดูแลระบบ) เสมอ
ฉันได้รับการยืนยันหลังจากทั้งหมดนี้ฉันยังสามารถเข้าถึง DevOps (ไปป์ไลน์การเผยแพร่ ฯลฯ ) จากองค์กร / โครงการที่ฉันเริ่มต้นได้ ดังนั้นการออกจากระบบก็ล้มเหลวเช่นกัน
เกิดอะไรขึ้น? มีความคิดว่าเหตุใดจึงเกิดขึ้น
คำตอบ
ตอนนี้ฉันต้องลงชื่อเข้าใช้องค์กร / โครงการอื่น
สถานการณ์ที่ 1:องค์กร / โครงการเป้าหมายยังคงอยู่ภายใต้บัญชีผู้ใช้เดียวกัน
หากองค์กร / โปรเจ็กต์เป้าหมายที่คุณต้องการทำงานด้วยยังอยู่ภายใต้บัญชีผู้ใช้เดียวกันในขณะนี้คุณไม่จำเป็นต้องออกจากระบบและเข้าสู่ระบบอีกครั้ง
เพียงเรียกใช้คำสั่งด้านล่างเพื่อเปลี่ยนองค์กร / โครงการเริ่มต้นโดยใช้:
az devops configure --defaults organization=https://dev.azure.com/{org name}
จากนั้นคุณจะสามารถทำงานกับองค์กร / โปรเจ็กต์อื่นได้โดยไม่ต้องลงชื่อเข้าใช้อีกครั้ง
สถานการณ์ที่ 2:องค์กร / โครงการเป้าหมายอยู่ภายใต้บัญชีผู้ใช้อื่น
หากสถานการณ์จริงคือคุณต้องเปลี่ยนเป็นการเข้าสู่ระบบด้วยบัญชีอื่นเพื่อทำงานกับองค์กร / โปรเจ็กต์นั้นโปรดเรียกใช้คำสั่งด้านล่างเพื่อออกจากระบบก่อน:
az logout --username "{another account}"
จากนั้นเรียกใช้อีกครั้งaz loginเพื่อเข้าสู่ระบบด้วยที่อยู่บัญชีอื่น ตอนนี้คุณควรจะประสบความสำเร็จแล้ว