Deyaaeldeen Almahallawi 2024-08-22 21:01:58 -07:00 коммит произвёл GitHub
Родитель 994d08c49e
Коммит a3bd451856
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: B5690EEEBB952194
6 изменённых файлов: 48 добавлений и 70 удалений

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

@ -5,5 +5,6 @@ extends:
parameters:
PackageName: "@azure-rest/maps-geolocation"
ServiceDirectory: maps
Location: 'eastus'
SupportedClouds: 'Public,Canary'
UseFederatedAuth: true

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

@ -5,5 +5,6 @@ extends:
parameters:
PackageName: "@azure-rest/maps-render"
ServiceDirectory: maps
Location: 'eastus'
SupportedClouds: 'Public,Canary'
UseFederatedAuth: true

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

@ -5,5 +5,6 @@ extends:
parameters:
PackageName: "@azure-rest/maps-route"
ServiceDirectory: maps
Location: 'eastus'
SupportedClouds: 'Public,Canary'
UseFederatedAuth: true

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

@ -5,5 +5,6 @@ extends:
parameters:
PackageName: "@azure-rest/maps-search"
ServiceDirectory: maps
Location: 'eastus'
SupportedClouds: 'Public,Canary'
UseFederatedAuth: true

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

@ -0,0 +1,44 @@
param baseName string = resourceGroup().name
param location string = resourceGroup().location
param testApplicationOid string
var mapsDataContributerRoleId = '8f5e0ce6-4f7b-4dcf-bddf-e6f48634a204'
var mapsAccountName = guid(resourceGroup().id, deployment().name, baseName)
// Microsoft.Maps/accounts resource
resource mapsAccount 'Microsoft.Maps/accounts@2024-01-01-preview' = {
name: mapsAccountName
location: location
sku: {
name: 'G2'
}
kind: 'Gen2'
identity: {
type: 'None'
}
properties: {
disableLocalAuth: false
cors: {
corsRules: [
{
allowedOrigins: [
'*'
]
}
]
}
}
}
// Microsoft.Authorization/roleAssignments resource
resource roleAssignment 'Microsoft.Authorization/roleAssignments@2022-04-01' = {
name: guid(resourceGroup().id)
properties: {
roleDefinitionId: resourceId('Microsoft.Authorization/roleDefinitions', mapsDataContributerRoleId)
principalId: testApplicationOid
}
}
// Outputs
output MAPS_SUBSCRIPTION_KEY string = mapsAccount.listKeys().primaryKey
output MAPS_RESOURCE_CLIENT_ID string = mapsAccount.properties.uniqueId

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

@ -1,70 +0,0 @@
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"baseName": {
"type": "string",
"defaultValue": "[resourceGroup().name]",
"metadata": {
"description": "The base resource name."
}
},
"testApplicationOid": {
"type": "string",
"metadata": {
"description": "The client OID to grant access to test resources."
}
}
},
"variables": {
"roleDefinitionId": "[concat('/subscriptions/', subscription().subscriptionId, '/providers/Microsoft.Authorization/roleDefinitions/8f5e0ce6-4f7b-4dcf-bddf-e6f48634a204')]",
"mapsAccountName": "[guid(resourceGroup().id, deployment().name, parameters('baseName'))]"
},
"resources": [
{
"type": "Microsoft.Maps/accounts",
"apiVersion": "2021-12-01-preview",
"name": "[variables('mapsAccountName')]",
"location": "eastus",
"sku": {
"name": "G2",
"tier": "Standard"
},
"kind": "Gen2",
"identity": {
"type": "None"
},
"properties": {
"disableLocalAuth": false,
"cors": {
"corsRules": [
{
"allowedOrigins": [
"*"
]
}
]
}
}
},
{
"type": "Microsoft.Authorization/roleAssignments",
"apiVersion": "2018-09-01-preview",
"name": "[guid(resourceGroup().id)]",
"properties": {
"roleDefinitionId": "[variables('roleDefinitionId')]",
"principalId": "[parameters('testApplicationOid')]"
}
}
],
"outputs": {
"MAPS_SUBSCRIPTION_KEY": {
"type": "string",
"value": "[listKeys(resourceId('Microsoft.Maps/accounts',variables('mapsAccountName')), '2021-12-01-preview').primaryKey]"
},
"MAPS_RESOURCE_CLIENT_ID": {
"type": "string",
"value": "[reference(resourceId('Microsoft.Maps/accounts',variables('mapsAccountName'))).uniqueId]"
}
}
}