Last active
October 7, 2022 18:12
-
-
Save pjirsa/774e2d80ce6d161db45d60893b0a39f3 to your computer and use it in GitHub Desktop.
Create Service Principal for RBAC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$spnName = Read-Host -Prompt "Enter new FHIR SPN name" | |
$subId = Read-Host -Prompt "Enter Azure Subscription Id" | |
$rgName = Read-Host -Prompt "Enter resource group name of FHIR API" | |
$fhirName = Read-Host -Prompt "Enter name of FHIR API resource (i.e. myfhirapi)" | |
az login | |
$spn = az ad sp create-for-rbac -n $spnName | convertfrom-json | |
az role assignment create --role "FHIR Data Reader" --assignee $spn.appId ` | |
--scope "/subscriptions/$subId/resourceGroups/$rgName/providers/Microsoft.HealthcareApis/services/$fhirName" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment