1. Prepare the environment
-
Install Azd version 1.11.0 or higher from Install Azd
-
Setup roles for your subscription
Make sure you have both
ContributorandUser Access Administratorroles to your target subscription.Go to your subscription page, select Access control (IAM), then click View my access button to see your role assignments.
- Role
Owneralready includes rolesContributorandUser Access Administrator, no role assignment required if you already have theOwnerrole. - Contact your subscription administrator on new role assignments.
- Role
- Login to Azd & Azure CLI
azd auth loginaz login
In case you are running this lab in a GitHub codespace, use
az login --use-device-code. Make sure login to your target subscription, or useaz account set -s <subscription-id>to switch the subscription. -
Collect your user info.
-
Get your user name
export USER_NAME=$(az account show --query user.name --output tsv) echo $USER_NAME -
Retrieve the user object id.
az ad signed-in-user show --query id --output tsvIf you see errors like
AADSTS530003: Your device is required to be managed to access this resource., please collect the id in a managed device.After you get your user object id, set the environment variables for later use.
export AAD_USER_ID=<user-object-id>
-