1. Prepare the environment

  1. Install Azd version 1.11.0 or higher from Install Azd

  2. Setup roles for your subscription

    Make sure you have both Contributor and User Access Administrator roles 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 Owner already includes roles Contributor and User Access Administrator, no role assignment required if you already have the Owner role.
    • Contact your subscription administrator on new role assignments.
  3. Login to Azd & Azure CLI
    • azd auth login
    • az 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 use az account set -s <subscription-id> to switch the subscription.

  4. 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 tsv
      

      If 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>