Bicep error code - BCP192

This error occurs when Bicep can't copy the external module to the local cache. For example, an incorrect module reference. For more information about using modules in Bicep and Bicep restore, see Bicep modules.

Error description

Unable to restore the artifact with reference <reference>: <error-message>.

Solution

Fix the module reference.

Examples

The following example raises the error because the public module version doesn't exist:

module storage 'br/public:avm/res/storage/storage-account:0.1.0' = {
  name: 'myStorage'
  params: {
    name: 'store${resourceGroup().name}'
  }
}

The following example raises the error because there is a typo in the reference:

module storage 'br/public:avm/res/storage/storage-account1:0.11.1' = {
  name: 'myStorage'
  params: {
    name: 'store${resourceGroup().name}'
  }
}

You can fix the error by correct the AVM reference and the version:

module storage 'br/public:avm/res/storage/storage-account:0.11.1' = {
  name: 'myStorage'
  params: {
    name: 'store${resourceGroup().name}'
  }
}

Next steps

For more information about Bicep error and warning codes, see Bicep core diagnostics.