diff --git a/scripts/get-full-app-info.sh b/scripts/get-full-app-info.sh index 610d6fe..a7fda3d 100755 --- a/scripts/get-full-app-info.sh +++ b/scripts/get-full-app-info.sh @@ -1,5 +1,28 @@ #!/usr/bin/env bash APP_NAME="$1" +if [[ -z "$APP_NAME" ]]; then + echo "Usage: $0 " + exit 1 +fi + APP_ID=$(az ad app list --display-name "$APP_NAME" --query "[0].appId" -o tsv) +if [[ -z "$APP_ID" ]]; then + echo "Error: Application '$APP_NAME' not found." + exit 1 +fi + +TENANT_ID=$(az account show --query tenantId -o tsv) +if [[ -z "$TENANT_ID" ]]; then + echo "Error: Failed to resolve tenantId from current Azure CLI context." + exit 1 +fi + az ad app show --id "$APP_ID" -o json +cat <