Skip to content
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

[Bug Report]: Publishing of resources with '--' in name fails (gracefully) #3592

Open
14 tasks
MariusStorhaug opened this issue Aug 20, 2023 · 4 comments
Open
14 tasks
Labels
bug Something isn't working

Comments

@MariusStorhaug
Copy link
Contributor

MariusStorhaug commented Aug 20, 2023

Describe the bug

Modules with a name containing '--' seems to be failing the publishing step as the ACR repos do not allow for consecutive '.', '_' or '-' characters.

From: https://github.com/Azure/ResourceModules/actions/runs/5811199687/job/15754407806#step:4:610

 - [digital-twins/digital-twins-instances/endpoints--service-bus] [latest]
  VERBOSE: Invoke task with
  VERBOSE: {
    "TemplateFilePath": "/home/runner/work/ResourceModules/ResourceModules/modules/digital-twins/digital-twins-instances/endpoints--service-bus/main.bicep",
    "BicepRegistryRgName": "artifacts-rg",
    "BicepRegistryRgLocation": "West Europe",
    "ModuleVersion": "latest",
    "BicepRegistryName": "adpsxxazacrx001"
  }
  
  VERBOSE: Performing the operation "Publish" on target "Private bicep registry entry [bicep/modules/digital-twins.digital-twins-instances.endpoints--service-bus] version [latest] to registry [adpsxxazacrx001]".
  The specified OCI artifact reference "br:adpsxxazacrx001.azurecr.io/bicep/modules/digital-twins.digital-twins-instances.endpoints--service-bus:latest" is not valid. The module path segment "digital-twins.digital-twins-instances.endpoints--service-bus" is not valid. Each module name path segment must be a lowercase alphanumeric string optionally separated by a ".", "_" , or "-".
  VERBOSE: Publish complete

2 tasks:

  • Fix the publishing logic to fail the pipeline if the publishing fails.
  • Look at how to handle naming of resources when published to ACR (atleast). Other resources with the same issue:
    • digital-twins\digital-twins-instances\ pipeline
      • endpoints--event-grid
      • endpoints--event-hub
      • endpoints--service-bus
    • web\hosting-environments\ pipeline
      • configurations--customdnssuffix
      • configurations--networking
    • web\sites\ pipeline
      • config--appsettings
      • config--authsettingsv2
      • slots\config--appsettings
      • slots\config--authsettingsv2

To reproduce

Review the Digital Twins pipeline

Code snippet

No response

Relevant log output

No response

@MariusStorhaug MariusStorhaug added the bug Something isn't working label Aug 20, 2023
@MariusStorhaug MariusStorhaug changed the title [Bug Report]: Publishing of resources with '--' fails (gracefully) [Bug Report]: Publishing of resources with '--' in name fails (gracefully) Aug 20, 2023
@ChrisGibson1982
Copy link

Is there any resolution to this?

@ChrisGibson1982
Copy link

This is present in web\sites\hosting-environment as well

@AlexanderSehr AlexanderSehr added this to the Azure Verfified Modules (AVM) - CI Issues milestone May 19, 2024
@AlexanderSehr
Copy link
Contributor

Hey @eriqua, however we solve this - this should then also be consider for BRM if we ever get to publish child-modules.

There may be a fast workaround by updating the publishing in CARML to replace the -- with something that is allowed. However, I believe the 'correct' yet more intense solution would be to stop having different child-modules for the same sub-resource-type and instead have one with a corresponding User-Defined-Type interface for each collection of properties based on a discriminator. By now, this feature was added to the Bicep language, so we could implement it.

@eriqua
Copy link
Contributor

eriqua commented Jun 2, 2024

@AlexanderSehr sounds fair. Not sure what should be the best place for this issue though. l'd like to avoid implementing a convention in CARML and changing that later to align to BRM once we get to publishing children. I'm almost inclined to put this on hold until defining the convention in AVM. Meanwhile nothing prevents to test a possible implementation of course, but I wouldn't merge to main yet.

@AlexanderSehr AlexanderSehr removed this from the Azure Verfified Modules (AVM) - CI Issues milestone Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Needs triage
Development

No branches or pull requests

4 participants