> az login
> az account set --subscription sandbox
> az group create --name rg-rebug --location northeurope
> az deployment group create -g rg-rebug --template-file .\main.bicep --confirm-with-what-if --parameters appName=Rebug firstDeploy=true
Assign the system identity of the SQL Server the Azure AD role Directory Readers
:
https://learn.microsoft.com/en-us/azure/active-directory/roles/manage-roles-portal#azure-portal
> az deployment group create -g rg-rebug --template-file .\main.bicep --confirm-with-what-if --parameters appName=Rebug
Assign yourself as SQL Server Admin and execute these queries against the database:
CREATE USER [<appName>] FROM EXTERNAL PROVIDER
EXEC sp_addrolemember N'db_datawriter', [<appName>]
EXEC sp_addrolemember N'db_datareader', [<appName>]
Right-click on the project in Visual Studio and click "Publish...". Follow the instructions to deploy to the newly created app service.