Skip to content

Commit 0e37e00

Browse files
committed
fix issue Azure#11658
1 parent 41116fa commit 0e37e00

File tree

1 file changed

+3
-1
lines changed
  • sdk/core/azure-mgmt-core/azure/mgmt/core

1 file changed

+3
-1
lines changed

sdk/core/azure-mgmt-core/azure/mgmt/core/tools.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ def is_valid_resource_id(rid, exception_type=None):
204204
"""
205205
is_valid = False
206206
try:
207-
is_valid = rid and resource_id(**parse_resource_id(rid)).lower() == rid.lower()
207+
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)
208210
except KeyError:
209211
pass
210212
if not is_valid and exception_type:

0 commit comments

Comments
 (0)