Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
0b89236
updating names
fosteramanda Jan 13, 2026
60833b1
compile bicep
fosteramanda Jan 13, 2026
882dc85
updating model
fosteramanda Jan 13, 2026
76dea79
Update run-setup.yml
fosteramanda Jan 13, 2026
cd270ee
Change git push reference to use GITHUB_REF_NAME
fosteramanda Jan 13, 2026
cf8d4e7
Merge pull request #5 from fosteramanda/model
fosteramanda Jan 13, 2026
65ed9c6
adding model
fosteramanda Jan 13, 2026
7a0ab35
Merge branch 'model' of https://github.com/fosteramanda/foundry-sampl…
fosteramanda Jan 13, 2026
24ecf78
Refactor GitHub Actions workflow for Bicep processing
fosteramanda Jan 13, 2026
17fa81a
Update run-setup.yml
fosteramanda Jan 13, 2026
6a8327c
Change git add command to add all files
fosteramanda Jan 13, 2026
36253b0
Automatic fixes
Jan 13, 2026
773f789
updates
fosteramanda Jan 13, 2026
c2ba65c
Automatic fixes
Jan 13, 2026
1522ef4
Update run-setup.yml
fosteramanda Jan 13, 2026
952d9b5
Automatic fixes
Jan 13, 2026
f97781d
updating file
fosteramanda Jan 13, 2026
7e64537
template
fosteramanda Jan 13, 2026
50ea96a
Automatic fixes
Jan 13, 2026
b913333
Merge pull request #6 from fosteramanda/model
fosteramanda Jan 13, 2026
215bfd7
updating model
fosteramanda Jan 13, 2026
11d8aa4
updating basic setup
fosteramanda Jan 13, 2026
d1f0154
update2
fosteramanda Jan 13, 2026
914fcec
Automatic fixes
Jan 13, 2026
175832a
Add GitHub Actions workflow for Bicep setup
fosteramanda Jan 13, 2026
e0a3c51
Merge pull request #11 from fosteramanda/compile-bicep
fosteramanda Jan 13, 2026
c3b495b
updates templates rbac
fosteramanda Jan 13, 2026
411b67a
Merge branch 'main' of https://github.com/fosteramanda/foundry-samples
fosteramanda Jan 13, 2026
1180caf
updating templates
fosteramanda Jan 13, 2026
ff7f972
updating templates
fosteramanda Jan 13, 2026
3962258
updating workflow
fosteramanda Jan 13, 2026
c915cf5
updating model quota
fosteramanda Jan 13, 2026
0fb26f8
Automatic fixes
Jan 13, 2026
6c90b5a
updating model quota
fosteramanda Jan 13, 2026
516e188
Merge branch 'main' of https://github.com/fosteramanda/foundry-samples
fosteramanda Jan 13, 2026
0bf7408
Automatic fixes
Jan 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 135 additions & 0 deletions .github/workflows/run-setup.yml
Original file line number Diff line number Diff line change
@@ -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<<EOF"
echo "$MODIFIED"
echo "EOF"
} >> $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"
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Expand All @@ -64,7 +64,7 @@
},
"modelVersion": {
"type": "string",
"defaultValue": "2024-11-20",
"defaultValue": "2025-04-14",
"metadata": {
"description": "The version of your model"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Expand All @@ -64,7 +64,7 @@
},
"modelVersion": {
"type": "string",
"defaultValue": "2024-11-20",
"defaultValue": "2025-04-14",
"metadata": {
"description": "The version of your model"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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"
}
Expand All @@ -64,7 +64,7 @@
},
"modelVersion": {
"type": "string",
"defaultValue": "2024-11-20",
"defaultValue": "2025-04-14",
"metadata": {
"description": "The version of your model"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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 <new-rg-name> --template-file basic-setup.bicep
az deployment group create --resource-group <new-rg-name> --template-file main.bicep
```
Loading