Skip to content

Commit dcc46a6

Browse files
authored
Merge branch 'feature/avm' into feature-avm-bk
2 parents a9391a2 + 282b9b3 commit dcc46a6

10 files changed

Lines changed: 53 additions & 411 deletions

.devcontainer/devcontainer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@
4141
"tamasfe.even-better-toml",
4242
"yzhang.markdown-all-in-one",
4343
"ms-azuretools.azure-dev",
44-
"ms-vscode.azurecli"
44+
"ms-vscode.azurecli",
45+
"ms-azuretools.vscode-bicep"
4546
]
4647
}
4748
},

azure.yaml

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -8,32 +8,21 @@ metadata:
88
name: content-processinge@1.0
99

1010
hooks:
11-
# preup:
12-
# windows:
13-
# shell: pwsh
14-
# run: ./scripts/set_conns_env_vars.ps1
15-
# interactive: true
16-
# continueOnError: false
17-
# posix:
18-
# shell: sh
19-
# run: sudo chmod u+r+x ./scripts/set_conns_env_vars.sh; ./scripts/set_conns_env_vars.sh
20-
# interactive: true
21-
# continueOnError: false
2211
preprovision:
2312
posix:
2413
shell: sh
25-
run: sudo chmod u+r+x ./infra/scripts/validate_model_deployment_quotas.sh; sudo chmod u+r+x .infra/scripts/validate_model_quota.sh; .infra/scripts/validate_model_deployment_quotas.sh --subscription $AZURE_SUBSCRIPTION_ID --location $AZURE_LOCATION --models-parameter "aiModelDeployments; timestamp=$(date +"%Y%m%d-%H%M%S"); logFile="azd_preprovision_$timestamp.log"; sed -i 's/\r$//' ./infra/scripts/docker-build.sh; ./infra/scripts/docker-build.sh "$AZURE_SUBSCRIPTION_ID" "$AZURE_ENV_NAME" "$AZURE_LOCATION" "$AZURE_RESOURCE_GROUP" "$USE_LOCAL_BUILD" 2>&1 | tee "$logFile"
14+
run: sudo chmod u+r+x ./infra/scripts/validate_model_deployment_quotas.sh; sudo chmod u+r+x ./infra/scripts/validate_model_quota.sh; .infra/scripts/validate_model_deployment_quotas.sh --subscription $AZURE_SUBSCRIPTION_ID --location $AZURE_LOCATION --models-parameter "aiModelDeployments; timestamp=$(date +"%Y%m%d-%H%M%S"); logFile="azd_preprovision_$timestamp.log"; sed -i 's/\r$//' ./infra/scripts/docker-build.sh; ./infra/scripts/docker-build.sh "$AZURE_SUBSCRIPTION_ID" "$AZURE_ENV_NAME" "$AZURE_LOCATION" "$AZURE_RESOURCE_GROUP" "$USE_LOCAL_BUILD" 2>&1 | tee "$logFile"
2615
windows:
2716
shell: pwsh
28-
run: ./infra/scripts/validate_model_deployment_quotas.ps1 -Subscription $env:AZURE_SUBSCRIPTION_ID -Location $env:AZURE_LOCATION -ModelsParameter "aiModelDeployments" ;$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"; $logFile = "azd_preprovision_$timestamp.log"; ./infra/scripts/docker-build.ps1 $env:AZURE_SUBSCRIPTION_ID $env:AZURE_ENV_NAME $env:AZURE_LOCATION $env:AZURE_RESOURCE_GROUP $env:USE_LOCAL_BUILD *>&1 | Tee-Object -FilePath $logFile
17+
run: ./infra/scripts/validate_model_deployment_quotas.ps1 -Subscription $env:AZURE_SUBSCRIPTION_ID -Location $env:AZURE_LOCATION -ModelsParameter "aiModelDeployments" ;$timestamp = Get-Date -Format "yyyyMMdd-HHmmss"; $logFile = "azd_preprovision_$timestamp.log"; Tee-Object -FilePath $logFile
2918
interactive: true
3019
continueOnError: false
3120
postprovision:
3221
posix:
3322
shell: sh
34-
run: sudo chmod u+r+x ./infra/scripts/validate_model_deployment_quotas.sh; sudo chmod u+r+x ./infra/scripts/validate_model_quota.sh; ./infra/scripts/validate_model_deployment_quotas.sh --subscription $AZURE_SUBSCRIPTION_ID --location $AZURE_LOCATION --models-parameter "aiModelDeployments"; sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; ./infra/scripts/post_deployment.sh
23+
run: sed -i 's/\r$//' ./infra/scripts/post_deployment.sh; ./infra/scripts/post_deployment.sh
3524
interactive: true
3625
windows:
3726
shell: pwsh
38-
run: ./infra/scripts/post_deployment.ps1;./scripts/validate_model_deployment_quotas.ps1 -Subscription $env:AZURE_SUBSCRIPTION_ID -Location $env:AZURE_LOCATION -ModelsParameter "aiModelDeployments"
27+
run: ./infra/scripts/post_deployment.ps1
3928
interactive: true

infra/ai-resources.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"aiModelDeployments": [
3+
{
4+
"name": "GPT-4o",
5+
"model": {
6+
"name": "gpt-4o",
7+
"format": "openai"
8+
},
9+
"sku": {
10+
"name": "GlobalStandard",
11+
"capacity": 100
12+
}
13+
}
14+
]
15+
}

infra/main.bicep

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -106,17 +106,27 @@ module avmManagedIdentity './modules/managed-identity.bicep' = {
106106
}
107107

108108
// Assign Owner role to the managed identity in the resource group
109-
module bicepOwnerRoleAssignment 'modules/role_assignment.bicep' = {
110-
name: format(deployment_param.resource_name_format_string, 'rbac-owner')
109+
module avmRoleAssignment 'br/public:avm/ptn/authorization/resource-role-assignment:0.1.2' = {
110+
name: format(deployment_param.resource_name_format_string, 'role-assignment-owner')
111111
params: {
112-
managedIdentityResourceId: avmManagedIdentity.outputs.resourceId
113-
managedIdentityPrincipalId: avmManagedIdentity.outputs.principalId
114-
roleDefinitionId: subscriptionResourceId(
115-
'Microsoft.Authorization/roleDefinitions',
116-
'8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
117-
) // Built-in role 'Owner'
112+
resourceId: avmManagedIdentity.outputs.resourceId
113+
principalId: avmManagedIdentity.outputs.principalId
114+
roleDefinitionId: '8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
118115
}
119116
}
117+
118+
// Assign Owner role to the managed identity in the resource group
119+
// module bicepOwnerRoleAssignment 'modules/role_assignment.bicep' = {
120+
// name: format(deployment_param.resource_name_format_string, 'rbac-owner')
121+
// params: {
122+
// managedIdentityResourceId: avmManagedIdentity.outputs.resourceId
123+
// managedIdentityPrincipalId: avmManagedIdentity.outputs.principalId
124+
// roleDefinitionId: subscriptionResourceId(
125+
// 'Microsoft.Authorization/roleDefinitions',
126+
// '8e3af657-a8ff-443c-a75c-2fe8c4bcb635'
127+
// ) // Built-in role 'Owner'
128+
// }
129+
// }
120130
// module managedIdentityModule 'deploy_managed_identity.bicep' = {
121131
// name: 'deploy_managed_identity'
122132
// params: {

infra/scripts/set_conns_env_vars.ps1

Lines changed: 0 additions & 206 deletions
This file was deleted.

0 commit comments

Comments
 (0)