Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARM managementGroup scope function validate #1428

Open
drewkg opened this issue Dec 10, 2021 · 1 comment
Open

ARM managementGroup scope function validate #1428

drewkg opened this issue Dec 10, 2021 · 1 comment

Comments

@drewkg
Copy link

drewkg commented Dec 10, 2021

I am note sure if this is a tooling issue or schema validation issue, but when I use the managementGroup() function in a ARM template I get the following message in VS Code

Template validation failed: The template resource XXXX. The template function 'managementGroup' is not valid. Please see https://aka.ms/arm-template-expressions for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.

I am specifically using managementGroup().name. The template does deploy correctly.

Resource snippet -
{
"name": "[substring(replace(guid(format('Security Center (MG {0})', managementGroup().name)), '-', ''), 0, 24)]",
"type": "Microsoft.Authorization/policyAssignments",
"apiVersion": "2021-06-01",
"location": "[parameters('location')]",
"scope": "[tenantResourceId('Microsoft.Management/managementGroups', managementGroup().name)]",
"identity": {
"type": "SystemAssigned"
},
"properties": {
"displayName": "[format('Security Center (MG {0})', managementGroup().name)]",
"description": "Applies Security Center Settings to an Azure Subscription.",
"policyDefinitionId": "[extensionResourceId(tenantResourceId('Microsoft.Management/managementGroups', managementGroup().name), 'Microsoft.Authorization/policySetDefinitions', 'securitycenter-deploy-initiative')]",
"parameters": {
"autoProvisioningSetting": {
"value": "[parameters('autoProvisioningSetting')]"
},
"logAnalytics": {
"value": "[concat('/subscriptions/', parameters('logAnalyticsSubscription'), '/resourceGroups/', parameters('logAnalyticsResourceGroup'), '/providers/Microsoft.OperationalInsights/workspaces/', parameters('logAnalyticsWorkspace'))]"
}
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants