Skip to content

Commit 8d32552

Browse files
committed
25-entra completed
25 entra completed
1 parent 0a54570 commit 8d32552

File tree

2 files changed

+146
-17
lines changed

2 files changed

+146
-17
lines changed
Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
1-
---
2-
description: This template deploys an Azure AI Foundry account, project, and model deployment with your User-Assigned Managed Identity.
3-
page_type: sample
4-
products:
5-
- azure
6-
- azure-resource-manager
7-
urlFragment: aifoundry-uai
8-
languages:
9-
- bicep
10-
- json
11-
---
12-
# Set up Azure AI Foundry with user-assigned identity
1+
# Azure AI Agent Service: Standard Agent Setup 1RP with Private E2E Networking
132

14-
EntraID passthrough:
15-
Foundry resource
16-
One other resources that we'll connect to (storage)
17-
Azure storage connection with EntraID passthrough auth
18-
Show 1 role assignment for project MSI on storage
3+
> **NOTE:** This template is to set-up a connection to a storage account and assign entraID passthrough for your storage resource. This includes creating:
4+
* a Foundry resource
5+
* A storage account (the one other resource to connect to)
6+
* Azure storage connection with EntraID passthrough auth
7+
* Storage Blob Data Owner role assignment for project MSI on storage
8+
9+
## Steps
10+
11+
1. Create new (or use existing) resource group:
12+
13+
```bash
14+
az group create --name <new-rg-name> --location eastus
15+
```
16+
17+
2. Deploy the main-create.bicep
18+
19+
```bash
20+
az deployment group create --resource-group <new-rg-name> --template-file main.bicep
21+
```
Lines changed: 126 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
/*
2+
AI Foundry account and project - with public network access disabled
3+
4+
Description:
5+
- Creates an AI Foundry (previously known as Azure AI Services) account and public network access disabled.
6+
- Creates a gpt-4o model deployment
7+
*/
8+
@description('That name is the name of our application. It has to be unique. Type a name followed by your resource group name. (<name>-<resourceGroupName>)')
9+
param aiFoundryName string = 'entraid-foundry'
10+
11+
@description('Location for all resources.')
12+
param location string = 'eastus'
13+
14+
@description('Name of the first project')
15+
param projectName string = '${aiFoundryName}-proj'
16+
@description('This project will be a sub-resource of your account')
17+
param projectDescription string = 'A project for the AI Foundry account with storage account'
18+
@description('The display name of the project')
19+
param displayName string = 'project'
20+
21+
@description('Name of the storage account')
22+
param azureStorageName string = 'entraidfoundry'
23+
24+
@description('Storage account sku')
25+
param noZRSRegions array = ['southindia', 'westus']
26+
param sku object = contains(noZRSRegions, location) ? { name: 'Standard_GRS' } : { name: 'Standard_ZRS' }
27+
28+
/*
29+
Step 1: Create dependent resource - Storage account
30+
*/
31+
resource storage 'Microsoft.Storage/storageAccounts@2023-05-01' = {
32+
name: azureStorageName
33+
location: location
34+
kind: 'StorageV2'
35+
sku: sku
36+
properties: {
37+
minimumTlsVersion: 'TLS1_2'
38+
allowBlobPublicAccess: false
39+
publicNetworkAccess: 'Disabled'
40+
networkAcls: {
41+
bypass: 'AzureServices'
42+
defaultAction: 'Deny'
43+
virtualNetworkRules: []
44+
}
45+
allowSharedKeyAccess: false
46+
}
47+
}
48+
49+
/*
50+
Step 2: Create an Account
51+
*/
52+
resource account 'Microsoft.CognitiveServices/accounts@2025-04-01-preview' = {
53+
name: aiFoundryName
54+
location: location
55+
identity: {
56+
type: 'SystemAssigned'
57+
}
58+
kind: 'AIServices'
59+
sku: {
60+
name: 'S0'
61+
}
62+
properties: {
63+
// Networking
64+
publicNetworkAccess: 'Disabled'
65+
// Specifies whether this resource support project management as child resources, used as containers for access management, data isolation, and cost in AI Foundry.
66+
allowProjectManagement: true
67+
// Defines developer API endpoint subdomain
68+
customSubDomainName: aiFoundryName
69+
// Auth
70+
disableLocalAuth: false
71+
}
72+
}
73+
74+
/*
75+
Step 3: Create project
76+
*/
77+
resource project 'Microsoft.CognitiveServices/accounts/projects@2025-04-01-preview' = {
78+
parent: account
79+
name: projectName
80+
location: location
81+
identity: {
82+
type: 'SystemAssigned'
83+
}
84+
properties: {
85+
description: projectDescription
86+
displayName: displayName
87+
}
88+
89+
resource project_connection_azure_storage 'connections@2025-04-01-preview' = {
90+
name: azureStorageName
91+
properties: {
92+
category: 'AzureStorageAccount'
93+
target: storage.properties.primaryEndpoints.blob
94+
authType: 'AAD'
95+
metadata: {
96+
ApiType: 'Azure'
97+
ResourceId: storage.id
98+
location: storage.location
99+
}
100+
}
101+
}
102+
}
103+
104+
/*
105+
Step 4: Assign storage account roles
106+
*/
107+
108+
// Storage Blob Data Owner Role
109+
resource storageBlobDataOwner 'Microsoft.Authorization/roleDefinitions@2022-04-01' existing = {
110+
name: 'b7e6dc6d-f1e8-4753-8033-0f276bb0955b' // Built-in role ID
111+
scope: resourceGroup()
112+
}
113+
114+
// Assign Storage Blob Data Owner role
115+
resource storageBlobDataOwnerAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
116+
scope: storage
117+
name: guid(storageBlobDataOwner.id, storage.id)
118+
properties: {
119+
principalId: project.identity.principalId
120+
roleDefinitionId: storageBlobDataOwner.id
121+
principalType: 'ServicePrincipal'
122+
}
123+
}
124+
125+
126+

0 commit comments

Comments
 (0)