Skip to content

Commit

Permalink
feat: avm/res/cognites-services/account added missing OpenAI kind a…
Browse files Browse the repository at this point in the history
…nd updated api
  • Loading branch information
segraef committed Feb 11, 2024
1 parent d93c76c commit 4bfc609
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 9 deletions.
11 changes: 9 additions & 2 deletions avm/res/cognitive-services/account/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ This module deploys a Cognitive Service.
| :-- | :-- |
| `Microsoft.Authorization/locks` | [2020-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2020-05-01/locks) |
| `Microsoft.Authorization/roleAssignments` | [2022-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Authorization/2022-04-01/roleAssignments) |
| `Microsoft.CognitiveServices/accounts` | [2022-12-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.CognitiveServices/2022-12-01/accounts) |
| `Microsoft.CognitiveServices/accounts` | [2023-05-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.CognitiveServices/2023-05-01/accounts) |
| `Microsoft.Insights/diagnosticSettings` | [2021-05-01-preview](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Insights/2021-05-01-preview/diagnosticSettings) |
| `Microsoft.Network/privateEndpoints` | [2023-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2023-04-01/privateEndpoints) |
| `Microsoft.Network/privateEndpoints/privateDnsZoneGroups` | [2023-04-01](https://learn.microsoft.com/en-us/azure/templates/Microsoft.Network/2023-04-01/privateEndpoints/privateDnsZoneGroups) |
Expand Down Expand Up @@ -847,6 +847,7 @@ Kind of the Cognitive Services. Use 'Get-AzCognitiveServicesAccountSku' to deter
- Allowed:
```Bicep
[
'AIServices'
'AnomalyDetector'
'Bing.Autosuggest.v7'
'Bing.CustomSearch'
Expand All @@ -856,16 +857,22 @@ Kind of the Cognitive Services. Use 'Get-AzCognitiveServicesAccountSku' to deter
'CognitiveServices'
'ComputerVision'
'ContentModerator'
'ContentSafety'
'ConversationalLanguageUnderstanding'
'CustomVision.Prediction'
'CustomVision.Training'
'Face'
'FormRecognizer'
'HealthInsights'
'ImmersiveReader'
'Internal.AllInOne'
'LanguageAuthoring'
'LUIS'
'LUIS.Authoring'
'MetricsAdvisor'
'OpenAI'
'Personalizer'
'QnAMaker'
'QnAMaker.v2'
'SpeechServices'
'TextAnalytics'
'TextTranslation'
Expand Down
11 changes: 9 additions & 2 deletions avm/res/cognitive-services/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ param name string

@description('Required. Kind of the Cognitive Services. Use \'Get-AzCognitiveServicesAccountSku\' to determine a valid combinations of \'kind\' and \'SKU\' for your Azure region.')
@allowed([
'AIServices'
'AnomalyDetector'
'Bing.Autosuggest.v7'
'Bing.CustomSearch'
Expand All @@ -16,16 +17,22 @@ param name string
'CognitiveServices'
'ComputerVision'
'ContentModerator'
'ContentSafety'
'ConversationalLanguageUnderstanding'
'CustomVision.Prediction'
'CustomVision.Training'
'Face'
'FormRecognizer'
'HealthInsights'
'ImmersiveReader'
'Internal.AllInOne'
'LUIS'
'LUIS.Authoring'
'LanguageAuthoring'
'MetricsAdvisor'
'OpenAI'
'Personalizer'
'QnAMaker'
'QnAMaker.v2'
'SpeechServices'
'TextAnalytics'
'TextTranslation'
Expand Down Expand Up @@ -189,7 +196,7 @@ resource cMKUserAssignedIdentity 'Microsoft.ManagedIdentity/userAssignedIdentiti
scope: resourceGroup(split((customerManagedKey.?userAssignedIdentityResourceId ?? '//'), '/')[2], split((customerManagedKey.?userAssignedIdentityResourceId ?? '////'), '/')[4])
}

resource cognitiveService 'Microsoft.CognitiveServices/accounts@2022-12-01' = {
resource cognitiveService 'Microsoft.CognitiveServices/accounts@2023-05-01' = {
name: name
kind: kind
identity: identity
Expand Down
17 changes: 12 additions & 5 deletions avm/res/cognitive-services/account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"_generator": {
"name": "bicep",
"version": "0.24.24.22086",
"templateHash": "13697179912910947708"
"templateHash": "14501144781393850379"
},
"name": "Cognitive Services",
"description": "This module deploys a Cognitive Service.",
Expand Down Expand Up @@ -452,6 +452,7 @@
"kind": {
"type": "string",
"allowedValues": [
"AIServices",
"AnomalyDetector",
"Bing.Autosuggest.v7",
"Bing.CustomSearch",
Expand All @@ -461,16 +462,22 @@
"CognitiveServices",
"ComputerVision",
"ContentModerator",
"ContentSafety",
"ConversationalLanguageUnderstanding",
"CustomVision.Prediction",
"CustomVision.Training",
"Face",
"FormRecognizer",
"HealthInsights",
"ImmersiveReader",
"Internal.AllInOne",
"LUIS",
"LUIS.Authoring",
"LanguageAuthoring",
"MetricsAdvisor",
"OpenAI",
"Personalizer",
"QnAMaker",
"QnAMaker.v2",
"SpeechServices",
"TextAnalytics",
"TextTranslation"
Expand Down Expand Up @@ -733,7 +740,7 @@
},
"cognitiveService": {
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2022-12-01",
"apiVersion": "2023-05-01",
"name": "[parameters('name')]",
"kind": "[parameters('kind')]",
"identity": "[variables('identity')]",
Expand Down Expand Up @@ -1523,14 +1530,14 @@
"metadata": {
"description": "The principal ID of the system assigned identity."
},
"value": "[coalesce(tryGet(tryGet(reference('cognitiveService', '2022-12-01', 'full'), 'identity'), 'principalId'), '')]"
"value": "[coalesce(tryGet(tryGet(reference('cognitiveService', '2023-05-01', 'full'), 'identity'), 'principalId'), '')]"
},
"location": {
"type": "string",
"metadata": {
"description": "The location the resource was deployed into."
},
"value": "[reference('cognitiveService', '2022-12-01', 'full').location]"
"value": "[reference('cognitiveService', '2023-05-01', 'full').location]"
}
}
}

0 comments on commit 4bfc609

Please sign in to comment.