All, I want to pitch an idea for general discussio...
# azure
f
All, I want to pitch an idea for general discussion - The azure-native v2 provider is awesome, and we want to use for all of our resources - but due to a bug in the azure api, we can't manage one critical resource type. The v1 provider worked flawlessly though - so, rather than downgrade everything, I was wondering if I could install both v1 and v2. If I feed a v2
Provider
into the options of a v1 resource, what would happen 😅
Alternatively, the function that creates the problematic resource could pull out the relevant provider details, and build its own v1 provider 🤔
s
Hmmm…using an explicit provider for that particular resource seems like it should work. Haven’t tried it, though. Is there an issue open for the resource you’re having problems with under v2?
f
I'll give it a shot and report back with how it goes. There's a pulumi issue, an upstream azure issue, and now a PR against azure with a fix - but it looks like it'll be slow going, so hopefully this workaround works out. edit: slack 💔 markdown 😞
s
Yes, please let us know how your experiment goes!
f
Installing was extremely straight-forwards: `npm install azure-native-v1@npm:@pulumi/azure-native@1.x.x`; then I changed my import statement to point at said
azure-native-v1
alias, and so far it has just ... worked. Flawlessly. The v2 Provider can apparently be passed in just fine. Typescript compiles with no warnings, and the preview operation shows me exactly what I expect.
I still have some kinks to work out, unrelated to this adventure, mostly as a side-effect of not syncing for so long - I'll hit those in the morning, and hopefully get to the big deploy by EOD.
s
Awesome!
f
I'm now starting to see dozens of instances of https://github.com/pulumi/pulumi/issues/6768 ; though it doesn't look like anything to do with the v1 resources - it looks like it's just long json lines
The above error is gone - new issue looks like this:
Copy code
"autorest/azure: Service returned an error. Status=400 Code=\"MissingApiVersionParameter\" Message=\"The api-version query parameter (?api-version=) is required for all requests.\"\n"
This smells like a provider-vs-resource mismatch; it's probably time to make a v1 provider for my v1 resource
Update for this thread. With a sneaky little
(provider as any).__secret_v1_provider = provider1;
, and then unpacking that in the troublesome resource, we've been rocking v1 and v2 side by side for 6 months now. The PR against Azure is still open. Happy St. Patrick's Day 🍀