Skip to content

fix(export): do not enable a connector whose data source could not be resolved - #373

Open
jlinenkohl wants to merge 1 commit into
microsoft:mainfrom
jlinenkohl:fix-connector-toggle-guard
Open

jlinenkohl wants to merge 1 commit into
microsoft:mainfrom
jlinenkohl:fix-connector-toggle-guard

Conversation

@jlinenkohl

Copy link
Copy Markdown

Both exporters infer the AppInsights and LogAnalytics toggles from the presence of a connector of that type, then read its resource id from properties.dataSource or extendedProperties.armResourceId. ARM does not return dataSource on read, and on an agent whose connector predates the current validation rules extendedProperties is null too, so the id comes back empty while the toggle is still set to true.

The deployment then fails, every time, on a resource the clone did not need:

InvalidRequestParameter: The object validation failed:
Agent DataConnector 'log-analytics': DataSource is required. is invalid.

Both the bash and the PowerShell clone path failed this way against the same source agent, which stops the whole deployment rather than skipping one connector. The toggle is now set only when a resource id was actually resolved, and a warning names the connector that was left out.

The same root cause affects connectors carried in the connectors array rather than through a toggle, and there it cannot be fixed by inference: ARM simply does not return dataSource, so every exported Kusto, IcM or similar connector has an empty one and the deployment fails on each in turn, from inside the ARM operation and long after validation passed. clone-agent.sh now reports those connectors by name during validation and points at the --override flag it already supports, so the operator can supply the values before anything is created instead of discovering them one failed deployment at a time.

… resolved

Both exporters infer the AppInsights and LogAnalytics toggles from the presence
of a connector of that type, then read its resource id from
properties.dataSource or extendedProperties.armResourceId. ARM does not return
dataSource on read, and on an agent whose connector predates the current
validation rules extendedProperties is null too, so the id comes back empty
while the toggle is still set to true.

The deployment then fails, every time, on a resource the clone did not need:

    InvalidRequestParameter: The object validation failed:
    Agent DataConnector 'log-analytics': DataSource is required. is invalid.

Both the bash and the PowerShell clone path failed this way against the same
source agent, which stops the whole deployment rather than skipping one
connector. The toggle is now set only when a resource id was actually resolved,
and a warning names the connector that was left out.

The same root cause affects connectors carried in the connectors array rather
than through a toggle, and there it cannot be fixed by inference: ARM simply
does not return dataSource, so every exported Kusto, IcM or similar connector
has an empty one and the deployment fails on each in turn, from inside the ARM
operation and long after validation passed. clone-agent.sh now reports those
connectors by name during validation and points at the --override flag it
already supports, so the operator can supply the values before anything is
created instead of discovering them one failed deployment at a time.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant