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

ManagedEnvironment - Name -> EnvironmentName causing a replace #2305

Closed
michaelmcneilnet opened this issue Mar 16, 2023 · 3 comments
Closed
Labels
kind/bug Some behavior is incorrect or out of spec

Comments

@michaelmcneilnet
Copy link

What happened?

On Upgrading from Pulumi.AzureNative 1.64.1 -> 1.97.0 we see that ManagedEnvironmentArgs.Name has been replaced with ManagedEnvironmentArgs.EnvironmentName. When we change to use EnvironmentName, on pulumi up, we see it wants to replace the ManagedEnvironment.

How can we avoid a replacement?

Expected Behavior

Not to replace the environment.

Steps to reproduce

+-azure-native:app:ManagedEnvironment: (replace)
        [id=/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.App/managedEnvironments/xxx]
        [urn=urn:pulumi:dev::xxx::azure-native:app:ManagedEnvironment::ManagedEnvironment]
        [provider: urn:pulumi:dev::xxxx::pulumi:providers:azure-native::default_1_64_1::xxx => urn:pulumi:dev::xxxx::pulumi:providers:azure-native::default_1_97_0::output<string>]
      + environmentName: "AAA"
      - name           : "AAA"

Output of pulumi about

CLI
Version      3.57.1
Go Version   go1.20.1
Go Compiler  gc

Host
OS       Microsoft Windows 11 Pro
Version  10.0.22621 Build 22621
Arch     x86_64

Backend
Name           pulumi.com

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@michaelmcneilnet michaelmcneilnet added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Mar 16, 2023
@danielrbradley
Copy link
Member

Hi @michaelmcneilnet sorry the upgrade is not as smooth as it should be. Unfortunately this was quite a breaking changed introduced upstream by Azure/azure-rest-api-specs#19005

This general problem is being tracked in pulumi/pulumi#9115.

The workaround right now is to either:

@danielrbradley danielrbradley removed the needs-triage Needs attention from the triage team label Mar 17, 2023
@michaelmcneilnet
Copy link
Author

michaelmcneilnet commented Mar 17, 2023

Hi @danielrbradley thank you for the prompt response.

I went with the manual editing of the stack json,

pulumi stack export --file C:\Users\xxx\AppData\Local\Temp\stackimport.json -s dev
pulumi stack import --file C:\Users\xxx\AppData\Local\Temp\stackimport.json -s dev

but am still facing a replace, with the following output in preview

 +-azure-native:app:ManagedEnvironment: (replace)
        [id=/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.App/managedEnvironments/xxx]
        [urn=urn:pulumi:dev::xxx::azure-native:app:ManagedEnvironment::ManagedEnvironment]
        [provider: urn:pulumi:dev::xxx::pulumi:providers:azure-native::default_1_64_1::xxx => urn:pulumi:dev::xxx::pulumi:providers:azure-native::default_1_97_0::output<string>]
      + environmentName: "AAA"
      - name           : <null>

The only change I made in the json was to replace name with environmentName.

This is the section of json I changed, is that correct? (second last line)

"urn": "urn:pulumi:prod::xxx::azure-native:app:ManagedEnvironment::ManagedEnvironment",
"custom": true,
"id": "/subscriptions/xxx/resourceGroups/xxx/providers/Microsoft.App/managedenvironments/xxx",
"type": "azure-native:app:ManagedEnvironment",
"inputs": {
    "appLogsConfiguration": {
        "destination": "log-analytics",
        "logAnalyticsConfiguration": {
            "customerId": "xxx",
            "sharedKey": "xxx"
        }
    },
    "location": "northeurope",
    "environmentName": "xxx",
    "resourceGroupName": "xxx"
}

@michaelmcneilnet
Copy link
Author

Looks like it was the name in outputs I had to change, rather than the name in inputs, working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

2 participants