@@ -18,17 +18,17 @@ param acaExists bool = false
1818@description ('Location for the Azure AI resource' )
1919// https://learn.microsoft.com/azure/ai-studio/how-to/deploy-models-serverless-availability#deepseek-models-from-microsoft
2020@allowed ([
21- 'eastus'
22- 'eastus2'
23- 'northcentralus'
24- 'southcentralus'
25- 'westus'
26- 'westus3'
21+ 'eastus'
22+ 'eastus2'
23+ 'northcentralus'
24+ 'southcentralus'
25+ 'westus'
26+ 'westus3'
2727])
2828@metadata ({
29- azd : {
30- type : 'location'
31- }
29+ azd : {
30+ type : 'location'
31+ }
3232})
3333param aiServicesResourceLocation string
3434param disableKeyBasedAuth bool = true
@@ -40,99 +40,99 @@ var resourceToken = toLower(uniqueString(subscription().id, name, location))
4040var tags = { 'azd-env-name' : name }
4141
4242resource resourceGroup 'Microsoft.Resources/resourceGroups@2021-04-01' = {
43- name : '${name }-rg'
44- location : location
45- tags : tags
43+ name : '${name }-rg'
44+ location : location
45+ tags : tags
4646}
4747
4848var prefix = '${name }-${resourceToken }'
4949
5050var aiServicesNameAndSubdomain = '${resourceToken }-aiservices'
5151module aiServices 'br/public:avm/res/cognitive-services/account:0.7.2' = {
52- name : 'deepseek'
53- scope : resourceGroup
54- params : {
55- name : aiServicesNameAndSubdomain
56- location : aiServicesResourceLocation
57- tags : tags
58- kind : 'AIServices'
59- customSubDomainName : aiServicesNameAndSubdomain
60- sku : 'S0'
61- publicNetworkAccess : 'Enabled'
62- deployments : [
63- {
64- name : aiServicesDeploymentName
65- model : {
66- format : 'DeepSeek'
67- name : 'DeepSeek-R1'
68- version : '1'
69- }
70- sku : {
71- name : 'GlobalStandard'
72- capacity : 1
73- }
74- }
75- ]
76- disableLocalAuth : disableKeyBasedAuth
77- roleAssignments : [
78- {
79- principalId : principalId
80- principalType : 'User'
81- roleDefinitionIdOrName : 'Cognitive Services User'
82- }
83- ]
84- }
52+ name : 'deepseek'
53+ scope : resourceGroup
54+ params : {
55+ name : aiServicesNameAndSubdomain
56+ location : aiServicesResourceLocation
57+ tags : tags
58+ kind : 'AIServices'
59+ customSubDomainName : aiServicesNameAndSubdomain
60+ sku : 'S0'
61+ publicNetworkAccess : 'Enabled'
62+ deployments : [
63+ {
64+ name : aiServicesDeploymentName
65+ model : {
66+ format : 'DeepSeek'
67+ name : 'DeepSeek-R1'
68+ version : '1'
69+ }
70+ sku : {
71+ name : 'GlobalStandard'
72+ capacity : 1
73+ }
74+ }
75+ ]
76+ disableLocalAuth : disableKeyBasedAuth
77+ roleAssignments : [
78+ {
79+ principalId : principalId
80+ principalType : 'User'
81+ roleDefinitionIdOrName : 'Cognitive Services User'
82+ }
83+ ]
84+ }
8585}
8686
8787module logAnalyticsWorkspace 'core/monitor/loganalytics.bicep' = {
88- name : 'loganalytics'
89- scope : resourceGroup
90- params : {
91- name : '${prefix }-loganalytics'
92- location : location
93- tags : tags
94- }
88+ name : 'loganalytics'
89+ scope : resourceGroup
90+ params : {
91+ name : '${prefix }-loganalytics'
92+ location : location
93+ tags : tags
94+ }
9595}
9696
9797// Container apps host (including container registry)
9898module containerApps 'core/host/container-apps.bicep' = {
99- name : 'container-apps'
100- scope : resourceGroup
101- params : {
102- name : 'app'
103- location : location
104- tags : tags
105- containerAppsEnvironmentName : '${prefix }-containerapps-env'
106- containerRegistryName : '${replace (prefix , '-' , '' )}registry'
107- logAnalyticsWorkspaceName : logAnalyticsWorkspace .outputs .name
108- }
99+ name : 'container-apps'
100+ scope : resourceGroup
101+ params : {
102+ name : 'app'
103+ location : location
104+ tags : tags
105+ containerAppsEnvironmentName : '${prefix }-containerapps-env'
106+ containerRegistryName : '${replace (prefix , '-' , '' )}registry'
107+ logAnalyticsWorkspaceName : logAnalyticsWorkspace .outputs .name
108+ }
109109}
110110
111111// Container app frontend
112112module aca 'aca.bicep' = {
113- name : 'aca'
114- scope : resourceGroup
115- params : {
116- name : replace ('${take (prefix ,19 )}-ca' , '--' , '-' )
117- location : location
118- tags : tags
119- identityName : '${prefix }-id-aca'
120- containerAppsEnvironmentName : containerApps .outputs .environmentName
121- containerRegistryName : containerApps .outputs .registryName
122- aiServicesDeploymentName : aiServicesDeploymentName
123- aiServicesEndpoint : 'https://${aiServices .outputs .name }.services.ai.azure.com/models'
124- exists : acaExists
125- }
113+ name : 'aca'
114+ scope : resourceGroup
115+ params : {
116+ name : replace ('${take (prefix ,19 )}-ca' , '--' , '-' )
117+ location : location
118+ tags : tags
119+ identityName : '${prefix }-id-aca'
120+ containerAppsEnvironmentName : containerApps .outputs .environmentName
121+ containerRegistryName : containerApps .outputs .registryName
122+ aiServicesDeploymentName : aiServicesDeploymentName
123+ aiServicesEndpoint : 'https://${aiServices .outputs .name }.services.ai.azure.com/models'
124+ exists : acaExists
125+ }
126126}
127127
128128module aiServicesRoleBackend 'core/security/role.bicep' = {
129- scope : resourceGroup
130- name : 'aiservices-role-backend'
131- params : {
132- principalId : aca .outputs .identityPrincipalId
133- roleDefinitionId : 'a97b65f3-24c7-4388-baec-2e87135dc908'
134- principalType : 'ServicePrincipal'
135- }
129+ scope : resourceGroup
130+ name : 'aiservices-role-backend'
131+ params : {
132+ principalId : aca .outputs .identityPrincipalId
133+ roleDefinitionId : 'a97b65f3-24c7-4388-baec-2e87135dc908'
134+ principalType : 'ServicePrincipal'
135+ }
136136}
137137
138138output AZURE_LOCATION string = location
0 commit comments