Skip to content

Commit

Permalink
Get the ADServicePrincipal id
Browse files Browse the repository at this point in the history
  • Loading branch information
brendankowitz committed Sep 19, 2024
1 parent 925dbc4 commit e32d851
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion build/jobs/provision-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ jobs:
if("${{ parameters.sql }}" -eq "false"){
Write-Host "Add DevOps MI permission to Cosmos databases"

$principalId = (Get-AzContext).Account.Id
$account = Get-AzContext
$principalId = (Get-AzADServicePrincipal -ApplicationId $account.Account.Id).Id

New-AzCosmosDBSqlRoleAssignment `
-AccountName $webAppName `
Expand Down
1 change: 1 addition & 0 deletions build/jobs/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
Write-Host "##vso[task.setvariable variable=AZURESUBSCRIPTION_TENANT_ID]$env:AZURESUBSCRIPTION_TENANT_ID"
Write-Host "##vso[task.setvariable variable=AZURESUBSCRIPTION_SERVICE_CONNECTION_ID]$env:AZURESUBSCRIPTION_SERVICE_CONNECTION_ID"
$appServiceName = '${{ parameters.appServiceName }}'
$appSettings = (Get-AzWebApp -ResourceGroupName $(ResourceGroupName) -Name $appServiceName).SiteConfig.AppSettings
$dataStoreResourceId = $appSettings | where {$_.Name -eq "FhirServer__ResourceManager__DataStoreResourceId"}
$dataStoreResourceId = $dataStoreResourceId[0].Value
Expand Down

0 comments on commit e32d851

Please sign in to comment.