From fd62eea6396feac1fd3c0cdea0a372dc940eb7ea Mon Sep 17 00:00:00 2001 From: SANTHOSH B <63607175+santhoshb-msft@users.noreply.github.com> Date: Fri, 29 Mar 2024 10:42:52 -0700 Subject: [PATCH] updated exec perm for mi (#683) --- deployment/Deploy.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deployment/Deploy.ps1 b/deployment/Deploy.ps1 index 8cb15ec0..1d5b0190 100644 --- a/deployment/Deploy.ps1 +++ b/deployment/Deploy.ps1 @@ -405,7 +405,7 @@ $dbaccesstoken = (Get-AzAccessToken -ResourceUrl https://database.windows.net).T Invoke-Sqlcmd -InputFile ./script.sql -ServerInstance $ServerUri -database $SQLDatabaseName -AccessToken $dbaccesstoken Write-host " ➡️ Execute SQL script to Add WebApps" -$AddAppsIdsToDB = "CREATE USER [$WebAppNameAdmin] FROM EXTERNAL PROVIDER;ALTER ROLE db_datareader ADD MEMBER [$WebAppNameAdmin];ALTER ROLE db_datawriter ADD MEMBER [$WebAppNameAdmin];CREATE USER [$WebAppNamePortal] FROM EXTERNAL PROVIDER;ALTER ROLE db_datareader ADD MEMBER [$WebAppNamePortal];ALTER ROLE db_datawriter ADD MEMBER [$WebAppNamePortal];" +$AddAppsIdsToDB = "CREATE USER [$WebAppNameAdmin] FROM EXTERNAL PROVIDER;ALTER ROLE db_datareader ADD MEMBER [$WebAppNameAdmin];ALTER ROLE db_datawriter ADD MEMBER [$WebAppNameAdmin]; GRANT EXEC TO [$WebAppNameAdmin]; CREATE USER [$WebAppNamePortal] FROM EXTERNAL PROVIDER;ALTER ROLE db_datareader ADD MEMBER [$WebAppNamePortal];ALTER ROLE db_datawriter ADD MEMBER [$WebAppNamePortal]; GRANT EXEC TO [$WebAppNamePortal];" Invoke-Sqlcmd -Query $AddAppsIdsToDB -ServerInstance $ServerUri -database $SQLDatabaseName -AccessToken $dbaccesstoken Write-host " 🔵 Deploy Code to Admin Portal"