Azure / Azure/azure-cli-extensions
[oracle-database] "az oracle-database autonomous-database update" return (400) Provisioning failed.
- Dominant language
- Python
- Stars
- 454
- Forks
- 1.7k
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 64
Description
Source: https://github.com/Azure/azure-cli/issues/32334 (by @chanstev)
Affected extension: `oracle-database` (`src/oracle-database/`)
---
<<>>
# Issue #32334 (by @chanstev)
## Title
"az oracle-database autonomous-database update" return (400) Provisioning failed.
## Body
### Describe the bug
Use AzCLI to update oracle-database autonomous-database, but it return (400) Provisioning failed. The AzCli using PUT instead of PATCH that the backend consider it's a create call instead of update call.
### Related command
az oracle-database autonomous-database update --compute-count 3 --ids /subscriptions/xxxxx-xxxx-xxxx-xxxx-xxxx/resourceGroups/rg-scdemo-adbs-HrK/providers/Oracle.Database/autonomousDatabases/adbsdemo
### Errors
(400) Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
Code: 400
Message: Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
### Issue script & Debug output
urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxx/resourceGroups/rg-scdemo-adbs-HrK/providers/Oracle.Database/autonomousDatabases/adbsdemo?api-version=2023-09-01 HTTP/1.1" 400 228
cli.azure.cli.core.sdk.policies: Response status: 400
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"error":{"code":"400","message":"Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again."}}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 666, in execute
raise ex
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 734, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 714, in _run_job
result = LongRunningOperation(cmd_copy.cli_ctx, 'Starting {}'.format(cmd_copy.name))(result)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 1085, in __call__
raise exception
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/__init__.py", line 1072, in __call__
result = poller.result()
^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/aaz/_poller.py", line 108, in result
self.wait(timeout)
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/core/tracing/decorator.py", line 119, in wrapper_use_tracer
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/aaz/_poller.py", line 130, in wait
raise self._exception
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/aaz/_poller.py", line 83, in _start
for polling_method in self._polling_generator:
^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenc/.azure/cliextensions/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_update.py", line 369, in _execute_operations
yield self.AutonomousDatabasesCreateOrUpdate(ctx=self.ctx)()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/stevenc/.azure/cliextensions/oracle-database/azext_oracle_database/aaz/latest/oracle_database/autonomous_database/_update.py", line 500, in __call__
return self.on_error(session.http_response)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.76.0/libexec/lib/python3.12/site-packages/azure/cli/core/aaz/_operation.py", line 327, in on_error
raise HttpResponseError(response=response, error_format=error_format)
azure.core.exceptions.HttpResponseError: (400) Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
Code: 400
Message: Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
cli.azure.cli.core.azclierror: (400) Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
Code: 400
Message: Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
az_command_data_logger: (400) Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
Code: 400
Message: Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
cli.knack.cli: Event: Cli.PostExecute []
### Expected behavior
oracle-database autonomous-database update successfully, for example able to scale from 2 ecpu to 3 ecpu
### Environment Summary
azure-cli 2.78.0
core 2.78.0
telemetry 1.1.0
Extensions:
bastion 1.4.2
oracle-database 1.0.0
ssh 2.0.6
vmware 8.0.0
Dependencies:
msal 1.34.0b1
azure-mgmt-resource 23.3.0
Python location '/usr/local/Cellar/azure-cli/2.78.0/libexec/bin/python'
Config directory '/Users/stevenc/.azure'
Extensions directory '/Users/stevenc/.azure/cliextensions'
Python (Darwin) 3.13.9 (main, Oct 14 2025, 13:52:31) [Clang 17.0.0 (clang-1700.0.13.3)]
### Additional context
The workaround calling REST with PATCH works:
az rest --method PATCH --uri https://management.azure.com/subscriptions/xxxxxx-xxxx-xxxx-xxxxx-xxxxxxx/resourceGroups/rg-scdemo-adbs-HrK/providers/Oracle.Database/autonomousDatabases/adbsdemo\?api-version\=2025-09-01 --body '{"properties":{"computeCount":2}}'
## Comments
### Comment by @azure-client-tools-bot-prd[bot]
Hi @chanstev,
2.76.0 is not the latest Azure CLI(2.78.0).
If you haven't already attempted to do so, please upgrade to the latest Azure CLI version by following https://learn.microsoft.com/en-us/cli/azure/update-azure-cli.
### Comment by @yonzhan
Thank you for opening this issue, we will look into it.
### Comment by @chanstev
retested with azure-cli 2.78.0 and same behaviour
### Comment by @chanstev
It's generally applicable for all update operations, here is another examples of updating store-auto-scaling
'''
❯ az oracle-database autonomous-database update --store-auto-scaling false --ids /subscriptions/xxxx-xxx-xxx-xxxx-xxxx/resourceGroups/rg-scdemo-adbs-HrK/providers/Oracle.Database/autonomousDatabases/adbsdemo
(400) Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
Code: 400
Message: Provisioning failed. A database with the same name exists. The database name must be unique among all Autonomous Databases for this subscription. Specify a unique database name and try again.
'''
### Comment by @chanstev
@jiasli Pls take a look of https://github.com/Azure/azure-cli-extensions/issues/9336 as it seems more related to azure-cli-extensions
<<>>
Contributor guide
Assessment
This issue has not been assessed yet.