Hi, can anyone help? I'm having an issue where I c...
# typescript
Hi, can anyone help? I'm having an issue where I can create an Azure Front Door but can't update it. If I change any configuration, then
pulumi up
again to apply the update, I get this error:
Copy code
error: Plan apply failed: 1 error occurred:
* updating urn:pulumi:lab::app-service::azure:frontdoor/frontdoor:Frontdoor::myfrontdoor: A resource with the ID "/subscriptions/{guid}/resourcegroups/my-rg/providers/Microsoft.Network/frontdoors/myfrontdoor" already exists - to be managed via Terraform this resource needs to be imported into the State.
It seems as if it's trying to create the resource again? Here's my code:
Copy code
const frontDoor = new azure.frontdoor.Frontdoor('myfrontdoor', {
    resourceGroupName: resourceGroup.name,
    tags: defaultTags,
    name: 'myfrontdoor',
    frontendEndpoints: [{
        name: 'myfrontdoor-azurefd-net',
        hostName: '<http://myfrontdoor.azurefd.net|myfrontdoor.azurefd.net>',
    backendPools: [{
        name: 'backendPoolAll',
        backends: [{
            address: '<http://myapp.azurewebsites.net|myapp.azurewebsites.net>',
            hostHeader: '<http://myapp.azurewebsites.net|myapp.azurewebsites.net>',
            httpPort: 80,
            httpsPort: 443,
            priority: 1,
            weight: 100,
            enabled: true
        healthProbeName: 'tdylabHealthProbeSettings',
        loadBalancingName: 'tdylabLoadBalancingSettings',
    // etc.
    // <other config snipped>
I also tried again using the example code from the docs and ran into the same issue. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/azure/frontdoor/#Frontdoor
If you run
pulumi stack
, do you see the
resource in the resource list in the output?
Yes it's showing up there:
Copy code
TYPE                                    NAME
pulumi:pulumi:Stack                     my-lab
azure:frontdoor/frontdoor:Frontdoor     myfrontdoor
Can you provide the full output of
pulumi preview --diff
? It seems like Pulumi might be trying to replace the resource and by default Pulumi will try to create the new resource first before deleting the old and this is causing the conflict (maybe).