We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 41116fa commit 0e37e00Copy full SHA for 0e37e00
sdk/core/azure-mgmt-core/azure/mgmt/core/tools.py
@@ -204,7 +204,9 @@ def is_valid_resource_id(rid, exception_type=None):
204
"""
205
is_valid = False
206
try:
207
- is_valid = rid and resource_id(**parse_resource_id(rid)).lower() == rid.lower()
+ parsed_id = parse_resource_id(rid)
208
+ is_valid = rid and resource_id(**parsed_id).lower() == rid.lower() and all(
209
+ len(v) > 0 for k, v in parsed_id.items() if rid.find('/{}/'.format(k)) >= 0)
210
except KeyError:
211
pass
212
if not is_valid and exception_type:
0 commit comments