white-cat-90296
08/27/2021, 8:30 AMskip_provider_registration
flag.
Any ideas why this behaviour occurs and what is a workaround in Pulumi?
Note: This only occurs when I am using a method for Getting an existing registry by name and resource group. If I am creating resources, I am experiencing no issues.
Error: invocation of azure:containerservice/getRegistry:getRegistry returned an error: 1 error occurred:
* Error ensuring Resource Providers are registered.
Terraform automatically attempts to register the Resource Providers it supports to
ensure it's able to provision resources.
If you don't have permission to register Resource Providers you may wish to use the
"skip_provider_registration" flag in the Provider block to disable this functionality.
Please note that if you opt out of Resource Provider Registration and Terraform tries
to provision a resource from a Resource Provider which is unregistered, then the errors
may appear misleading - for example:
> API version 2019-XX-XX was not found for Microsoft.Foo
acoustic-alarm-43219
08/27/2021, 8:40 AMwhite-cat-90296
08/27/2021, 8:43 AMacoustic-alarm-43219
08/27/2021, 8:52 AMwhite-cat-90296
08/27/2021, 8:57 AM@pulumi/azure
npm package, make sure you're using the @pulumi/azure_native
package.
So a simple change to the code.
// Instead of something like this
import * as azure from '@pulumi/azure';
const registry = azure.containerservice.getRegistry({
name: "myregistryname",
resourceGroupName: "myresourcegroupname",
});
//====================================================
// Use something like THIS instead (Notice: different package)
import * as containerregistry from '@pulumi/azure-native/containerregistry';
const registry = containerregistry.getRegistry({
registryName: "myregistryname",
resourceGroupName "myresourcegroupname"
});
boundless-car-60268
08/27/2021, 9:35 AMSkipProviderRegistration
flag to true in the Azure config. This can be done by adding the following to the config
section in the yaml:
azure:skip_provider_registration: "true"
azure
provider uses Terraform under the covers.white-cat-90296
08/27/2021, 9:41 AM