Skip to content

Conversation

@polatengin
Copy link
Member

@polatengin polatengin commented Dec 10, 2025

Fixes #18420

Description

This change ensures bicepparam files honor resource-derived parameter types when consuming OCI or template-spec modules by resolving any unresolved resource-derived metadata from compiled module parameters through the local ResourceDerivedTypeResolver, eliminating BCP033 diagnostics for patterns like resourceInput<'Microsoft.Network/routeTables'>.properties.routes?.

The fix is implemented in DeclaredTypeManager so parameter assignment types pulled via using benefit from the same resource-derived resolution as in-module consumption, and I added an integration test that publishes a mock registry module with a resource-derived parameter, consumes it from a params file, and asserts no diagnostics to prevent regressions.

Checklist

Microsoft Reviewers: Open in CodeFlow

@github-actions
Copy link
Contributor

github-actions bot commented Dec 10, 2025

Test this change out locally with the following install scripts (Action run 20732188677)

VSCode
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-vsix.sh) --run-id 20732188677
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-vsix.ps1) } -RunId 20732188677"
Azure CLI
  • Mac/Linux
    bash <(curl -Ls https://aka.ms/bicep/nightly-cli.sh) --run-id 20732188677
  • Windows
    iex "& { $(irm https://aka.ms/bicep/nightly-cli.ps1) } -RunId 20732188677"

@github-actions
Copy link
Contributor

Dotnet Test Results

   102 files   -     51     102 suites   - 51   38m 57s ⏱️ - 23m 41s
12 573 tests  -     12  12 573 ✅  -     11  0 💤 ±0  0 ❌  - 1 
28 891 runs   - 14 436  28 891 ✅  - 14 435  0 💤 ±0  0 ❌  - 1 

Results for commit aff03fa. ± Comparison against base commit 50ca350.

This pull request removes 1949 and adds 662 tests. Note that renamed tests count towards both.

		nestedProp1: 1
		nestedProp2: 2
		prop1: true
		prop2: false
	1
	2
	\$'")
	prop1: true
	prop2: false
…
Bicep.Cli.UnitTests.Services.ReplEnvironmentTests ‑ ShouldSubmitBuffer_terminates_at_expected_point ("var foo = {
")
Bicep.Cli.UnitTests.Services.ReplEnvironmentTests ‑ ShouldSubmitBuffer_terminates_at_expected_point ("var multilineString = '''
Line 1
Line 2
Line 3
'''")
Bicep.Cli.UnitTests.Services.ReplEnvironmentTests ‑ ShouldSubmitBuffer_terminates_at_expected_point ("var outRoleAssignments object[] = union(map(
  filter(varMockedEntraGroupIds, item => !contains(item.uniqueName, 'DevOps')),
  group => {
    principalId: group.groupId
    definition: group.roleToAssign
    relativeScope: ''
    principalType: 'Group'
  }
),[
  {
    principalId: '22222222-2222-2222-2222-222222222222'
    definition: 'Reader'
    relativeScope: ''
    principalType: 'ServicePrincipal'
  }
])")
Bicep.Cli.UnitTests.Services.ReplEnvironmentTests ‑ ShouldSubmitBuffer_terminates_at_expected_point ("var test = {
  abc: 'def' // boo
}")
Bicep.Cli.UnitTests.Services.ReplEnvironmentTests ‑ ShouldSubmitBuffer_terminates_at_expected_point ("var varMockedEntraGroupIds = [
  {
    uniqueName: 'Reader-Group'
    roleToAssign: 'Reader'
    groupId: '11111111-1111-1111-1111-111111111111'
  }
  {
    uniqueName: 'Contributor-Group'
    roleToAssign: 'Contributor'
    groupId: '22222222-2222-2222-2222-222222222222'
  }
  {
    uniqueName: 'DevOps-Group'
    groupId: '33333333-3333-3333-3333-333333333333'
  }
]")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
�ӻ
�@\u0010\u0005Щ�
�`���Y\u001b�����\u0008y�\u001a|\u0010!��\u0003��M\u001a��{��Lqa��8��P�S���pY\u0016��\u0006\u0000b�'\u0001�\u0013\u0010��{��V0�C�\u0008�}Ҝ��p��x��#�k��L�y3\��b/�h��+g���d[\u0017N\u0016��w�����&v��\u0016b
�a�S��&�}���ںA�$IB\u001bx\u0003�=�"\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��=
�@\u0010\u0005�=Œ\u0003�o���UHo#�x�Ռ��(I��xw�F���p��5S<\u0018�\u001e/�0�XI�i�!�5�\u001b\u00008k�	�9��?�{���@_p���\u0012@��'�\u0014�m�k*\u0019��;6�<����R�w��}�\u000e&\u0014����u�7{��>����%.�\u001d[8k\u0008\u000c����&�����ʖ�\u000c'Y�Rͥ^I�M�&\u001e:���[�$IB\u001fs\u0003|��5\u0000\u000c\u0000\u0000,"Value cannot be null. (Parameter 'source')")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000
��=
�@\u0010\u0005�=��\u00016o��\u0013�\u0014���DA��@\u0002*D�D\u0008xy�FLc\u0013#����L10���:�gy���R\u001a\u0015E���\u0001����\u0000�	�ܘg�&QS\u0007ne�^	�~R#qI�}|8ey-���4Б(�C�NJ]h4kǒG���\u001b�z]�e����|쿶�B���p�\u0010\u0014\u0000C��N�����p�l'��t�ج��X0�?c��<���\u0003��1\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��=
�@\u0010\u0005�=Ş`}�����O�+,D�\u000f��\u001f\u0014B�\u001eH\u0015l�\u0018-ܯy�\u0014\u000f��ӓ���?Wm�-æ��\u0006\u0000�e�\u00040O@xv�D@j�\u0015\u000c]�[\u0002h�\u000c���/�\u0010�\u0019��uMHL���ZW%;ɭq(D��`�q�u�hQ���?���\u0018�Y8�ͅ��\u000e�V����?_[7��(�h\u0003o/�ͣ\u0000\u000c\u0000\u0000,"The path: index.json was not found in artifact contents")
Bicep.Core.IntegrationTests.AzTypesViaRegistryTests ‑ Bicep_compiler_handles_corrupted_extension_package_gracefully (\u001f�\u0008\u0000\u0000\u0000\u0000\u0000\u0000\u0003��=
�@\u0010\u0005�s�%\u0007ؼI�'
\u0016��\u0011QA��@\u0016T0��\u0010��hc\u0013#����L10���*o�./ܥ�	#�$�
\u0000�R�\u0004\ud838\udc36o��\u0018M��\u000e\�:�\u0010@��\u0003q���h_\u0016����T\u0006q*����Fl�Nb���4\u001e�5i��u��=�N_���"�̆\u0015\u0012m\u0008\u000c@�褓�~��\u0016f��x�M���r\u0011\u000e������<ϣ�t\u0007\u0013�n�\u0000\u000c\u0000\u0000,"'7' is an invalid end of a number. Expected a delimiter. Path: $.INVALID_JSON | LineNumber: 0 | BytePositionInLine: 20.")
…

@voroniys
Copy link

voroniys commented Dec 30, 2025

Hey, Microsoft, is 3 weeks not enough time to just approve a fix to the nasty bug you've introduced?
At this moment almost all AVMs are affected by this bug.
Please give it a bit more priority!

@polatengin polatengin merged commit e033c73 into main Jan 5, 2026
44 checks passed
@polatengin polatengin deleted the polatengin/18420-bicepparam-files-fail-with-container-registry-modules-that-present-resource-derived-types-params branch January 5, 2026 23:17
@github-project-automation github-project-automation bot moved this from Todo to Done in Bicep Jan 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Bicepparam files fail with container registry modules that present resource derived types params

4 participants