-
Notifications
You must be signed in to change notification settings - Fork 11
Fix/postprovision #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feature/VPNDeployment
Are you sure you want to change the base?
Changes from all commits
a8b1600
9f143a4
43464d2
1e97b9a
13e980d
4108128
1e09735
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -55,10 +55,12 @@ For a complete overview of the Healthcare AI Model Evaluator platform, refer to | |||||||||||||||||||||||||||||
| ## Deployment | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| > [!IMPORTANT] | ||||||||||||||||||||||||||||||
| > See [DEPLOYMENT.md](./DEPLOYMENT.md) for complete deployment guide, configuration options, and troubleshooting. | ||||||||||||||||||||||||||||||
| > See [DEPLOYMENT.md](./DEPLOYMENT.md) for complete deployment guide, pre-requisites, configuration options, and troubleshooting. | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Quick start | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Before starting with deployment, make sure you go through the [deployment pre-requisites](./DEPLOYMENT.md#pre-requisites). | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| Initialize and deploy the complete Healthcare AI Model Evaluator platform using Azure Developer CLI (azd). | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
|
|
@@ -69,9 +71,14 @@ azd init -t microsoft/healthcare-ai-model-evaluator | |||||||||||||||||||||||||||||
| azd up | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| To initialize the project targetting a specific branch, use the `--branch` flag: | ||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| azd init -t microsoft/healthcare-ai-model-evaluator --branch feature-branch | ||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### First-time Setup | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| After deployment, bootstrap your first admin user by setting these azd environment values and re-running deployment: | ||||||||||||||||||||||||||||||
| To bootstrap your first admin user by setting these azd environment values and re-running deployment: | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| azd env set ROOT_ADMIN_EMAIL "admin@example.com" | ||||||||||||||||||||||||||||||
|
|
@@ -94,9 +101,15 @@ npm run dev | |||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| ### Backend Setup | ||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||
| export AZURE_STORAGE_ENDPOINT=[Your Storage Account blob endpoint] | ||||||||||||||||||||||||||||||
| export COSMOSDB_ENDPOINT=[Your Cosmos DB account endpoint] | ||||||||||||||||||||||||||||||
| export COSMOSDB_DATABASE=[Your Cosmos DB database name] | ||||||||||||||||||||||||||||||
| # For Linux/macOS | ||||||||||||||||||||||||||||||
| export AZURE_STORAGE_CONNECTION_STRING="Your Storage Account connection string" | ||||||||||||||||||||||||||||||
| export COSMOSDB_CONNECTION_STRING="Your mongodb connection string" | ||||||||||||||||||||||||||||||
| export COSMOSDB_ENDPOINT="Your mongodb endpoint" | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| # For PowerShell | ||||||||||||||||||||||||||||||
| $env:AZURE_STORAGE_CONNECTION_STRING="Your Storage Account connection string" | ||||||||||||||||||||||||||||||
| $env:COSMOSDB_CONNECTION_STRING="Your mongodb connection string" | ||||||||||||||||||||||||||||||
| $env:COSMOSDB_ENDPOINT="Your mongodb endpoint" | ||||||||||||||||||||||||||||||
|
Comment on lines
+106
to
+112
|
||||||||||||||||||||||||||||||
| export COSMOSDB_CONNECTION_STRING="Your mongodb connection string" | |
| export COSMOSDB_ENDPOINT="Your mongodb endpoint" | |
| # For PowerShell | |
| $env:AZURE_STORAGE_CONNECTION_STRING="Your Storage Account connection string" | |
| $env:COSMOSDB_CONNECTION_STRING="Your mongodb connection string" | |
| $env:COSMOSDB_ENDPOINT="Your mongodb endpoint" | |
| export COSMOSDB_CONNECTION_STRING="Your Cosmos DB connection string" | |
| export COSMOSDB_ENDPOINT="Your Cosmos DB endpoint" | |
| # For PowerShell | |
| $env:AZURE_STORAGE_CONNECTION_STRING="Your Storage Account connection string" | |
| $env:COSMOSDB_CONNECTION_STRING="Your Cosmos DB connection string" | |
| $env:COSMOSDB_ENDPOINT="Your Cosmos DB endpoint" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -65,19 +65,25 @@ if ($clientId -and $clientId -ne "placeholder-will-be-updated-by-script" -and $c | |||||
| if ($principalId -and $principalId -ne "null") { | ||||||
| Write-Host "Container App managed identity principal ID: $principalId" | ||||||
|
|
||||||
| # Assign Cosmos DB role | ||||||
| # Assign Cosmos DB SQL data-plane role (Built-in Data Contributor) | ||||||
| # This is required for reading/writing data via managed identity | ||||||
| # Built-in role IDs: 00000000-0000-0000-0000-000000000001 (Reader), 00000000-0000-0000-0000-000000000002 (Contributor) | ||||||
| $cosmosAccountName = $env:COSMOS_ACCOUNT_NAME | ||||||
| if ($cosmosAccountName) { | ||||||
| Write-Host "Assigning Cosmos DB role to Container App managed identity..." | ||||||
| $cosmosRoleId = "5bd9cd88-fe45-4216-938b-f97437e15450" # Cosmos DB Account Reader Writer | ||||||
| az cosmosdb sql role assignment create ` | ||||||
| --account-name $cosmosAccountName ` | ||||||
| --resource-group $resourceGroupName ` | ||||||
| --principal-id $principalId ` | ||||||
| --role-definition-id $cosmosRoleId ` | ||||||
| --scope "/subscriptions/$($env:AZURE_SUBSCRIPTION_ID)/resourceGroups/$resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/$cosmosAccountName" ` | ||||||
| --output none 2>$null || Write-Host "Role assignment may already exist" | ||||||
| Write-Host "✅ Cosmos DB role assignment completed" | ||||||
| Write-Host "Assigning Cosmos DB SQL data-plane role to Container App managed identity..." | ||||||
| $cosmosAccountId = az cosmosdb show --name $cosmosAccountName --resource-group $resourceGroupName --query "id" -o tsv 2>$null | ||||||
| if ($cosmosAccountId) { | ||||||
| az cosmosdb sql role assignment create ` | ||||||
| --account-name $cosmosAccountName ` | ||||||
| --resource-group $resourceGroupName ` | ||||||
| --principal-id $principalId ` | ||||||
| --role-definition-id "$cosmosAccountId/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" ` | ||||||
| --scope $cosmosAccountId ` | ||||||
|
||||||
| --scope $cosmosAccountId ` | |
| --scope "/" ` |
Copilot
AI
Feb 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The --scope parameter should be "/" (root of the Cosmos account) instead of the full Azure resource ID. The Azure CLI expects a relative scope within the Cosmos account, not the full resource ID. This is consistent with the bicep template (infra/modules/cosmos.bicep:124) and the examples in README.md:143 and DEPLOYMENT.md:333 which all use --scope "/". The role assignment may fail or behave unexpectedly with the full resource ID as scope.
| --scope $cosmosAccountId ` | |
| --scope "/" ` |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -203,17 +203,24 @@ PRINCIPAL_ID=$(az containerapp show --name "$CONTAINER_APP_NAME" --resource-grou | |||||
| if [ -n "$PRINCIPAL_ID" ] && [ "$PRINCIPAL_ID" != "null" ]; then | ||||||
| echo "Container App managed identity principal ID: $PRINCIPAL_ID" | ||||||
|
|
||||||
| # Assign Cosmos DB role | ||||||
| # Assign Cosmos DB SQL data-plane role (Built-in Data Contributor) | ||||||
| # This is required for reading/writing data via managed identity | ||||||
| # Built-in role IDs: 00000000-0000-0000-0000-000000000001 (Reader), 00000000-0000-0000-0000-000000000002 (Contributor) | ||||||
| if [ -n "$COSMOS_ACCOUNT_NAME" ]; then | ||||||
| echo "Assigning Cosmos DB role to Container App managed identity..." | ||||||
| az cosmosdb sql role assignment create \ | ||||||
| --account-name "$COSMOS_ACCOUNT_NAME" \ | ||||||
| --resource-group "$RESOURCE_GROUP_NAME" \ | ||||||
| --principal-id "$PRINCIPAL_ID" \ | ||||||
| --role-definition-id "5bd9cd88-fe45-4216-938b-f97437e15450" \ | ||||||
| --scope "/subscriptions/$AZURE_SUBSCRIPTION_ID/resourceGroups/$RESOURCE_GROUP_NAME/providers/Microsoft.DocumentDB/databaseAccounts/$COSMOS_ACCOUNT_NAME" \ | ||||||
| --output none 2>/dev/null || echo "Role assignment may already exist" | ||||||
| echo "✅ Cosmos DB role assignment completed" | ||||||
| echo "Assigning Cosmos DB SQL data-plane role to Container App managed identity..." | ||||||
| COSMOS_ACCOUNT_ID=$(az cosmosdb show --name "$COSMOS_ACCOUNT_NAME" --resource-group "$RESOURCE_GROUP_NAME" --query "id" -o tsv 2>/dev/null || echo "") | ||||||
| if [ -n "$COSMOS_ACCOUNT_ID" ]; then | ||||||
| az cosmosdb sql role assignment create \ | ||||||
| --account-name "$COSMOS_ACCOUNT_NAME" \ | ||||||
| --resource-group "$RESOURCE_GROUP_NAME" \ | ||||||
| --principal-id "$PRINCIPAL_ID" \ | ||||||
| --role-definition-id "${COSMOS_ACCOUNT_ID}/sqlRoleDefinitions/00000000-0000-0000-0000-000000000002" \ | ||||||
| --scope "$COSMOS_ACCOUNT_ID" \ | ||||||
|
||||||
| --scope "$COSMOS_ACCOUNT_ID" \ | |
| --scope "/" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misspelling: "targetting" should be "targeting" (one 't').