Skip to content

Commit

Permalink
Merge pull request #2542 from janegilring/hcibox_issue_2541
Browse files Browse the repository at this point in the history
  • Loading branch information
janegilring authored May 9, 2024
2 parents a7da53c + 0d93a15 commit 9491a38
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions azure_jumpstart_hcibox/scripts/preprovision.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,12 @@ azd env set JS_RDP_PORT $JS_RDP_PORT
# Attempt to retrieve provider id for Microsoft.AzureStackHCI
Write-Host "Attempting to retrieve Microsoft.AzureStackHCI provider id..."
$spnProviderId=$(az ad sp list --display-name "Microsoft.AzureStackHCI" --output json) | ConvertFrom-Json
if ($null -ne $spnProviderId.id) {
azd env set SPN_PROVIDER_ID -- $($spnProviderId.id)
else {
Write-Warning "Microsoft.AzureStackHCI provider id not found, aborting..."

Write-Host 'Consider the following options: 1) Request access from a tenant administrator to get read-permissions to service principals.
2) Ask a tenant administrator to run the command $(az ad sp list --display-name "Microsoft.AzureStackHCI" --output json) | ConvertFrom-Json and send you the ID from the output. You can then manually add that value to the AZD .env file: SPN_PROVIDER_ID="xxx" or use the Bicep-based deployment specifying spnProviderId="xxx" in the deployment parameter-file.' -ForegroundColor Yellow
throw "Microsoft.AzureStackHCI provider id not found"
}

########################################################################
Expand Down

0 comments on commit 9491a38

Please sign in to comment.