Skip to content

Commit 2254205

Browse files
committed
cmk samples
1 parent debc074 commit 2254205

32 files changed

+2032
-467
lines changed

samples/microsoft/infrastructure-setup/00-basic/main.bicep

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param aiFoundryName string = 'dentestlocalauth'
1+
param aiFoundryName string = 'uniquename'
22
param aiProjectName string = '${aiFoundryName}-proj'
33
param location string = 'eastus2'
44

@@ -38,27 +38,23 @@ resource aiProject 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-pre
3838
identity: {
3939
type: 'SystemAssigned'
4040
}
41-
properties: {
42-
// displayName: 'test'
43-
// description: 'test2'
44-
// isDefault: true
45-
}
41+
properties: {}
4642
}
4743

4844
/*
4945
Optionally deploy a model to use in playground, agents and other tools.
5046
*/
51-
// resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01'= {
52-
// parent: aiFoundry
53-
// name: 'gpt-4o'
54-
// sku : {
55-
// capacity: 1
56-
// name: 'GlobalStandard'
57-
// }
58-
// properties: {
59-
// model:{
60-
// name: 'gpt-4o'
61-
// format: 'OpenAI'
62-
// }
63-
// }
64-
// }
47+
resource modelDeployment 'Microsoft.CognitiveServices/accounts/deployments@2024-10-01'= {
48+
parent: aiFoundry
49+
name: 'gpt-4o'
50+
sku : {
51+
capacity: 1
52+
name: 'GlobalStandard'
53+
}
54+
properties: {
55+
model:{
56+
name: 'gpt-4o'
57+
format: 'OpenAI'
58+
}
59+
}
60+
}
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"metadata": {
5+
"_generator": {
6+
"name": "bicep",
7+
"version": "0.35.1.17967",
8+
"templateHash": "7999187378888452594"
9+
}
10+
},
11+
"parameters": {
12+
"aiFoundryName": {
13+
"type": "string",
14+
"defaultValue": "<your-account-name>"
15+
},
16+
"connectedResourceName": {
17+
"type": "string",
18+
"defaultValue": "[format('ais-{0}', parameters('aiFoundryName'))]"
19+
},
20+
"location": {
21+
"type": "string",
22+
"defaultValue": "westus"
23+
},
24+
"newOrExisting": {
25+
"type": "string",
26+
"defaultValue": "new",
27+
"allowedValues": [
28+
"new",
29+
"existing"
30+
]
31+
}
32+
},
33+
"resources": [
34+
{
35+
"condition": "[equals(parameters('newOrExisting'), 'new')]",
36+
"type": "Microsoft.Search/searchServices",
37+
"apiVersion": "2025-02-01-preview",
38+
"name": "[parameters('connectedResourceName')]",
39+
"location": "[parameters('location')]",
40+
"sku": {
41+
"name": "basic"
42+
},
43+
"properties": {}
44+
},
45+
{
46+
"type": "Microsoft.CognitiveServices/accounts/connections",
47+
"apiVersion": "2025-04-01-preview",
48+
"name": "[format('{0}/{1}', parameters('aiFoundryName'), format('{0}-aisearch', parameters('aiFoundryName')))]",
49+
"properties": {
50+
"category": "CognitiveSearch",
51+
"target": "[if(equals(parameters('newOrExisting'), 'new'), reference(resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), '2025-02-01-preview').endpoint, reference(resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), '2025-02-01-preview').endpoint)]",
52+
"authType": "ApiKey",
53+
"isSharedToAll": true,
54+
"credentials": {
55+
"key": "[if(equals(parameters('newOrExisting'), 'new'), listAdminKeys(resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), '2025-02-01-preview').primaryKey, listAdminKeys(resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), '2025-02-01-preview').primaryKey)]"
56+
},
57+
"metadata": {
58+
"ApiType": "Azure",
59+
"ResourceId": "[if(equals(parameters('newOrExisting'), 'new'), resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')))]",
60+
"location": "[if(equals(parameters('newOrExisting'), 'new'), reference(resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), '2025-02-01-preview', 'full').location, reference(resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName')), '2025-02-01-preview', 'full').location)]"
61+
}
62+
},
63+
"dependsOn": [
64+
"[resourceId('Microsoft.Search/searchServices', parameters('connectedResourceName'))]"
65+
]
66+
}
67+
]
68+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"metadata": {
5+
"_generator": {
6+
"name": "bicep",
7+
"version": "0.35.1.17967",
8+
"templateHash": "5332991959209962766"
9+
}
10+
},
11+
"parameters": {
12+
"aiFoundryName": {
13+
"type": "string",
14+
"defaultValue": "<your-foundry-name>"
15+
},
16+
"connectedResourceName": {
17+
"type": "string",
18+
"defaultValue": "[format('appi{0}', parameters('aiFoundryName'))]"
19+
},
20+
"location": {
21+
"type": "string",
22+
"defaultValue": "westus"
23+
},
24+
"newOrExisting": {
25+
"type": "string",
26+
"defaultValue": "new",
27+
"allowedValues": [
28+
"new",
29+
"existing"
30+
]
31+
}
32+
},
33+
"resources": [
34+
{
35+
"condition": "[equals(parameters('newOrExisting'), 'new')]",
36+
"type": "Microsoft.Insights/components",
37+
"apiVersion": "2020-02-02",
38+
"name": "[parameters('connectedResourceName')]",
39+
"location": "[parameters('location')]",
40+
"kind": "web",
41+
"properties": {
42+
"Application_Type": "web"
43+
}
44+
},
45+
{
46+
"type": "Microsoft.CognitiveServices/accounts/connections",
47+
"apiVersion": "2025-04-01-preview",
48+
"name": "[format('{0}/{1}', parameters('aiFoundryName'), format('{0}-appinsights', parameters('aiFoundryName')))]",
49+
"properties": {
50+
"category": "AppInsights",
51+
"target": "[if(equals(parameters('newOrExisting'), 'new'), resourceId('Microsoft.Insights/components', parameters('connectedResourceName')), resourceId('Microsoft.Insights/components', parameters('connectedResourceName')))]",
52+
"authType": "ApiKey",
53+
"isSharedToAll": true,
54+
"credentials": {
55+
"key": "[if(equals(parameters('newOrExisting'), 'new'), reference(resourceId('Microsoft.Insights/components', parameters('connectedResourceName')), '2020-02-02').ConnectionString, reference(resourceId('Microsoft.Insights/components', parameters('connectedResourceName')), '2020-02-02').ConnectionString)]"
56+
},
57+
"metadata": {
58+
"ApiType": "Azure",
59+
"ResourceId": "[if(equals(parameters('newOrExisting'), 'new'), resourceId('Microsoft.Insights/components', parameters('connectedResourceName')), resourceId('Microsoft.Insights/components', parameters('connectedResourceName')))]"
60+
}
61+
},
62+
"dependsOn": [
63+
"[resourceId('Microsoft.Insights/components', parameters('connectedResourceName'))]"
64+
]
65+
}
66+
]
67+
}
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"metadata": {
5+
"_generator": {
6+
"name": "bicep",
7+
"version": "0.35.1.17967",
8+
"templateHash": "6940982113626678729"
9+
}
10+
},
11+
"parameters": {
12+
"aiFoundryName": {
13+
"type": "string",
14+
"defaultValue": "<your-foundry-name>"
15+
},
16+
"connectedResourceName": {
17+
"type": "string",
18+
"defaultValue": "[format('st{0}', parameters('aiFoundryName'))]"
19+
},
20+
"location": {
21+
"type": "string",
22+
"defaultValue": "global"
23+
},
24+
"apiKey": {
25+
"type": "string",
26+
"defaultValue": "<your-key>"
27+
},
28+
"newOrExisting": {
29+
"type": "string",
30+
"defaultValue": "new",
31+
"allowedValues": [
32+
"new",
33+
"existing"
34+
]
35+
}
36+
},
37+
"resources": [
38+
{
39+
"condition": "[equals(parameters('newOrExisting'), 'new')]",
40+
"type": "Microsoft.Bing/accounts",
41+
"apiVersion": "2020-06-10",
42+
"name": "[parameters('connectedResourceName')]",
43+
"location": "[parameters('location')]",
44+
"sku": {
45+
"name": "G1"
46+
},
47+
"properties": {
48+
"statisticsEnabled": false
49+
},
50+
"kind": "Bing.Grounding"
51+
},
52+
{
53+
"type": "Microsoft.CognitiveServices/accounts/connections",
54+
"apiVersion": "2025-04-01-preview",
55+
"name": "[format('{0}/{1}', parameters('aiFoundryName'), format('{0}-bing', parameters('aiFoundryName')))]",
56+
"properties": {
57+
"category": "ApiKey",
58+
"target": "https://api.bing.microsoft.com/",
59+
"authType": "ApiKey",
60+
"isSharedToAll": true,
61+
"credentials": {
62+
"key": "[parameters('apiKey')]"
63+
},
64+
"metadata": {
65+
"ApiType": "Azure",
66+
"Type": "bing_grounding",
67+
"ResourceId": "[if(equals(parameters('newOrExisting'), 'new'), resourceId('Microsoft.Bing/accounts', parameters('connectedResourceName')), resourceId('Microsoft.Bing/accounts', parameters('connectedResourceName')))]"
68+
}
69+
},
70+
"dependsOn": [
71+
"[resourceId('Microsoft.Bing/accounts', parameters('connectedResourceName'))]"
72+
]
73+
}
74+
]
75+
}
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"contentVersion": "1.0.0.0",
4+
"metadata": {
5+
"_generator": {
6+
"name": "bicep",
7+
"version": "0.35.1.17967",
8+
"templateHash": "16112378734273156328"
9+
}
10+
},
11+
"parameters": {
12+
"aiFoundryName": {
13+
"type": "string",
14+
"defaultValue": "deeikele-9518-resource"
15+
},
16+
"connectedResourceName": {
17+
"type": "string",
18+
"defaultValue": "[format('st{0}', parameters('aiFoundryName'))]"
19+
},
20+
"location": {
21+
"type": "string",
22+
"defaultValue": "westus"
23+
},
24+
"newOrExisting": {
25+
"type": "string",
26+
"defaultValue": "new",
27+
"allowedValues": [
28+
"new",
29+
"existing"
30+
]
31+
}
32+
},
33+
"resources": [
34+
{
35+
"condition": "[equals(parameters('newOrExisting'), 'new')]",
36+
"type": "Microsoft.Storage/storageAccounts",
37+
"apiVersion": "2024-01-01",
38+
"name": "[parameters('connectedResourceName')]",
39+
"location": "[parameters('location')]",
40+
"sku": {
41+
"name": "Standard_LRS"
42+
},
43+
"kind": "StorageV2"
44+
},
45+
{
46+
"type": "Microsoft.CognitiveServices/accounts/connections",
47+
"apiVersion": "2025-04-01-preview",
48+
"name": "[format('{0}/{1}', parameters('aiFoundryName'), format('{0}-storage', parameters('aiFoundryName')))]",
49+
"properties": {
50+
"category": "AzureStorageAccount",
51+
"target": "[if(equals(parameters('newOrExisting'), 'new'), resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName')), resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName')))]",
52+
"authType": "AccountKey",
53+
"isSharedToAll": true,
54+
"credentials": {
55+
"key": "[string(if(equals(parameters('newOrExisting'), 'new'), listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName')), '2024-01-01').keys, listKeys(resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName')), '2024-01-01').keys))]"
56+
},
57+
"metadata": {
58+
"ApiType": "Azure",
59+
"ResourceId": "[if(equals(parameters('newOrExisting'), 'new'), resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName')), resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName')))]"
60+
}
61+
},
62+
"dependsOn": [
63+
"[resourceId('Microsoft.Storage/storageAccounts', parameters('connectedResourceName'))]"
64+
]
65+
}
66+
]
67+
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
# Deploy AI Foundry with a private network configuration
1+
# Deploy AI Foundry with a private network configuration
2+
3+
This examples shows how to disable public network access for Azure AI Foundry.
4+
5+
Coming soon.

samples/microsoft/infrastructure-setup/10-private-network-basic/main.bicep

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ param location string = 'eastus'
1313

1414
@description('Name of the first project')
1515
param defaultProjectName string = '${aiFoundryName}-proj'
16-
param defaultProjectDisplayName string = 'Project'
17-
param defaultProjectDescription string = 'Describe what your project is about.'
1816

1917
/*
2018
Step 1: Create a Cognitive Services Account
@@ -70,16 +68,10 @@ resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-previ
7068
name: defaultProjectName
7169
parent: account
7270
location: location
73-
7471
identity: {
7572
type: 'SystemAssigned'
7673
}
77-
78-
properties: {
79-
displayName: defaultProjectDisplayName
80-
description: defaultProjectDescription
81-
isDefault: true // can't be updated after creation; can only be set by one project in the account, the first project created.
82-
}
74+
properties: {}
8375
}
8476

8577
output accountId string = account.id

0 commit comments

Comments
 (0)