question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to Add Network Rule to CosmosDb

See original GitHub issue

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name az cosmosdb network-rule add

Errors:

'NoneType' object has no attribute 'virtual_network_rules'
Traceback (most recent call last):
python3.8/site-packages/knack/cli.py, ln 215, in invoke
    cmd_result = self.invocation.execute(args)
cli/core/commands/__init__.py, ln 654, in execute
    raise ex
cli/core/commands/__init__.py, ln 718, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
cli/core/commands/__init__.py, ln 711, in _run_job
    six.reraise(*sys.exc_info())
...
cli/core/commands/__init__.py, ln 325, in __call__
    return self.handler(*args, **kwargs)
azure/cli/core/__init__.py, ln 545, in default_command_handler
    return op(**command_args)
cli/command_modules/cosmosdb/custom.py, ln 955, in cli_cosmosdb_network_rule_add
    for rule in existing.virtual_network_rules:
AttributeError: 'NoneType' object has no attribute 'virtual_network_rules'

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • az cosmosdb network-rule add --name {} --subnet {} -g {}

Expected Behavior

Network rule for the vnet added successfully

Environment Summary

macOS-10.15.4-x86_64-i386-64bit
Python 3.8.3
Installer: HOMEBREW

azure-cli 2.7.0

Extensions:
image-copy-extension 0.2.1

Additional Context

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
shurdcommented, Jul 14, 2020

We have updated the swagger so that the SDK will provide an error message when the account does not exist. This change will be in the next SDK release and then can be applied to the CLI. Target is middle of August release.

0reactions
MehaKaushikcommented, Sep 23, 2020

As a part of S175(https://github.com/Azure/azure-powershell/milestone/109), a CosmosDB was updated. @sireza please verify if your issue is resolved now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure IP firewall in Azure Cosmos DB - Microsoft Learn
To set the IP access control policy in the Azure portal, go to the Azure Cosmos DB account page and select Firewall and...
Read more >
When start Azure cosmos db emulator It is show Unable to ...
First it is shows 8081 already running. I changed the port issue resolved. But it showing Unable to add firewall rule settings. Please...
Read more >
Restrict Default Network Access for Azure Cosmos DB Accounts
Ensure that your Microsoft Azure Cosmos DB accounts are configured to deny access to traffic from all networks, including the public Internet.
Read more >
Azure Cosmos DB accounts should have firewall rules
How to create a network security group with security rules: https://docs.microsoft.com/azure/virtual-network/tutorial-filter-network-traffic How to deploy ...
Read more >
Securely connecting to Azure Cosmos DB using ... - YouTube
00:13:52 - A Virtual Machine in the same Virtual Network 00:17:08 ... configuration 00:37:07 - Adding the security features developers need ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found