Updating firewall ip address of Cosmos mongo DB fails
Updating firewall ip address of Cosmos mongo DB fails.
Previous entries remain unchanged. Cannot add/edit.
Azure Cosmos DB
-
Mahesh Kurva • 5,025 Reputation points • Microsoft External Staff • Moderator
2025-06-20T13:48:17.4933333+00:00 It sounds like you're having trouble updating the firewall IP address for your Azure Cosmos DB using the MongoDB API.
Could you please share the complete error details to help us better understand and investigate the issue?Thank you.
-
Venkatesh Rajagopal • 0 Reputation points
2025-06-20T14:16:22.7666667+00:00 Im using the cloud console. It just says updating.... but does not update.
-
Venkatesh Rajagopal • 0 Reputation points
2025-06-20T14:21:45.0966667+00:00 Also fails on CLI:
Command format:
az cosmosdb mongocluster firewall rule create \--cluster-name MyCluster \
--resource-group MyResourceGroup \
--rule-name MyNewRule \
--start-ip-address YourIPAddress \
--end-ip-address YourIPAddress
< I have substituted the right values for my cluster - ( Cosmos MongoDB - vcore) .
The command failed with an unexpected error. Here is the traceback:
cannot import name 'get_arm_endpoints' from 'azure.mgmt.core.tools' (/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/mgmt/core/tools.py)
Traceback (most recent call last):
File "/usr/local/Cellar/azure-cli/2.71.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.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 564, in execute
self.commands_loader.load_arguments(command)
File "/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/init.py", line 548, in load_arguments
self.command_table[command].load_arguments() # this loads the arguments via reflection
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/init.py", line 321, in load_arguments
super().load_arguments()
File "/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/knack/commands.py", line 104, in load_arguments
cmd_args = self.arguments_loader()
^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 124, in arguments_loader
op = self.get_op_handler(self.op_path)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/cli/core/commands/command_operation.py", line 59, in get_op_handler
handler = import_module(mod_to_import)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/Cellar/python@3.12/3.12.10/Frameworks/Python.framework/Versions/3.12/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 999, in exec_module
File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
File "/Users/--/.azure/cliextensions/cosmosdb-preview/azext_cosmosdb_preview/custom.py", line 10, in <module>
from azext_cosmosdb_preview.vendored_sdks.azure_mgmt_cosmosdb.models import (
File "/Users/--/.azure/cliextensions/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/init.py", line 15, in <module>
from ._cosmos_db_management_client import CosmosDBManagementClient # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/--/.azure/cliextensions/cosmosdb-preview/azext_cosmosdb_preview/vendored_sdks/azure_mgmt_cosmosdb/_cosmos_db_management_client.py", line 18, in <module>
from azure.mgmt.core.tools import get_arm_endpoints
ImportError: cannot import name 'get_arm_endpoints' from 'azure.mgmt.core.tools' (/usr/local/Cellar/azure-cli/2.71.0/libexec/lib/python3.12/site-packages/azure/mgmt/core/tools.py)
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
-
Mahesh Kurva • 5,025 Reputation points • Microsoft External Staff • Moderator
2025-06-20T18:02:06.2433333+00:00 - If you're accessing the cluster from a non-Azure IP range, you must explicitly add that IP or range to the firewall rules.
- Go to the Networking settings of your Cosmos DB cluster in the Azure portal and ensure the IP address is correctly added.
- Try refreshing the portal or using a different browser. Occasionally, UI caching can prevent updates from appearing.
- Try using azure cli
az cosmosdb update --name <account-name> --resource-group <rg> --ip-range-filter <new-ip>
- For MongoDB vCore clusters, firewall rules are managed differently. Make sure you're updating the correct resource and using the Networking tab in the cluster settings.
- If you can downgrade to Python 3.11 and reinstall CLI + extension — it's the most reliable workaround right now.
For more information, please refer the documents.
https://learn.microsoft.com/en-us/azure/cosmos-db/mongodb/vcore/troubleshoot-common-issueshttps://learn.microsoft.com/en-us/azure/cosmos-db/how-to-configure-firewall?source=recommendationsIf these steps do not resolve the issue, could you please share the requested details via private message as it will help us conduct a more thorough investigation.
I hope this information helps. Please do let us know if you have any further queries.
-
Mahesh Kurva • 5,025 Reputation points • Microsoft External Staff • Moderator
2025-06-23T04:12:06.7566667+00:00 We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution, please do share that same with the community as it can be helpful to others. Otherwise, will respond with more details and we will try to help.
-
Venkatesh Rajagopal • 0 Reputation points
2025-06-23T19:44:46.0866667+00:00 Problem is not resolved. Sent an email to follow up
Thanks
-
Mahesh Kurva • 5,025 Reputation points • Microsoft External Staff • Moderator
2025-06-24T08:08:14.5966667+00:00 Thank you for providing the requested details in the private message. Please give us some time to look into this further. I will update you soon.
-
Mahesh Kurva • 5,025 Reputation points • Microsoft External Staff • Moderator
2025-06-26T06:57:17.0966667+00:00 We haven’t heard from you on the last response and was just checking back to see if you have a resolution yet. In case if you have any resolution, please do share that same with the community as it can be helpful to others. Otherwise, will respond with more details and we will try to help.
Sign in to comment