[Metrics Advisor] Migrate to Bicep (#30891)

And update API versions and add an AAD role assignment. The tests don't
use this script and use static resources instead so I won't run them.
This commit is contained in:
Deyaaeldeen Almahallawi 2024-08-23 16:14:15 -07:00 коммит произвёл GitHub
Родитель 038ed97cd2
Коммит cf8bd3dcde
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
2 изменённых файлов: 30 добавлений и 29 удалений

Просмотреть файл

@ -0,0 +1,30 @@
param location string = resourceGroup().location
param baseName string = resourceGroup().name
param testApplicationOid string
param metricsAdvisorName string = '${baseName}-metrics-advisor'
var metricsAdvisorAdminRoleId = 'cb43c632-a144-4ec5-977c-e80c4affc34a'
resource metricsAdvisorAccount 'Microsoft.CognitiveServices/accounts@2024-04-01-preview' = {
name: metricsAdvisorName
location: location
sku: {
name: 'S0'
}
kind: 'MetricsAdvisor'
properties: {
apiProperties: {}
customSubDomainName: metricsAdvisorName
publicNetworkAccess: 'Enabled'
}
}
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(metricsAdvisorAccount.id, 'MetricsAdvisorContributor')
properties: {
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', metricsAdvisorAdminRoleId)
principalId: testApplicationOid
}
}
output METRICS_ADVISOR_ENDPOINT string = metricsAdvisorAccount.properties.endpoint

Просмотреть файл

@ -1,29 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"accounts_js_metrics_advisor_name": {
"defaultValue": "js-metrics-advisor",
"type": "String"
}
},
"variables": {},
"resources": [
{
"type": "Microsoft.CognitiveServices/accounts",
"apiVersion": "2017-04-18",
"name": "[parameters('accounts_js_metrics_advisor_name')]",
"location": "westus2",
"sku": {
"name": "S0"
},
"kind": "MetricsAdvisor",
"properties": {
"apiProperties": {},
"customSubDomainName": "[parameters('accounts_js_metrics_advisor_name')]",
"privateEndpointConnections": [],
"publicNetworkAccess": "Enabled"
}
}
]
}