Hello! we are trying to import an existing resour...
# azure
s
Hello! we are trying to import an existing resource from pulumi azure. we have multiple subscriptions, so we are using provider to specify subscription dynamically at the definition (https://github.com/pulumi/pulumi-azure/issues/466) . Though this works for the code and new creation, importing an already existing resource in azure is an issue if we import the resource and the change the provider after import. example: pulumi import azurecore/resourceGroupResourceGroup example-resources /subscriptions/{subscription-id}/resourceGroups/example-resources then code change to have provider
Copy code
config = pulumi.Config() 
subscription_id = config.require("subscriptionId")
 # Create an Azure provider 
provider = azure.Provider("azure", subscription_id=subscription_id) 
# Define a resource group 
resource_group = azure.core.ResourceGroup( "example-resources", name="example-resources", location="West Europe", opts=pulumi.ResourceOptions(provider=provider) )
then pulumi try to delete and create the resource which is not something we want (will error) Is there a better way to import this resource without deleting?