diff --git a/.github/workflows/run-setup.yml b/.github/workflows/run-setup.yml new file mode 100644 index 000000000..f045900a1 --- /dev/null +++ b/.github/workflows/run-setup.yml @@ -0,0 +1,135 @@ +name: Run Setup + +on: + push: + branches: [main] + paths: + - infrastructure/infrastructure-setup-bicep/** + pull_request: + branches: [main] + paths: + - infrastructure/infrastructure-setup-bicep/** + workflow_dispatch: + +permissions: + contents: write + +jobs: + run-setup: + runs-on: ubuntu-latest + + steps: + - name: Checkout source branch + uses: actions/checkout@v3 + with: + # PR: checks out the PR branch, Push: checks out main, Dispatch: checks out default branch + ref: ${{ github.head_ref || github.ref_name }} + fetch-depth: 0 + + - name: Install Bicep + run: | + INSTALL_PATH="$RUNNER_TEMP/bicep" + BICEP_PATH="$RUNNER_TEMP/bicep/bicep" + mkdir -p "$INSTALL_PATH" + curl -sLo bicep https://github.com/Azure/bicep/releases/latest/download/bicep-linux-x64 + chmod +x ./bicep + sudo mv ./bicep "$INSTALL_PATH" + echo "BICEP_PATH=$BICEP_PATH" >> $GITHUB_ENV + $BICEP_PATH --version + + - name: Determine changed main.bicep files + id: changes + run: | + set -e + cd "$GITHUB_WORKSPACE" + + EVENT="${{ github.event_name }}" + echo "Event: $EVENT" + + if [ "$EVENT" = "pull_request" ]; then + BASE="${{ github.event.pull_request.base.sha }}" + HEAD="${{ github.event.pull_request.head.sha }}" + elif [ "$EVENT" = "push" ]; then + BASE="${{ github.event.before }}" + HEAD="${{ github.sha }}" + else + # workflow_dispatch: use last commit as best-effort + BASE="$(git rev-parse HEAD~1 || echo '')" + HEAD="$(git rev-parse HEAD)" + fi + + echo "Diff range: ${BASE}..${HEAD}" + + # Only rebuild when main.bicep changes + if [ -n "$BASE" ]; then + MODIFIED=$(git diff --name-only "$BASE" "$HEAD" \ + | grep -E "^infrastructure/infrastructure-setup-bicep/.*/main\.bicep$" || true) + else + MODIFIED=$(git show --name-only --pretty="" -1 \ + | grep -E "^infrastructure/infrastructure-setup-bicep/.*/main\.bicep$" || true) + fi + + if [ -z "$MODIFIED" ]; then + echo "No relevant Bicep changes detected." + echo "files=" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "Changed main.bicep files:" + echo "$MODIFIED" + + # Output as newline-delimited list + { + echo "files<> $GITHUB_OUTPUT + + - name: Build changed Bicep files -> azuredeploy.json + if: steps.changes.outputs.files != '' + run: | + set -e + cd "$GITHUB_WORKSPACE" + + while IFS= read -r BICEP_FILE; do + OUTFILE="$(dirname "$BICEP_FILE")/azuredeploy.json" + echo "Building: $BICEP_FILE -> $OUTFILE" + $BICEP_PATH build "$BICEP_FILE" --outfile "$OUTFILE" + done <<< "${{ steps.changes.outputs.files }}" + + - name: Commit + push changes back to branch (PR) or main (push) + if: always() + run: | + set -e + cd "$GITHUB_WORKSPACE" + + git config --global user.email "foundry-samples@noreply.github.com" + git config --global user.name "foundry-samples automation" + + git add -A + + if git diff-index --quiet HEAD --; then + echo "No changes to commit." + exit 0 + fi + + git commit -m "Automatic fixes" + + EVENT="${{ github.event_name }}" + + # If PR is from a fork, pushing will be rejected. Detect and skip. + if [ "$EVENT" = "pull_request" ]; then + if [ "${{ github.event.pull_request.head.repo.full_name }}" != "${{ github.repository }}" ]; then + echo "PR is from a fork; cannot push changes back to fork branch. Skipping push." + exit 0 + fi + BRANCH="${{ github.head_ref }}" + echo "Pushing fixes to PR branch: $BRANCH" + git push origin "HEAD:refs/heads/$BRANCH" + exit 0 + fi + + # push / workflow_dispatch + BRANCH="${{ github.ref_name }}" + echo "Pushing fixes to branch: $BRANCH" + git push origin "HEAD:refs/heads/$BRANCH" \ No newline at end of file diff --git a/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/azuredeploy.json b/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/azuredeploy.json index 460001bba..fd1247d0f 100644 --- a/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/azuredeploy.json +++ b/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/azuredeploy.json @@ -5,13 +5,13 @@ "_generator": { "name": "bicep", "version": "0.39.26.7824", - "templateHash": "3024624923779287280" + "templateHash": "16616047834738415823" } }, "parameters": { "location": { "type": "string", - "defaultValue": "eastus2", + "defaultValue": "eastus", "allowedValues": [ "westus", "eastus", @@ -50,7 +50,7 @@ }, "modelName": { "type": "string", - "defaultValue": "gpt-4o", + "defaultValue": "gpt-4.1", "metadata": { "description": "The name of the model you want to deploy" } @@ -64,7 +64,7 @@ }, "modelVersion": { "type": "string", - "defaultValue": "2024-11-20", + "defaultValue": "2025-04-14", "metadata": { "description": "The version of your model" } diff --git a/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/main.bicep b/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/main.bicep index 5f4312314..05c1d593d 100644 --- a/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/main.bicep @@ -30,18 +30,18 @@ Standard Setup Network Secured Steps for main.bicep 'switzerlandnorth' 'norwayeast' ]) -param location string = 'eastus2' +param location string = 'eastus' @description('Name for your AI Services resource.') param aiServices string = 'aiservices' // Model deployment parameters @description('The name of the model you want to deploy') -param modelName string = 'gpt-4o' +param modelName string = 'gpt-4.1' @description('The provider of your model') param modelFormat string = 'OpenAI' @description('The version of your model') -param modelVersion string = '2024-11-20' +param modelVersion string = '2025-04-14' @description('The sku of your model deployment') param modelSkuName string = 'GlobalStandard' @description('The tokens per minute (TPM) of your model deployment') diff --git a/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep b/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep index a196cf80e..bfac1da34 100644 --- a/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep +++ b/infrastructure/infrastructure-setup-bicep/15-private-network-standard-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep @@ -19,7 +19,7 @@ var roleDefinitionId = resourceId( '00000000-0000-0000-0000-000000000002' ) -var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' +var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}/dbs/enterprise_memory' resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { parent: cosmosAccount diff --git a/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/azuredeploy.json b/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/azuredeploy.json index 04447a3ed..3e10f19fa 100644 --- a/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/azuredeploy.json +++ b/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/azuredeploy.json @@ -5,13 +5,13 @@ "_generator": { "name": "bicep", "version": "0.39.26.7824", - "templateHash": "12031247753870237603" + "templateHash": "13929636312670904506" } }, "parameters": { "location": { "type": "string", - "defaultValue": "eastus2", + "defaultValue": "eastus", "allowedValues": [ "westus", "eastus", @@ -50,7 +50,7 @@ }, "modelName": { "type": "string", - "defaultValue": "gpt-4o", + "defaultValue": "gpt-4.1", "metadata": { "description": "The name of the model you want to deploy" } @@ -64,7 +64,7 @@ }, "modelVersion": { "type": "string", - "defaultValue": "2024-11-20", + "defaultValue": "2025-04-14", "metadata": { "description": "The version of your model" } diff --git a/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/main.bicep b/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/main.bicep index 4d2231729..d98370eb6 100644 --- a/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/main.bicep @@ -30,18 +30,18 @@ Standard Setup Network Secured Steps for main.bicep 'switzerlandnorth' 'norwayeast' ]) -param location string = 'eastus2' +param location string = 'eastus' @description('Name for your AI Services resource.') param aiServices string = 'aiservices' // Model deployment parameters @description('The name of the model you want to deploy') -param modelName string = 'gpt-4o' +param modelName string = 'gpt-4.1' @description('The provider of your model') param modelFormat string = 'OpenAI' @description('The version of your model') -param modelVersion string = '2024-11-20' +param modelVersion string = '2025-04-14' @description('The sku of your model deployment') param modelSkuName string = 'GlobalStandard' @description('The tokens per minute (TPM) of your model deployment') diff --git a/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/cosmos-container-role-assignments.bicep b/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/cosmos-container-role-assignments.bicep index a196cf80e..bfac1da34 100644 --- a/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/cosmos-container-role-assignments.bicep +++ b/infrastructure/infrastructure-setup-bicep/16-private-network-standard-agent-apim-setup-preview/modules-network-secured/cosmos-container-role-assignments.bicep @@ -19,7 +19,7 @@ var roleDefinitionId = resourceId( '00000000-0000-0000-0000-000000000002' ) -var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' +var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}/dbs/enterprise_memory' resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { parent: cosmosAccount diff --git a/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/azuredeploy.json b/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/azuredeploy.json index b1705fb17..96525e295 100644 --- a/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/azuredeploy.json +++ b/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/azuredeploy.json @@ -5,13 +5,13 @@ "_generator": { "name": "bicep", "version": "0.39.26.7824", - "templateHash": "290789416224749131" + "templateHash": "9271946558272429054" } }, "parameters": { "location": { "type": "string", - "defaultValue": "eastus2", + "defaultValue": "eastus", "allowedValues": [ "westus", "eastus", @@ -50,7 +50,7 @@ }, "modelName": { "type": "string", - "defaultValue": "gpt-4o", + "defaultValue": "gpt-4.1", "metadata": { "description": "The name of the model you want to deploy" } @@ -64,7 +64,7 @@ }, "modelVersion": { "type": "string", - "defaultValue": "2024-11-20", + "defaultValue": "2025-04-14", "metadata": { "description": "The version of your model" } diff --git a/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/main.bicep b/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/main.bicep index 0045ed900..212c5f554 100644 --- a/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/main.bicep @@ -30,18 +30,18 @@ Standard Setup Network Secured Steps for main.bicep 'switzerlandnorth' 'norwayeast' ]) -param location string = 'eastus2' +param location string = 'eastus' @description('Name for your AI Services resource.') param aiServices string = 'aiservices' // Model deployment parameters @description('The name of the model you want to deploy') -param modelName string = 'gpt-4o' +param modelName string = 'gpt-4.1' @description('The provider of your model') param modelFormat string = 'OpenAI' @description('The version of your model') -param modelVersion string = '2024-11-20' +param modelVersion string = '2025-04-14' @description('The sku of your model deployment') param modelSkuName string = 'GlobalStandard' @description('The tokens per minute (TPM) of your model deployment') diff --git a/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep b/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep index a196cf80e..bfac1da34 100644 --- a/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep +++ b/infrastructure/infrastructure-setup-bicep/17-private-network-standard-user-assigned-identity-agent-setup/modules-network-secured/cosmos-container-role-assignments.bicep @@ -19,7 +19,7 @@ var roleDefinitionId = resourceId( '00000000-0000-0000-0000-000000000002' ) -var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' +var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}/dbs/enterprise_memory' resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { parent: cosmosAccount diff --git a/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.json b/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/azuredeploy.json similarity index 99% rename from infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.json rename to infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/azuredeploy.json index a4ece07e9..80fece3fc 100644 --- a/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.json +++ b/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/azuredeploy.json @@ -5,13 +5,13 @@ "_generator": { "name": "bicep", "version": "0.39.26.7824", - "templateHash": "9028717141391138763" + "templateHash": "6166861745321957187" } }, "parameters": { "location": { "type": "string", - "defaultValue": "eastus2", + "defaultValue": "eastus", "metadata": { "description": "The region to deploy your AI Services resource and project" } diff --git a/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.bicep b/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.bicep index d5a49d44d..9bfa9d05f 100644 --- a/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/main.bicep @@ -1,7 +1,7 @@ // Standard agent setup @description('The region to deploy your AI Services resource and project') -param location string = 'eastus2' +param location string = 'eastus' @description('Name for your AI Services resource.') param aiFoundryName string = 'aifstdcmk4' diff --git a/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/cosmos-container-role-assignments.bicep b/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/cosmos-container-role-assignments.bicep index 83f0a1716..993be3770 100644 --- a/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/cosmos-container-role-assignments.bicep +++ b/infrastructure/infrastructure-setup-bicep/31-customer-managed-keys-standard-agent/modules-standard/cosmos-container-role-assignments.bicep @@ -17,7 +17,7 @@ var roleDefinitionId = resourceId( '00000000-0000-0000-0000-000000000002' ) -var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' +var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}/dbs/enterprise_memory' resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { parent: cosmosAccount diff --git a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/README.md b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/README.md index 1488de6a2..a62fbf75c 100644 --- a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/README.md +++ b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/README.md @@ -19,7 +19,7 @@ For more information, [see the getting started guide.](https://learn.microsoft.c 1. To deploy this template, click the "Deploy to Azure" button or you can run one of the following commands: -[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure-ai-foundry%2Ffoundry-samples%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Finfrastructure-setup-bicep%2F40-basic-agent-setup%2Fbasic-setup.json) +[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure-ai-foundry%2Ffoundry-samples%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Finfrastructure-setup-bicep%2F40-basic-agent-setup%2Fazuredeploy.json) * Create new (or use existing) resource group: @@ -31,5 +31,5 @@ For more information, [see the getting started guide.](https://learn.microsoft.c * Deploy the template ```bash - az deployment group create --resource-group --template-file basic-setup.bicep + az deployment group create --resource-group --template-file main.bicep ``` diff --git a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.json b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/azuredeploy.json similarity index 96% rename from infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.json rename to infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/azuredeploy.json index 19ec0d9a8..8d7b06f37 100644 --- a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.json +++ b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/azuredeploy.json @@ -4,8 +4,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.37.4.10188", - "templateHash": "3205552327656911185" + "version": "0.39.26.7824", + "templateHash": "17632891943305566295" } }, "parameters": { @@ -44,7 +44,7 @@ }, "location": { "type": "string", - "defaultValue": "westus", + "defaultValue": "eastus", "allowedValues": [ "australiaeast", "canadaeast", @@ -77,7 +77,7 @@ }, "modelName": { "type": "string", - "defaultValue": "gpt-4o", + "defaultValue": "gpt-4.1", "metadata": { "description": "The name of the OpenAI model you want to deploy" } @@ -91,7 +91,7 @@ }, "modelVersion": { "type": "string", - "defaultValue": "2024-11-20", + "defaultValue": "2025-04-14", "metadata": { "description": "The version of the model you want to deploy. Example: 2024-11-20" } @@ -105,7 +105,7 @@ }, "modelCapacity": { "type": "int", - "defaultValue": 30, + "defaultValue": 40, "metadata": { "description": "The capacity of the model deployment in TPM." } diff --git a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.parameters.json b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/azuredeploy.parameters.json similarity index 100% rename from infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.parameters.json rename to infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/azuredeploy.parameters.json diff --git a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.bicep b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/main.bicep similarity index 93% rename from infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.bicep rename to infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/main.bicep index 6b15a10de..5b58e40cd 100644 --- a/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/basic-setup.bicep +++ b/infrastructure/infrastructure-setup-bicep/40-basic-agent-setup/main.bicep @@ -44,24 +44,23 @@ var accountName = toLower('${aiServicesName}${uniqueSuffix}') 'southcentralus' ]) @description('The Azure region where your AI Foundry resource and project will be created.') -param location string = 'westus' +param location string = 'eastus' @description('The name of the OpenAI model you want to deploy') -param modelName string = 'gpt-4o' +param modelName string = 'gpt-4.1' @description('The model format of the model you want to deploy. Example: OpenAI') param modelFormat string = 'OpenAI' @description('The version of the model you want to deploy. Example: 2024-11-20') -param modelVersion string = '2024-11-20' +param modelVersion string = '2025-04-14' @description('The SKU name for the model deployment. Example: GlobalStandard') param modelSkuName string = 'GlobalStandard' @description('The capacity of the model deployment in TPM.') -param modelCapacity int = 30 +param modelCapacity int = 40 -#disable-next-line BCP081 resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = { name: accountName location: location @@ -97,7 +96,6 @@ resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = { Step 3: Create a Cognitive Services Project */ -#disable-next-line BCP081 resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = { parent: account name: projectName @@ -111,7 +109,6 @@ resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-previ } } -#disable-next-line BCP081 resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01'= { parent: account name: modelName diff --git a/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/azuredeploy.json b/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/azuredeploy.json index 1724f7bcb..3449d1659 100644 --- a/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/azuredeploy.json +++ b/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/azuredeploy.json @@ -5,7 +5,7 @@ "_generator": { "name": "bicep", "version": "0.39.26.7824", - "templateHash": "7659596839548579132" + "templateHash": "17836798406056740836" } }, "parameters": { @@ -73,7 +73,7 @@ }, "modelName": { "type": "string", - "defaultValue": "gpt-4o", + "defaultValue": "gpt-4.1", "metadata": { "description": "The name of the model you want to deploy" } @@ -87,7 +87,7 @@ }, "modelVersion": { "type": "string", - "defaultValue": "2024-11-20", + "defaultValue": "2025-04-14", "metadata": { "description": "The version of your model" } @@ -101,7 +101,7 @@ }, "modelCapacity": { "type": "int", - "defaultValue": 1, + "defaultValue": 40, "metadata": { "description": "The tokens per minute (TPM) of your model deployment" } diff --git a/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/main.bicep b/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/main.bicep index 978346c1a..ed4e40dfd 100644 --- a/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/main.bicep @@ -44,19 +44,19 @@ param displayName string = 'project' // Model deployment parameters @description('The name of the model you want to deploy') -param modelName string = 'gpt-4o' +param modelName string = 'gpt-4.1' @description('The provider of your model') param modelFormat string = 'OpenAI' @description('The version of your model') -param modelVersion string = '2024-11-20' +param modelVersion string = '2025-04-14' @description('The sku of your model deployment') param modelSkuName string = 'GlobalStandard' @description('The tokens per minute (TPM) of your model deployment') -param modelCapacity int = 1 +param modelCapacity int = 40 // Optionally bring existing resources @description('The AI Search Service full ARM Resource ID. This is an optional field, and if not provided, the resource will be created.') diff --git a/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/cosmos-container-role-assignments.bicep b/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/cosmos-container-role-assignments.bicep index db68fc207..a5fbbf70d 100644 --- a/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/cosmos-container-role-assignments.bicep +++ b/infrastructure/infrastructure-setup-bicep/41-standard-agent-setup/modules-standard/cosmos-container-role-assignments.bicep @@ -19,7 +19,7 @@ var roleDefinitionId = resourceId( '00000000-0000-0000-0000-000000000002' ) -var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' +var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}/dbs/enterprise_memory' resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { parent: cosmosAccount diff --git a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/README.md b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/README.md index 425609716..ff298adee 100644 --- a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/README.md +++ b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/README.md @@ -25,7 +25,7 @@ Below are two supported approaches. ### 1 — Deploy from the Azure portal (one-click) -[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure-ai-foundry%2Ffoundry-samples%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Finfrastructure-setup-bicep%2F42-basic-agent-setup-with-customization%2Fmain.json) +[![Deploy To Azure](https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/1-CONTRIBUTION-GUIDE/images/deploytoazure.svg?sanitize=true)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fazure-ai-foundry%2Ffoundry-samples%2Frefs%2Fheads%2Fmain%2Finfrastructure%2Finfrastructure-setup-bicep%2F42-basic-agent-setup-with-customization%2Fazuredeploy.json) Click the button, then complete the portal wizard. Replace **existingAoaiResourceId** with the resource id of your Azure OpenAI resource. diff --git a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.json b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azuredeploy.json similarity index 98% rename from infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.json rename to infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azuredeploy.json index fe57e568e..3d2f2bd45 100644 --- a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.json +++ b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azuredeploy.json @@ -5,8 +5,8 @@ "metadata": { "_generator": { "name": "bicep", - "version": "0.37.4.10188", - "templateHash": "12701869582839072315" + "version": "0.39.26.7824", + "templateHash": "14667354563602935622" } }, "parameters": { @@ -45,7 +45,7 @@ }, "location": { "type": "string", - "defaultValue": "westus", + "defaultValue": "eastus", "allowedValues": [ "australiaeast", "canadaeast", diff --git a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.parameters.json b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azuredeploy.parameters.json similarity index 100% rename from infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.parameters.json rename to infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/azuredeploy.parameters.json diff --git a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.bicep b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.bicep index 10df4f411..8c3660f56 100644 --- a/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/42-basic-agent-setup-with-customization/main.bicep @@ -42,7 +42,7 @@ param projectDisplayName string = 'project_display_name' 'southcentralus' ]) @description('The Azure region where your AI Foundry resource and project will be created.') -param location string = 'westus' +param location string = 'eastus' // TO DO: Update the resource ID to point to an existing Azure OpenAI resource in your subscription @description('The resource ID of the existing Azure OpenAI resource.') diff --git a/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/azuredeploy.json b/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/azuredeploy.json index ad1b427e4..4ab72e331 100644 --- a/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/azuredeploy.json +++ b/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/azuredeploy.json @@ -5,13 +5,13 @@ "_generator": { "name": "bicep", "version": "0.39.26.7824", - "templateHash": "2016609521519507582" + "templateHash": "12453864151003563685" } }, "parameters": { "location": { "type": "string", - "defaultValue": "westus", + "defaultValue": "eastus", "allowedValues": [ "australiaeast", "canadaeast", diff --git a/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/main.bicep b/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/main.bicep index be6a3ff73..067b737df 100644 --- a/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/main.bicep @@ -27,7 +27,7 @@ 'southcentralus' ]) @description('The Azure region where your AI Foundry resource and project will be created.') -param location string = 'westus' +param location string = 'eastus' @maxLength(9) @description('The name of the Azure AI Foundry resource.') diff --git a/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/cosmos-container-role-assignments.bicep b/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/cosmos-container-role-assignments.bicep index 7da79fc07..87797e98c 100644 --- a/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/cosmos-container-role-assignments.bicep +++ b/infrastructure/infrastructure-setup-bicep/43-standard-agent-setup-with-customization/modules-standard/cosmos-container-role-assignments.bicep @@ -19,7 +19,7 @@ var roleDefinitionId = resourceId( '00000000-0000-0000-0000-000000000002' ) -var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}' +var accountScope = '/subscriptions/${subscription().subscriptionId}/resourceGroups/${resourceGroup().name}/providers/Microsoft.DocumentDB/databaseAccounts/${cosmosAccountName}/dbs/enterprise_memory' resource containerRoleAssignmentUserContainer 'Microsoft.DocumentDB/databaseAccounts/sqlRoleAssignments@2022-05-15' = { parent: cosmosAccount diff --git a/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/azuredeploy.json b/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/azuredeploy.json new file mode 100644 index 000000000..9c5a0bde1 --- /dev/null +++ b/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/azuredeploy.json @@ -0,0 +1,358 @@ +{ + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.39.26.7824", + "templateHash": "7778551102092775636" + } + }, + "parameters": { + "ai_services": { + "type": "string", + "defaultValue": "aiServices" + }, + "project_name": { + "type": "string", + "defaultValue": "project" + }, + "description": { + "type": "string", + "defaultValue": "some description" + }, + "display_name": { + "type": "string", + "defaultValue": "project_display_name" + }, + "location": { + "type": "string", + "defaultValue": "eastus" + }, + "modelName": { + "type": "string", + "defaultValue": "gpt-4.1" + }, + "modelFormat": { + "type": "string", + "defaultValue": "OpenAI" + }, + "modelVersion": { + "type": "string", + "defaultValue": "2025-04-14" + }, + "modelSkuName": { + "type": "string", + "defaultValue": "GlobalStandard" + }, + "modelCapacity": { + "type": "int", + "defaultValue": 30 + }, + "deploymentTimestamp": { + "type": "string", + "defaultValue": "[utcNow('yyyyMMddHHmmss')]" + } + }, + "variables": { + "uniqueSuffix": "[substring(uniqueString(format('{0}-{1}', resourceGroup().id, parameters('deploymentTimestamp'))), 0, 4)]", + "account_name": "[toLower(format('{0}{1}', parameters('ai_services'), variables('uniqueSuffix')))]" + }, + "resources": [ + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2025-04-01", + "name": "[format('ai-{0}-{1}-deployment', variables('account_name'), variables('uniqueSuffix'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "account_name": { + "value": "[variables('account_name')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "modelName": { + "value": "[parameters('modelName')]" + }, + "modelFormat": { + "value": "[parameters('modelFormat')]" + }, + "modelVersion": { + "value": "[parameters('modelVersion')]" + }, + "modelSkuName": { + "value": "[parameters('modelSkuName')]" + }, + "modelCapacity": { + "value": "[parameters('modelCapacity')]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.39.26.7824", + "templateHash": "18028369509636259517" + } + }, + "parameters": { + "account_name": { + "type": "string" + }, + "location": { + "type": "string" + }, + "modelName": { + "type": "string" + }, + "modelFormat": { + "type": "string" + }, + "modelVersion": { + "type": "string" + }, + "modelSkuName": { + "type": "string" + }, + "modelCapacity": { + "type": "int" + } + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts", + "apiVersion": "2025-04-01-preview", + "name": "[parameters('account_name')]", + "location": "[parameters('location')]", + "sku": { + "name": "S0" + }, + "kind": "AIServices", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "allowProjectManagement": true, + "customSubDomainName": "[parameters('account_name')]", + "networkAcls": { + "defaultAction": "Allow", + "virtualNetworkRules": [], + "ipRules": [] + }, + "publicNetworkAccess": "Enabled", + "disableLocalAuth": false + } + }, + { + "type": "Microsoft.CognitiveServices/accounts/deployments", + "apiVersion": "2024-10-01", + "name": "[format('{0}/{1}', parameters('account_name'), parameters('modelName'))]", + "sku": { + "capacity": "[parameters('modelCapacity')]", + "name": "[parameters('modelSkuName')]" + }, + "properties": { + "model": { + "name": "[parameters('modelName')]", + "format": "[parameters('modelFormat')]", + "version": "[parameters('modelVersion')]" + } + }, + "dependsOn": [ + "[resourceId('Microsoft.CognitiveServices/accounts', parameters('account_name'))]" + ] + } + ], + "outputs": { + "account_name": { + "type": "string", + "value": "[parameters('account_name')]" + }, + "account_name_id": { + "type": "string", + "value": "[resourceId('Microsoft.CognitiveServices/accounts', parameters('account_name'))]" + }, + "aiServicesTarget": { + "type": "string", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts', parameters('account_name')), '2025-04-01-preview').endpoint]" + } + } + } + } + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2025-04-01", + "name": "[format('ai-{0}-{1}-deployment', parameters('project_name'), variables('uniqueSuffix'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "project_name": { + "value": "[parameters('project_name')]" + }, + "description": { + "value": "[parameters('description')]" + }, + "display_name": { + "value": "[parameters('display_name')]" + }, + "location": { + "value": "[parameters('location')]" + }, + "account_name": { + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('account_name'), variables('uniqueSuffix'))), '2025-04-01').outputs.account_name.value]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.39.26.7824", + "templateHash": "9956949102179771191" + } + }, + "parameters": { + "account_name": { + "type": "string" + }, + "location": { + "type": "string" + }, + "project_name": { + "type": "string" + }, + "description": { + "type": "string" + }, + "display_name": { + "type": "string" + } + }, + "resources": [ + { + "type": "Microsoft.CognitiveServices/accounts/projects", + "apiVersion": "2025-04-01-preview", + "name": "[format('{0}/{1}', parameters('account_name'), parameters('project_name'))]", + "location": "[parameters('location')]", + "identity": { + "type": "SystemAssigned" + }, + "properties": { + "description": "[parameters('description')]", + "displayName": "[parameters('display_name')]" + } + } + ], + "outputs": { + "project_name": { + "type": "string", + "value": "[parameters('project_name')]" + }, + "project_id": { + "type": "string", + "value": "[resourceId('Microsoft.CognitiveServices/accounts/projects', parameters('account_name'), parameters('project_name'))]" + }, + "projectPrincipalId": { + "type": "string", + "value": "[reference(resourceId('Microsoft.CognitiveServices/accounts/projects', parameters('account_name'), parameters('project_name')), '2025-04-01-preview', 'full').identity.principalId]" + } + } + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('account_name'), variables('uniqueSuffix')))]" + ] + }, + { + "type": "Microsoft.Resources/deployments", + "apiVersion": "2025-04-01", + "name": "[format('ai-{0}-{1}-bing-connection', parameters('project_name'), variables('uniqueSuffix'))]", + "properties": { + "expressionEvaluationOptions": { + "scope": "inner" + }, + "mode": "Incremental", + "parameters": { + "account_name": { + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('account_name'), variables('uniqueSuffix'))), '2025-04-01').outputs.account_name.value]" + } + }, + "template": { + "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", + "contentVersion": "1.0.0.0", + "metadata": { + "_generator": { + "name": "bicep", + "version": "0.39.26.7824", + "templateHash": "1420647491421234827" + } + }, + "parameters": { + "account_name": { + "type": "string", + "defaultValue": "aiservicesy4si" + }, + "bingSearchName": { + "type": "string", + "defaultValue": "[format('bingsearch-{0}', parameters('account_name'))]" + } + }, + "resources": [ + { + "type": "Microsoft.Bing/accounts", + "apiVersion": "2020-06-10", + "name": "[parameters('bingSearchName')]", + "location": "global", + "sku": { + "name": "G1" + }, + "kind": "Bing.Grounding" + }, + { + "type": "Microsoft.CognitiveServices/accounts/connections", + "apiVersion": "2025-04-01-preview", + "name": "[format('{0}/{1}', parameters('account_name'), format('{0}-bingsearchconnection', parameters('account_name')))]", + "properties": { + "category": "ApiKey", + "target": "https://api.bing.microsoft.com/", + "authType": "ApiKey", + "credentials": { + "key": "[format('{0}', listKeys(resourceId('Microsoft.Bing/accounts', parameters('bingSearchName')), '2020-06-10').key1)]" + }, + "isSharedToAll": true, + "metadata": { + "ApiType": "Azure", + "Location": "[reference(resourceId('Microsoft.Bing/accounts', parameters('bingSearchName')), '2020-06-10', 'full').location]", + "ResourceId": "[resourceId('Microsoft.Bing/accounts', parameters('bingSearchName'))]" + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Bing/accounts', parameters('bingSearchName'))]" + ] + } + ] + } + }, + "dependsOn": [ + "[resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('account_name'), variables('uniqueSuffix')))]" + ] + } + ], + "outputs": { + "ENDPOINT": { + "type": "string", + "value": "[reference(resourceId('Microsoft.Resources/deployments', format('ai-{0}-{1}-deployment', variables('account_name'), variables('uniqueSuffix'))), '2025-04-01').outputs.aiServicesTarget.value]" + } + } +} \ No newline at end of file diff --git a/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/main.bicep b/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/main.bicep index a38607662..4e74d283e 100644 --- a/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/main.bicep +++ b/infrastructure/infrastructure-setup-bicep/45-basic-agent-bing/main.bicep @@ -4,11 +4,11 @@ param description string = 'some description' param display_name string = 'project_display_name' param location string = 'eastus' -param modelName string = 'gpt-4o' +param modelName string = 'gpt-4.1' param modelFormat string = 'OpenAI' -param modelVersion string = '2024-05-13' +param modelVersion string = '2025-04-14' param modelSkuName string = 'GlobalStandard' -param modelCapacity int = 1 +param modelCapacity int = 30 // Create a short, unique suffix, that will be unique to each resource group // var uniqueSuffix = substring(uniqueString(resourceGroup().id), 0, 4)