Skip to content

Failed to handle complex arrays containing nested objects Β #209

@oolubodun

Description

@oolubodun

Hi there,

I have been successfully using this agent task for replacing tokens in my appsettings.json files. However, it's failing when I try using a template with nested objects.

Environment: Azure DevOps

Steps to reproduce:
Source Content
"AzureSettings": { "BlobServiceUrl": "your-connection-string", "ResourceGroupName": "your-storage-account-resource-group-name", "ResourceId": "your-client-id", "SubscriptionId": "your-subscription-id", "TenantId": "your-tenant-id", "StorageAccounts": [ { "Name": "your-storage-account-name", "StorageContainers": [ { "Name": "your-storage-container-name", "OutputPath": "your-storage-container-output-path", "Path": "your-storage-container-path", "SubFolder": "your-storage-container-path-subfolder", "SupportedDocTypes": [ { "FileExtension": "file-extension", "Path": "storage-container-path-for-supported-doc-type" } ] } ] } ] }

Generated Output:
"AzureSettings": { "BlobServiceUrl": "__AzureSettings.BlobServiceUrl__", "ResourceGroupName": "__AzureSettings.ResourceGroupName__", "ResourceId": "__AzureSettings.ResourceId__", "SubscriptionId": "__AzureSettings.SubscriptionId__", "TenantId": "__AzureSettings.TenantId__", "StorageAccounts": [ { "Name": "__AzureSettings.StorageAccounts[0].Name__", "StorageContainers": [ { "Name": "__AzureSettings.StorageAccounts[0].Name__", "Path": "your-storage-container-path", "SubFolder": "your-storage-container-path-subfolder", "OutputPath": "your-storage-container-output-path", "SupportedDocTypes": [ { "FileExtension": "file-extension", "Path": "storage-container-path-for-supported-doc-type" } ] } ] } ] }

Expected Output:
"AzureSettings": { "BlobServiceUrl": "__AzureSettings.BlobServiceUrl__", "ResourceGroupName": "__AzureSettings.ResourceGroupName__", "ResourceId": "__AzureSettings.ResourceId__", "SubscriptionId": "__AzureSettings.SubscriptionId__", "TenantId": "__AzureSettings.TenantId__", "StorageAccounts": [ { "Name": "__AzureSettings.StorageAccounts[0].Name__", "StorageContainers": [ { "Name": "__AzureSettings.StorageAccounts[0].StorageContainers[0].Name__", "OutputPath": "__AzureSettings.StorageAccounts[0].StorageContainers[0].OutputPath__", "Path": "__AzureSettings.StorageAccounts[0].StorageContainers[0].Path__", "SubFolder": "__AzureSettings.StorageAccounts[0].StorageContainers[0].SubFolder__", "SupportedDocTypes": [ { "FileExtension": "__AzureSettings.StorageAccounts[0].StorageContainers[0].SupportedDocTypes[0].FileExtension__", "Path": "__AzureSettings.StorageAccounts[0].StorageContainers[0].SupportedDocTypes[0].Path__" }, ... ] } ] } ] }

As you can see, only a partial transformation has occurred. Nested object properties (e.g., Path, SubFolder, etc. under StorageContainers and FileExtension, Path under SupportedDocTypes) are being ignored.

Please let me know if you need any further information to investigate this issue.

Kind regards,
Olu...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions