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

VS Code Bicep Extension marks module references to private registries as errors. #15843

Open
Steviestevson opened this issue Dec 13, 2024 · 7 comments

Comments

@Steviestevson
Copy link

Bicep version
VS Code Bicep Extension v0.32.4

Describe the bug
Ever since I use v032.4 all my module references to my private registry are shown as errors. The module references show as

The OCI artifact module alias name "redacted" does not exist in the built-in Bicep configuration.bicep[BCP213]

My module reference is looking like this:

module Redacted 'br/redacted:resourcegroup:0.2' = {
  name: redacted
  scope: subscription(redacted)
  params: {
    paramResourceGroupName: redacted
    location: location
    tags: tags
  }
}

To Reproduce
Steps to reproduce the behavior: Update the bicep extension to v0.32.4

Additional context
Downgrading the extension to v0.31.92 fixes the errors.

@jeskew
Copy link
Contributor

jeskew commented Dec 13, 2024

Is the private registry something you authenticate to? Wondering if this may be related to #15403

@Steviestevson
Copy link
Author

yes, the private registry I use is an azure container registry. I authenticate using Azure CLI and my user.

@StephenWeatherford
Copy link
Contributor

StephenWeatherford commented Dec 18, 2024

#15403 shouldn't affect module restoration. I'm not seeing this issue in 0.32, at least not on Mac.

@Steviestevson it sounds like it's not finding the bicepconfig.json file. The error message should say "The OCI artifact module alias name "redacted" does not exist in the Bicep configuration "/user/path/bicepconfig.json" if it's finding the bicepconfig.json.

Where is the bicepconfig.json in relation to your bicep file? It should find it in any parent folder.

@Steviestevson
Copy link
Author

Steviestevson commented Dec 23, 2024

Hey @StephenWeatherford !

sorry for late response. My bicepconfig.json is living in the same folder as my deplyoment and param files.

@Steviestevson
Copy link
Author

Steviestevson commented Dec 23, 2024

@StephenWeatherford
There are updates:
My Windows device (bicep extension version: 0.32.4 AND 0.31.92) both show the same issue. It seems that bicep is unable to find my bicepconfig.json.

It does not matter where the bicepconfig file is saved. I also tried recreating the file from the VS Code dialogue.

When using literal paths to my modules, no error arise.

@Steviestevson
Copy link
Author

@StephenWeatherford
Another update:

The error seems to be connected to the pathing (name of the repo). The name of the repo includes a 'space' (%20).

Might be related to #11469?

When I move the files to a path without a 'space' - everything works fine

@StephenWeatherford
Copy link
Contributor

@Steviestevson Great observation. Adding @shenglol who was doing some engineering work around our use of file path URIs. Otherwise I can take a look week after next.

@shenglol shenglol modified the milestones: v0.33, v0.34 Jan 7, 2025
@shenglol shenglol moved this from Todo to In Progress in Bicep Jan 7, 2025
@shenglol shenglol modified the milestones: v0.34, v0.33 Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: In Progress
Development

No branches or pull requests

4 participants