Skip to content

test_image_build_identity live test fails: Managed identity is required for building this template using current API version #28677

@jiasli

Description

@jiasli

https://dev.azure.com/azclitools/internal/_build/results?buildId=145445&view=logs&j=c4f33547-49c0-5c65-7824-491d55a01606&t=a7ac92da-e355-5684-e29f-c3f1345ef523

2024-04-02T10:43:15.0528136Z _________________ ImageTemplateTest.test_image_build_identity __________________
2024-04-02T10:43:15.0528627Z [gw0] linux -- Python 3.10.14 /mnt/vss/_work/1/s/env/bin/python
2024-04-02T10:43:15.0529281Z self = <azure.mgmt.core.polling.arm_polling.ARMPolling object at 0x7f7f075c1210>
2024-04-02T10:43:15.0529440Z 
2024-04-02T10:43:15.0529699Z     def run(self) -> None:
2024-04-02T10:43:15.0529904Z         try:
2024-04-02T10:43:15.0530091Z >           self._poll()
2024-04-02T10:43:15.0530180Z 
2024-04-02T10:43:15.0530560Z env/lib/python3.10/site-packages/azure/core/polling/base_polling.py:730: 
2024-04-02T10:43:15.0530879Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-04-02T10:43:15.0531001Z 
2024-04-02T10:43:15.0531258Z self = <azure.mgmt.core.polling.arm_polling.ARMPolling object at 0x7f7f075c1210>
2024-04-02T10:43:15.0531423Z 
2024-04-02T10:43:15.0531680Z     def _poll(self) -> None:
2024-04-02T10:43:15.0531944Z         """Poll status of operation so long as operation is incomplete and
2024-04-02T10:43:15.0532193Z         we have an endpoint to query.
2024-04-02T10:43:15.0532383Z     
2024-04-02T10:43:15.0532731Z         :raises: OperationFailed if operation status 'Failed' or 'Canceled'.
2024-04-02T10:43:15.0533042Z         :raises: BadStatus if response status invalid.
2024-04-02T10:43:15.0533297Z         :raises: BadResponse if response invalid.
2024-04-02T10:43:15.0533509Z         """
2024-04-02T10:43:15.0533697Z         if not self.finished():
2024-04-02T10:43:15.0533912Z             self.update_status()
2024-04-02T10:43:15.0534136Z         while not self.finished():
2024-04-02T10:43:15.0534341Z             self._delay()
2024-04-02T10:43:15.0534548Z             self.update_status()
2024-04-02T10:43:15.0534737Z     
2024-04-02T10:43:15.0534922Z         if _failed(self.status()):
2024-04-02T10:43:15.0535168Z >           raise OperationFailed("Operation failed or canceled")
2024-04-02T10:43:15.0535470Z E           azure.core.polling.base_polling.OperationFailed: Operation failed or canceled
2024-04-02T10:43:15.0535621Z 
2024-04-02T10:43:15.0536437Z env/lib/python3.10/site-packages/azure/core/polling/base_polling.py:762: OperationFailed
2024-04-02T10:43:15.0536620Z 
2024-04-02T10:43:15.0536849Z The above exception was the direct cause of the following exception:
2024-04-02T10:43:15.0536966Z 
2024-04-02T10:43:15.0537206Z self = <latest.test_image_builder_commands.ImageTemplateTest testMethod=test_image_build_identity>
2024-04-02T10:43:15.0537679Z resource_group = 'img_tmpl_identity_sn227mnmyvy6hnmtxcbumsjw2krxda7w4mpfjc4gpjhzhah6hskidpw7b'
2024-04-02T10:43:15.0537839Z 
2024-04-02T10:43:15.0538144Z     @ResourceGroupPreparer(name_prefix='img_tmpl_identity_')
2024-04-02T10:43:15.0538402Z     def test_image_build_identity(self, resource_group):
2024-04-02T10:43:15.0538635Z         self._identity_role(resource_group)
2024-04-02T10:43:15.0538825Z     
2024-04-02T10:43:15.0538992Z         self.kwargs.update({
2024-04-02T10:43:15.0539285Z             'img_src': LINUX_IMAGE_SOURCE,
2024-04-02T10:43:15.0539600Z             'gallery': self.create_random_name("sig_", 10),
2024-04-02T10:43:15.0539872Z             'sig1': 'image1',
2024-04-02T10:43:15.0540121Z             'tmpl': 'template01',
2024-04-02T10:43:15.0540405Z             'script': TEST_SHELL_SCRIPT_URL
2024-04-02T10:43:15.0540595Z         })
2024-04-02T10:43:15.0540753Z     
2024-04-02T10:43:15.0541052Z         self.cmd('sig create -g {rg} --gallery-name {gallery}')
2024-04-02T10:43:15.0541498Z         self.cmd('sig image-definition create -g {rg} --gallery-name {gallery} --gallery-image-definition {sig1} '
2024-04-02T10:43:15.0541917Z                  '--os-type linux -p publisher1 -f offer1 -s sku1')
2024-04-02T10:43:15.0542117Z     
2024-04-02T10:43:15.0542272Z         self.cmd(
2024-04-02T10:43:15.0542668Z             'image builder create -n {tmpl} -g {rg} --scripts {script} --image-source {img_src} --identity {ide} --defer')
2024-04-02T10:43:15.0543148Z         self.cmd('image builder output add -n {tmpl} -g {rg} --gallery-name {gallery} --gallery-image-definition {sig1}'
2024-04-02T10:43:15.0543541Z                  ' --gallery-replication-regions westus --defer')
2024-04-02T10:43:15.0543874Z     
2024-04-02T10:43:15.0544201Z         # send put request using cached template object
2024-04-02T10:43:15.0544538Z         self.cmd('image builder update -n {tmpl} -g {rg}')
2024-04-02T10:43:15.0544734Z     
2024-04-02T10:43:15.0545065Z         ide_id = self.cmd('identity show -n {ide} -g {rg}').get_output_in_json()['id']
2024-04-02T10:43:15.0545292Z     
2024-04-02T10:43:15.0545451Z         # remove identity
2024-04-02T10:43:15.0545814Z >       self.cmd('image builder identity remove -n {tmpl} -g {rg} --user-assigned --yes',
2024-04-02T10:43:15.0546051Z                  checks=[
2024-04-02T10:43:15.0546340Z                      self.check('type', 'None'),
2024-04-02T10:43:15.0546662Z                      self.check('userAssignedIdentities', None)
2024-04-02T10:43:15.0546862Z                  ])
2024-04-02T10:43:15.0546931Z 
2024-04-02T10:43:15.0547296Z src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_image_builder_commands.py:688: 
2024-04-02T10:43:15.0547587Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-04-02T10:43:15.0547945Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:176: in cmd
2024-04-02T10:43:15.0548249Z     return execute(self.cli_ctx, command, expect_failure=expect_failure).assert_with_checks(checks)
2024-04-02T10:43:15.0548645Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:251: in __init__
2024-04-02T10:43:15.0548926Z     self._in_process_execute(cli_ctx, command, expect_failure=expect_failure)
2024-04-02T10:43:15.0549310Z src/azure-cli-testsdk/azure/cli/testsdk/base.py:314: in _in_process_execute
2024-04-02T10:43:15.0549551Z     raise ex.exception
2024-04-02T10:43:15.0549879Z env/lib/python3.10/site-packages/knack/cli.py:233: in invoke
2024-04-02T10:43:15.0550130Z     cmd_result = self.invocation.execute(args)
2024-04-02T10:43:15.0550493Z src/azure-cli-core/azure/cli/core/commands/__init__.py:664: in execute
2024-04-02T10:43:15.0550724Z     raise ex
2024-04-02T10:43:15.0551081Z src/azure-cli-core/azure/cli/core/commands/__init__.py:731: in _run_jobs_serially
2024-04-02T10:43:15.0551370Z     results.append(self._run_job(expanded_arg, cmd_copy))
2024-04-02T10:43:15.0551741Z src/azure-cli-core/azure/cli/core/commands/__init__.py:701: in _run_job
2024-04-02T10:43:15.0551980Z     result = cmd_copy(params)
2024-04-02T10:43:15.0552325Z src/azure-cli-core/azure/cli/core/commands/__init__.py:334: in __call__
2024-04-02T10:43:15.0552586Z     return self.handler(*args, **kwargs)
2024-04-02T10:43:15.0552967Z src/azure-cli-core/azure/cli/core/commands/command_operation.py:121: in handler
2024-04-02T10:43:15.0553223Z     return op(**command_args)
2024-04-02T10:43:15.0553601Z src/azure-cli/azure/cli/command_modules/vm/_image_builder.py:590: in remove_template_identity
2024-04-02T10:43:15.0553955Z     return _remove_template_identity(cmd, resource_group_name, image_template_name, user_assigned, getter, setter)
2024-04-02T10:43:15.0554428Z src/azure-cli/azure/cli/command_modules/vm/_image_builder.py:626: in _remove_template_identity
2024-04-02T10:43:15.0554782Z     result = LongRunningOperation(cmd.cli_ctx)(setter(resource_group_name, image_template_name, resource))
2024-04-02T10:43:15.0555198Z src/azure-cli-core/azure/cli/core/commands/__init__.py:1048: in __call__
2024-04-02T10:43:15.0555426Z     raise exception
2024-04-02T10:43:15.0555774Z src/azure-cli-core/azure/cli/core/commands/__init__.py:1035: in __call__
2024-04-02T10:43:15.0556038Z     result = poller.result()
2024-04-02T10:43:15.0556389Z env/lib/python3.10/site-packages/azure/core/polling/_poller.py:242: in result
2024-04-02T10:43:15.0556622Z     self.wait(timeout)
2024-04-02T10:43:15.0556994Z env/lib/python3.10/site-packages/azure/core/tracing/decorator.py:76: in wrapper_use_tracer
2024-04-02T10:43:15.0557256Z     return func(*args, **kwargs)
2024-04-02T10:43:15.0557619Z env/lib/python3.10/site-packages/azure/core/polling/_poller.py:261: in wait
2024-04-02T10:43:15.0557889Z     raise self._exception  # type: ignore
2024-04-02T10:43:15.0558266Z env/lib/python3.10/site-packages/azure/core/polling/_poller.py:176: in _start
2024-04-02T10:43:15.0558667Z     self._polling_method.run()
2024-04-02T10:43:15.0558888Z _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
2024-04-02T10:43:15.0559007Z 
2024-04-02T10:43:15.0559227Z self = <azure.mgmt.core.polling.arm_polling.ARMPolling object at 0x7f7f075c1210>
2024-04-02T10:43:15.0559360Z 
2024-04-02T10:43:15.0559597Z     def run(self) -> None:
2024-04-02T10:43:15.0559771Z         try:
2024-04-02T10:43:15.0559954Z             self._poll()
2024-04-02T10:43:15.0560134Z     
2024-04-02T10:43:15.0560320Z         except BadStatus as err:
2024-04-02T10:43:15.0560531Z             self._status = "Failed"
2024-04-02T10:43:15.0560823Z             raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err
2024-04-02T10:43:15.0561078Z     
2024-04-02T10:43:15.0561263Z         except BadResponse as err:
2024-04-02T10:43:15.0561477Z             self._status = "Failed"
2024-04-02T10:43:15.0561688Z             raise HttpResponseError(
2024-04-02T10:43:15.0561939Z                 response=self._pipeline_response.http_response,
2024-04-02T10:43:15.0562173Z                 message=str(err),
2024-04-02T10:43:15.0562374Z                 error=err,
2024-04-02T10:43:15.0562560Z             ) from err
2024-04-02T10:43:15.0562740Z     
2024-04-02T10:43:15.0562930Z         except OperationFailed as err:
2024-04-02T10:43:15.0563231Z >           raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err
2024-04-02T10:43:15.0564122Z E           azure.core.exceptions.HttpResponseError: (IdentityRequired) Managed identity is required for building this template using current API version. Please create a user assigned identity and update the template with the 'identity' properties. For details, review http://aka.ms/azvmimagebuildertmplref.
2024-04-02T10:43:15.0564619Z E           Code: IdentityRequired
2024-04-02T10:43:15.0565348Z E           Message: Managed identity is required for building this template using current API version. Please create a user assigned identity and update the template with the 'identity' properties. For details, review http://aka.ms/azvmimagebuildertmplref.
2024-04-02T10:43:15.0565676Z 
2024-04-02T10:43:15.0566075Z env/lib/python3.10/site-packages/azure/core/polling/base_polling.py:745: HttpResponseError
2024-04-02T10:43:15.0566543Z ------------------------------ Captured log call -------------------------------
2024-04-02T10:43:15.0567315Z WARNING  cli.azure.cli.command_modules.vm.custom:custom.py:4679 Starting Build (May) 2024, "az sig image-definition create" command will use the new default values Hyper-V Generation: V2 and SecurityType: TrustedLaunchSuppoted.

Metadata

Metadata

Labels

Auto-AssignAuto assign by botService AttentionThis issue is responsible by Azure service team.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions