[Digital Twins] Migrate to Bicep (#30868)

And update API versions.

Live tests run:
https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4075002&view=results
This commit is contained in:
Deyaaeldeen Almahallawi 2024-08-23 14:02:58 -07:00 коммит произвёл GitHub
Родитель da3fe5b52c
Коммит 71b13fa44e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
3 изменённых файлов: 26 добавлений и 54 удалений

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

@ -1,54 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The base resource name that is used to ensure the generated resources have unique names. This field gets automatically generated on our CI pipelines. It's possible to use non-alphanumeric characters in some resource names, like dashes in KV names, but keeping it simple will reduce confusion. A safe upper limit on the number of characters is 17 characters."
}
},
"tenantId": {
"type": "string",
"metadata": {
"description": "The tenant ID to which the application and resources belong. You may copy it from the one available on the overview page of the Azure Active Directory section of the Azure portal, or obtain it from the overview page of a recently created Azure Application."
}
},
"testApplicationOid": {
"type": "string",
"metadata": {
"description": "The client OID to grant access to test resources."
}
}
},
"variables": {
"location": "westus2",
"azureDigitalTwins": "[parameters('baseName')]",
"contributorRole": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/b24988ac-6180-42a0-ab88-20f7382dd24c')]"
},
"resources": [
{
"type": "Microsoft.DigitalTwins/digitalTwinsInstances",
"apiVersion": "2020-10-31",
"name": "[variables('azureDigitalTwins')]",
"location": "[variables('location')]",
"properties": {}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2018-09-01-preview",
"name": "[guid(resourceGroup().id, 'roleAssignment')]",
"properties": {
"roleDefinitionId": "[variables('contributorRole')]",
"principalId": "[parameters('testApplicationOid')]"
}
}
],
"outputs": {
"AZURE_DIGITALTWINS_URL": {
"type": "string",
"value": "[concat('https://', reference(variables('azureDigitalTwins')).hostName)]"
}
}
}

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

@ -4,6 +4,7 @@ extends:
template: /eng/pipelines/templates/stages/archetype-sdk-tests.yml
parameters:
PackageName: "@azure/digital-twins-core"
Location: "westus2"
ServiceDirectory: digitaltwins
MatrixFilters:
- TestType=^(?!sample).*

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

@ -0,0 +1,25 @@
param baseName string = resourceGroup().name
param location string = resourceGroup().location
param testApplicationOid string
var azureDigitalTwins = baseName
var contributorRole = 'b24988ac-6180-42a0-ab88-20f7382dd24c'
// Microsoft.DigitalTwins/digitalTwinsInstances resource
resource digitalTwinsInstance 'Microsoft.DigitalTwins/digitalTwinsInstances@2023-01-31' = {
name: azureDigitalTwins
location: location
}
// Microsoft.Authorization/roleAssignments resource
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id, 'roleAssignment')
properties: {
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', contributorRole)
principalId: testApplicationOid
}
}
// Outputs
output AZURE_DIGITALTWINS_URL string = 'https://${digitalTwinsInstance.properties.hostName}'