Skip to content

Azure Cloud Shell without terminal trouble

Run Azure CLI and the SBS installation scripts directly in your browser, without a local installation and with clear checks for tenant, subscription and permissions.

The easiest route: Cloud Shell in the Azure portal

Azure Cloud Shell is a terminal that runs directly in your browser. You are already signed in with your Azure account and Azure CLI (az) is preinstalled. For the Smarter Visitor Registration installation, we recommend Bash in Cloud Shell.

This page guides you through the two one-time Microsoft Entra steps: prepare-app-registration before the Marketplace deployment and grant-graph-permissions afterwards. See the installation guide for the complete sequence.

1

Before installing Visitor Registration

Start with the subscription, company-specific naming, quota and resource-provider preflight, including Microsoft.OperationalInsights and separate Bash check/register blocks. Review what the scripts change and when to redeploy or change region.

2

Open Cloud Shell

  1. Open portal.azure.com and switch to the customer tenant.
  2. In the black portal bar, select the Cloud Shell terminal icon. Alternatively, open shell.azure.com.
  3. Select Bash. The commands on this page are written for Bash.
  4. On first use, Azure may ask for a subscription and storage for your Cloud Shell files. Follow the wizard and wait for the prompt ending in $.

No local installation required

In Cloud Shell, you do not need to install Azure CLI or normally run az login. Your portal account is used automatically.

ChoiceRecommendation
BashRecommended for the commands and .sh scripts in this guide.
PowerShellAlso supported; use the supplied .ps1 scripts and the PowerShell examples below.
Local terminalUse only if Azure CLI is already installed and you are familiar with tenant switching, file paths and shell permissions.
3

Verify the tenant and subscription

Before every script, check which tenant and subscription Azure CLI is using. A subscription visible in the portal is not necessarily the active CLI subscription.

Show the current context
az account show \
  --query "{subscription:name, subscriptionId:id, tenant:tenantId, user:user.name}" \
  -o table
List available subscriptions and select the correct one
az account list \
  --query "[].{Name:name, Id:id, Tenant:tenantId, Default:isDefault}" \
  -o table

az account set --subscription "<subscription name or subscription ID>"

az account show \
  --query "{subscription:name, tenant:tenantId, user:user.name}" \
  -o table

Continue only when the context is correct

The tenant, subscription and user must belong to the customer or planned installation. Otherwise switch the portal directory or sign in explicitly with az login --tenant <tenant ID>, then select the subscription again.

Find your own Entra object ID
az ad signed-in-user show --query id -o tsv

This command returns the object ID of the signed-in user. Use it as the initial administrator only if that exact account will perform the initial setup. For another person, copy their object ID from the user profile in the Entra admin center.

4

Download the SBS scripts

Paste the complete block into Bash. It downloads both scripts to the current Cloud Shell directory and makes them executable.

Download both Bash scripts
curl -fsSL \
  https://www.smarterbusiness.at/downloads/smarter-visitor-registration/prepare-app-registration.sh \
  -o prepare-app-registration.sh

curl -fsSL \
  https://www.smarterbusiness.at/downloads/smarter-visitor-registration/grant-graph-permissions.sh \
  -o grant-graph-permissions.sh

chmod +x prepare-app-registration.sh grant-graph-permissions.sh
ls -l prepare-app-registration.sh grant-graph-permissions.sh

Where are my files?

Use pwd to show the current directory and ls -la to list its contents. If your Cloud Shell uses persistent storage, files in your home directory remain available in later sessions.

5

Before deployment: app registration

First choose the final web app name and deployment prefix on the Marketplace Basics step. Then run the preparation script with exactly the same values. You need at least Application Administrator or Cloud Application Administrator in the target tenant.

Example — replace the values with your planned names
./prepare-app-registration.sh \
  contoso-visitor-registration \
  visitorreg

Copy the client ID

The script finishes with App registration ready and prints the Client ID. Copy that ID to the Marketplace Identity and security step. Running the script again with the same values safely updates the existing registration.

6

After deployment: Graph permissions

When the Marketplace deployment has completed successfully, run the second script. This requires Privileged Role Administrator or Global Administrator.

Example — replace resource group, prefix and client ID
./grant-graph-permissions.sh \
  "rg-visitor-registration" \
  "visitorreg" \
  "11111111-2222-3333-4444-555555555555"

Expected result

The script reports assigned or already assigned for Group.Read.All and User.Read.All, followed by admin consent granted or updated. The permissions can take a few minutes to become effective.

7

Replace placeholders correctly

PlaceholderMeaning and example
<subscription name or subscription ID>The target from az account list. Do not copy the angle brackets.
<web-app-name>The globally unique name from Basics, for example contoso-visitor-registration.
<deployment-prefix>The Marketplace deployment prefix, for example visitorreg.
<resource-group>The Marketplace deployment resource group, for example rg-visitor-registration.
<client-id>The client ID printed by prepare-app-registration.
<tenant-id>The tenant ID from az account show; only needed for an explicit tenant switch.

Angle brackets are not command characters

Always replace the whole placeholder including < and >. For example, az account set --subscription "<subscription ID>" becomes az account set --subscription "12345678-…".

8

PowerShell alternative

If you prefer PowerShell in Cloud Shell, switch to PowerShell using the shell selector and download the .ps1 variants. Do not mix Bash and PowerShell syntax in the same input.

Download and run the PowerShell scripts
Invoke-WebRequest   -Uri "https://www.smarterbusiness.at/downloads/smarter-visitor-registration/prepare-app-registration.ps1"   -OutFile "prepare-app-registration.ps1"

Invoke-WebRequest   -Uri "https://www.smarterbusiness.at/downloads/smarter-visitor-registration/grant-graph-permissions.ps1"   -OutFile "grant-graph-permissions.ps1"

./prepare-app-registration.ps1   -WebAppName "contoso-visitor-registration"   -DeploymentName "visitorreg"

./grant-graph-permissions.ps1   -ResourceGroup "rg-visitor-registration"   -DeploymentName "visitorreg"   -ClientId "11111111-2222-3333-4444-555555555555"
9

Common errors

“az: command not found”

You are probably using a local terminal without Azure CLI. Open Azure Cloud Shell and select Bash; az is already installed there.

“The subscription … does not exist” or the subscription is missing

Run az account list -o table first. If the subscription is missing, you are usually in the wrong tenant or the permission was granted only recently. Switch the portal directory or restart Cloud Shell.

“Permission denied” when starting a .sh script

Run chmod +x prepare-app-registration.sh grant-graph-permissions.sh, then start the script with ./.

“No such file or directory”

Use pwd and ls -la to check the current directory. If necessary, download the script again with the download block.

“Authorization_RequestDenied” or “Insufficient privileges”

This is not a Bash error. The signed-in account lacks the required Entra role. App registration requires Application Administrator or Cloud Application Administrator; Graph roles and admin consent require Privileged Role Administrator or Global Administrator.

Cloud Shell ended because of inactivity

Open Cloud Shell again, verify the tenant and subscription once more, then change to the directory containing the scripts. Files in the home directory remain available when persistent Cloud Shell storage is used.

The script prints a client ID, but Marketplace rejects it

Check that the script and Marketplace are running in the same tenant and that the web app name and deployment prefix match. Use the application ID (client ID), not the object ID of the app registration.
10

Work safely and get help

  • Never send session secrets, passwords, access tokens or the output of az account get-access-token by email or chat.
  • Client IDs and tenant IDs are not passwords. Still redact usernames, subscription IDs and unrelated tenant data in screenshots.
  • Generate the session secret, for example with openssl rand -hex 32, and enter it only in the protected Marketplace fields.
  • When asking for help, send the command without secrets, the exact error message and the step at which it occurred.

Questions about this product?

Our support team is happy to help with any questions about Smarter Visitor Registration.