Skip to content

Commit f66d37c

Browse files
authored
fix role assignment when update feature store (#35751) (#35763)
1 parent e6f3023 commit f66d37c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/operations/_workspace_operations_base.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def callback(_: Any, deserialized: Any, args: Any) -> Workspace:
383383
):
384384
module_logger.info("updating feature store materialization identity role assignments..")
385385
template, param, resources_being_deployed = self._populate_feature_store_role_assignment_parameters(
386-
workspace, resource_group=resource_group, **kwargs
386+
workspace, resource_group=resource_group, location=existing_workspace.location, **kwargs
387387
)
388388

389389
arm_submit = ArmDeploymentExecutor(
@@ -780,7 +780,8 @@ def _populate_feature_store_role_assignment_parameters(
780780
_set_val(param["workspace_name"], workspace.name)
781781
resource_group = kwargs.get("resource_group", workspace.resource_group)
782782
_set_val(param["resource_group_name"], resource_group)
783-
_set_val(param["location"], workspace.location)
783+
location = kwargs.get("location", workspace.location)
784+
_set_val(param["location"], location)
784785

785786
update_workspace_role_assignment = kwargs.get("update_workspace_role_assignment", None)
786787
if update_workspace_role_assignment:

sdk/ml/azure-ai-ml/tests/workspace/unittests/test_workspace_operations_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,13 +500,14 @@ def test_populate_feature_store_role_assignments_paramaters(
500500
return_value=("random_id", True),
501501
)
502502
template, param, _ = mock_workspace_operation_base._populate_feature_store_role_assignment_parameters(
503-
workspace=FeatureStore(name="name", location="eastus2euap"),
503+
workspace=FeatureStore(name="name"),
504504
materialization_identity_id="/subscriptions/sub/resourcegroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity",
505505
offline_store_target="/subscriptions/sub/resourceGroups/rg/providers/Microsoft.Storage/storageAccounts/test_storage/blobServices/default/containers/offlinestore",
506506
online_store_target="/subscriptions/sub1/resourceGroups/mdctest/providers/Microsoft.Cache/Redis/onlinestore",
507507
update_workspace_role_assignment=True,
508508
update_offline_store_role_assignment=True,
509509
update_online_store_role_assignment=True,
510+
location="eastus2euap",
510511
)
511512

512513
assert template is not None

0 commit comments

Comments
 (0)