-
Notifications
You must be signed in to change notification settings - Fork 390
[AZINTS] fix forwarder v4 model upgrade #938
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
Conversation
df7d089
to
9951913
Compare
f1d67f8
to
706d510
Compare
Datadog Summary✅ Code Quality ✅ Code Security ✅ Dependencies Was this helpful? Give us feedback! |
{ | ||
"type": "Microsoft.ManagedIdentity/userAssignedIdentities", | ||
"apiVersion": "2023-01-31", | ||
"name": "[concat('syncFunctionTriggers-', parameters('functionAppName'), '-identity')]", | ||
"location": "[parameters('location')]" | ||
}, | ||
{ | ||
"type": "Microsoft.Authorization/roleAssignments", | ||
"apiVersion": "2022-04-01", | ||
"name": "[guid('syncFunctionTriggers-', parameters('functionAppName'))]", | ||
"properties": { | ||
"roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', 'de139f84-1756-47ae-9be6-808fbbe84772')]", | ||
"principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', concat('syncFunctionTriggers-', parameters('functionAppName'), '-identity')), '2023-01-31').principalId]", | ||
"principalType": "ServicePrincipal" | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', concat('syncFunctionTriggers-', parameters('functionAppName'), '-identity'))]" | ||
] | ||
}, | ||
{ | ||
"type": "Microsoft.Resources/deploymentScripts", | ||
"apiVersion": "2023-08-01", | ||
"name": "[concat('syncFunctionTriggers-', parameters('functionAppName'))]", | ||
"location": "[parameters('location')]", | ||
"kind": "AzureCLI", | ||
"identity": { | ||
"type": "UserAssigned", | ||
"userAssignedIdentities": { | ||
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', concat('syncFunctionTriggers-', parameters('functionAppName'), '-identity'))]": {} | ||
} | ||
}, | ||
"properties": { | ||
"azCliVersion": "2.67.0", | ||
"scriptContent": "[format('az rest --url ''https://management.azure.com{0}/syncfunctiontriggers?api-version=2024-04-01'' --method post', resourceId('Microsoft.Web/sites', parameters('functionAppName')))]", | ||
"timeout": "PT30M", | ||
"cleanupPreference": "OnSuccess", | ||
"retentionInterval": "P1D", | ||
"storageAccountSettings": { | ||
"storageAccountName": "[variables('storageAccountName')]", | ||
"storageAccountKey": "[listKeys(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName')), '2019-06-01').keys[0].value]" | ||
} | ||
}, | ||
"dependsOn": [ | ||
"[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', concat('syncFunctionTriggers-', parameters('functionAppName'), '-identity'))]", | ||
"[resourceId('Microsoft.Web/sites/extensions', parameters('functionAppName'), 'zipdeploy')]" | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all this just to sync function triggers :cry_cat:
}, | ||
"properties": { | ||
"azCliVersion": "2.67.0", | ||
"scriptContent": "[format('az rest --url ''https://management.azure.com{0}/syncfunctiontriggers?api-version=2024-04-01'' --method post', resourceId('Microsoft.Web/sites', parameters('functionAppName')))]", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this mean we'd lose support for azure gov? (we can always follow up on that if needed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
updated to not hard code 🫡
What does this PR do?
In the upgrade, I added this setting which the docs said should improve performance (while disallowing portal editing, which was already not working since using v4 breaks this). Instead, it seems to have broken the initial deployment, which slipped through the cracks when testing. This reverts that change to restore the ARM template functionality.
Motivation
Testing Guidelines
Replace the variable in the parent template with:
And run
az deployment group create --resource-group your-resource-group --template-file azure/eventhub_log_forwarder/parent_template.json --parameters apiKey=$DD_API_KEY
validated from a fresh deploy:
az deployment group create --resource-group ava-test-3 --template-file azure/eventhub_log_forwarder/parent_template.json --parameters apiKey=$DD_API_KEY datadogTags=ava:true
Added a diagnostic setting on a loggy instance to point to the eventhub, spammed logs, and observed logs coming in:

Additional Notes
Types of changes
Check all that apply