Script to invite externals to Azure Machine Learning Workspace governed by RBAC

Some time ago I helped Microsoft to facilitate an AI workshop for a university in Denmark, part of the day included hands on labs.

Some of  the Labs was to work in the “new” Machine Learning workspace (evolution of the Machine learning studio)

The workspace concept is simlar to the Databricks workspace in the sense of sharing resources, code and manage access and security.

Azure Machine Learning Workspace taxonomy
Azure Databricks Overview

RBAC Setup

For the Labs to run more smoothly and to get the co-working experiences, we prepped a Machine Learning workspace, created a security group and assigned the contributor role to the security group and added that to the resource group of the ML workspace. We assigned contributor since this is a lab environment, read more about the users and roles with RBAC here.

Create Security Group
Add Role Assignment (Resource group ->access control)

Quick script to invite member

We did not know upfront how many or who would attend this workshop so we needed a quick solution on how to invite the users ad-hoc to the workspace.

This small script will:

  • Prompt for email (enter email)
  • Add/invite user to the Azure AD
  • Add user to the security group
  • Send out invite mail with link to –

Make sure to run the script in the context of the Subscription and change the objectID of the security group to the intended security group.

Find the object ID for the security group

Invitation mail

The script will send out the invitation mail that routes you to

Here you choose the directory, subscription and ML workspace. If the invitation is sent to an account that has rights in other directories and subscription those will show in the drop down.

And when “get started” has been clicked, the workspace is available and users can start collaborating.

Learn More

Join us online May 19th to learn more about Azure Machine Learning Workspaces.

One thought on “Script to invite externals to Azure Machine Learning Workspace governed by RBAC

Leave a Comment