Skip to content

[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

Merged
merged 12 commits into from
May 13, 2025

Conversation

ava-silver
Copy link
Contributor

@ava-silver ava-silver commented May 12, 2025

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:

    "functionAppTemplateLink": "https://raw.githubusercontent.com/DataDog/datadog-serverless-functions/refs/heads/ava.silver/azints/fix-v4-upgrade/azure/eventhub_log_forwarder/function_template.json",

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:
image

Additional Notes

Types of changes

  • Bug fix
  • New feature
  • Breaking change
  • Misc (docs, refactoring, dependency upgrade, etc.)

Check all that apply

  • This PR's description is comprehensive
  • This PR contains breaking changes that are documented in the description
  • This PR introduces new APIs or parameters that are documented and unlikely to change in the foreseeable future
  • This PR impacts documentation, and it has been updated (or a ticket has been logged)
  • This PR's changes are covered by the automated tests
  • This PR collects user input/sensitive content into Datadog
  • This PR passes the integration tests (ask a Datadog member to run the tests)
  • This PR passes the unit tests
  • This PR passes the installation tests (ask a Datadog member to run the tests)

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ava-silver ava-silver force-pushed the ava.silver/azints/fix-v4-upgrade branch from df7d089 to 9951913 Compare May 12, 2025 19:29
@ava-silver ava-silver changed the title [AZINTS] fix v4 upgrade [AZINTS] fix forwarder v4 model upgrade May 12, 2025
@ava-silver ava-silver marked this pull request as ready for review May 12, 2025 19:37
@ava-silver ava-silver requested a review from a team as a code owner May 12, 2025 19:37
@ava-silver ava-silver requested review from benjjs and mattsp1290 May 12, 2025 19:37
@ava-silver ava-silver force-pushed the ava.silver/azints/fix-v4-upgrade branch from f1d67f8 to 706d510 Compare May 12, 2025 21:29
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented May 12, 2025

Datadog Summary

✅ Code Quality    ✅ Code Security    ✅ Dependencies


Was this helpful? Give us feedback!

Comment on lines 165 to 210
{
"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')]"
]
Copy link
Contributor Author

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:

@ava-silver ava-silver requested review from mattsp1290 and agulen and removed request for benjjs May 13, 2025 14:21
},
"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')))]",
Copy link
Member

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)

Copy link
Contributor Author

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 🫡

@ava-silver ava-silver merged commit 69a47d0 into master May 13, 2025
10 checks passed
@ava-silver ava-silver deleted the ava.silver/azints/fix-v4-upgrade branch May 13, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants