我有一个具有系统分配的托管服务标识的 VM。我允许它从 Azure 容器注册表中提取图像。我跟着这个教程。
我昨天工作得很好。但是当要拉新图像时,它说要重新验证。这就是失败的地方。当我执行以下任一操作时,我收到错误,指出令牌获取失败。
难道我做错了什么?
az 登录 -- 身份
az acr login --name MYREGISTRY
MSI: Failed to acquire tokens after 12 times
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 328, in execute
raise ex
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 386, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 379, in _run_job
six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 356, in _run_job
result = cmd_copy(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 171, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/__init__.py", line 441, in default_command_handler
return op(**command_args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/command_modules/profile/custom.py", line 111, in login
return profile.find_subscriptions_in_vm_with_msi(username)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/_profile.py", line 297, in find_subscriptions_in_vm_with_msi
msi_creds = MSIAuthentication(resource=resource)
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 576, in __init__
self.set_token()
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 584, in set_token
token_entry = self._vm_msi.get_token(self.resource)
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 632, in get_token
token_entry = self._retrieve_token_from_imds_with_retry(resource)
File "/opt/az/lib/python3.6/site-packages/msrestazure/azure_active_directory.py", line 674, in _retrieve_token_from_imds_with_retry
raise TimeoutError('MSI: Failed to acquire tokens after {} times'.format(max_retry))
TimeoutError: MSI: Failed to acquire tokens after 12 times