Azure-Samples / azure-devops-copilot-extension

An Azure DevOps Copilot Extension Sample
MIT License
40 stars 15 forks source link

Issue creating infrastructure to Azure DevOps #10

Closed maythamfahmi closed 5 months ago

maythamfahmi commented 8 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [X] bug report -> please search issues before submitting
- [ ] feature request
- [X] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

When trying to create/deploy infrastructure as mentioned in the documentation: https://github.com/Azure-Samples/azure-devops-copilot-extension/tree/main/infra I get the following error seen in the snapshot image:

image

Any log messages given by the failure

Expected/desired behavior

OS and Version?

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

watts-agb commented 8 months ago

I would like to add, that I recieve the same error:

{"status":"Failed","error":{"code":"DeploymentFailed","target":"/subscriptions/4115df4b-2e16-4f75-ab02-XXX/providers/Microsoft.Resources/deployments/main","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/4115df4b-2e16-4f75-ab02-XXX/resourceGroups/devops-copilot/providers/Microsoft.Resources/deployments/devops-copilot-openai-20231220125748","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/subscriptions/4115df4b-2e16-4f75-ab02-XXX/resourceGroups/devops-copilot/providers/Microsoft.Resources/deployments/devops-copilot-openai-20231220125748","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"ResourceDeploymentFailure","target":"/subscriptions/4115df4b-2e16-4f75-ab02-XXX/resourceGroups/devops-copilot/providers/Microsoft.Resources/deployments/openaiservice-20231220125748","message":"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'.","details":[{"code":"DeploymentFailed","target":"/subscriptions/4115df4b-2e16-4f75-ab02-XXX/resourceGroups/devops-copilot/providers/Microsoft.Resources/deployments/openaiservice-20231220125748","message":"At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-deployment-operations for usage details.","details":[{"code":"CanNotRestoreANonExistingResource","message":"Could not locate a resource to restore. The resource with ID '/subscriptions/4115df4b-2e16-4f75-ab02-XXX/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-vfrlc2bbtltek' doesn't exist or it is already purged."}]}]}]}]}]}}

This is a screenshot of my available Microsoft.CognitiveServices/accounts

image

mahomedalid commented 7 months ago

Thanks for reporting this, I will check it out.

maythamfahmi commented 7 months ago

Running it from command line with debug:

az deployment sub create --location westeurope --template-file main.bicep --debug

The same error appears:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 612, in _deploy_arm_template_at_subscription_scope
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/mgmt/resource/resources/v2022_09_01/operations/_operations.py", line 6855, in begin_validate_at_subscription_scope
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/polling/_poller.py", line 170, in __init__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/core/polling/base_polling.py", line 482, in initialize
azure.core.exceptions.HttpResponseError: (InvalidTemplateDeployment) The template deployment 'main' is not valid according to the validation procedure. The tracking id is 'd6709d4f-2f98-473f-ac63-6d63951dce28'. See inner errors for details.
Code: InvalidTemplateDeployment
Message: The template deployment 'main' is not valid according to the validation procedure. The tracking id is 'd6709d4f-2f98-473f-ac63-6d63951dce28'. See inner errors for details.
Exception Details:      (CanNotRestoreANonExistingResource) Could not locate a resource to restore. The resource with ID '/subscriptions/321fca3c-dbe8-4ce7-98a3-8145b43fa992/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-yykda3afv5cvi' doesn't exist or it is already purged.
        Code: CanNotRestoreANonExistingResource
        Message: Could not locate a resource to restore. The resource with ID '/subscriptions/321fca3c-dbe8-4ce7-98a3-8145b43fa992/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-yykda3afv5cvi' doesn't exist or it is already purged.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 697, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 333, in __call__
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/command_operation.py", line 121, in handler
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 575, in deploy_arm_template_at_subscription_scope
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/command_modules/resource/custom.py", line 615, in _deploy_arm_template_at_subscription_scope
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 102, in raise_subdivision_deployment_error
azure.cli.core.azclierror.InvalidTemplateError: {"code": "InvalidTemplateDeployment", "message": "The template deployment 'main' is not valid according to the validation procedure. The tracking id is 'd6709d4f-2f98-473f-ac63-6d63951dce28'. See inner errors for details."}

Inner Errors:
{"code": "CanNotRestoreANonExistingResource", "message": "Could not locate a resource to restore. The resource with ID '/subscriptions/321fca3c-dbe8-4ce7-98a3-8145b43fa992/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-yykda3afv5cvi' doesn't exist or it is already purged."}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 109, in handle_template_based_exception
AttributeError: 'InvalidTemplateError' object has no attribute 'inner_exception'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 233, in invoke
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 663, in execute
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/__init__.py", line 718, in _run_job
  File "D:\a\_work\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 114, in handle_template_based_exception
knack.util.CLIError: {"code": "InvalidTemplateDeployment", "message": "The template deployment 'main' is not valid according to the validation procedure. The tracking id is 'd6709d4f-2f98-473f-ac63-6d63951dce28'. See inner errors for details."}

Inner Errors:
{"code": "CanNotRestoreANonExistingResource", "message": "Could not locate a resource to restore. The resource with ID '/subscriptions/321fca3c-dbe8-4ce7-98a3-8145b43fa992/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-yykda3afv5cvi' doesn't exist or it is already purged."}

cli.azure.cli.core.azclierror: {"code": "InvalidTemplateDeployment", "message": "The template deployment 'main' is not valid according to the validation procedure. The tracking id is 'd6709d4f-2f98-473f-ac63-6d63951dce28'. See inner errors for details."}

Inner Errors:
{"code": "CanNotRestoreANonExistingResource", "message": "Could not locate a resource to restore. The resource with ID '/subscriptions/321fca3c-dbe8-4ce7-98a3-8145b43fa992/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-yykda3afv5cvi' doesn't exist or it is already purged."}
az_command_data_logger: {"code": "InvalidTemplateDeployment", "message": "The template deployment 'main' is not valid according to the validation procedure. The tracking id is 'd6709d4f-2f98-473f-ac63-6d63951dce28'. See inner errors for details."}

Inner Errors:
{"code": "CanNotRestoreANonExistingResource", "message": "Could not locate a resource to restore. The resource with ID '/subscriptions/321fca3c-dbe8-4ce7-98a3-8145b43fa992/resourceGroups/devops-copilot/providers/Microsoft.CognitiveServices/accounts/devops-copilot-openai-yykda3afv5cvi' doesn't exist or it is already purged."}
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x000001DF6D6DA0C0>]
maqsoodahmad commented 7 months ago

I'm also getting same error. Any fix for this error?

bastianjohn commented 5 months ago

I am facing the same issue. Is there any workaround?

mahomedalid commented 5 months ago

This should be fixed now. image