So I'm finding myself wedged with the Azure API, p...
# general
So I'm finding myself wedged with the Azure API, particularly with regards to app services.
I am wondering if Azure changed their API and the downstream Terraform provider hasn't picked it up
Or whether Pulumi has an old version of the provider, because the API spec expressed by Terraform here doesn't match my typings: Specifically, looking at this:
cc @luke @stocky-spoon-28903
Ack. Rubber duck: that's the bleeping data source, not the component
🙂 I do that at least 5 times per day
It's actually...still broken
The provider does not specify a
attribute, nor does it accept one when I
as any
my Pulumi code.
Copy code
azure:appservice:Plan (edtest-app-service-plan-apps):
    error: Plan apply failed: Error creating/updating App Service Plan "edtest-app-service-plan-apps" (Resource Group "edtest"): web.AppServicePlansClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadRequest" Message="The parameter SKU.Name has an invalid value." Details=[{"Message":"The parameter SKU.Name has an invalid value."},{"Code":"BadRequest"},{"ErrorEntity":{"Code":"BadRequest","Message":"The parameter SKU.Name has an invalid value.","MessageTemplate":"The parameter {0} has an invalid value.","Parameters":["SKU.Name"]}}]
I then forcibly add one, and:
Copy code
azure:appservice:Plan (edtest-app-service-plan-apps):
    error: azure:appservice/plan:Plan resource 'edtest-app-service-plan-apps' has a problem: sku.0: invalid or unknown key: name
Hmm let me take a look at it
Immediately I'm going "oh hey, version hell", but I don't know where I'd prod between Pulumi and Terraform
I don’t see
listed on the terraform docs:
Taking a look at the code
The Azure CLI very much wants an SKU provided by name (which is awful, but at this point I'm almost used to it)
Yeah - just got there.
Now I legit wonder how this ever worked.
So this is something missing from Terraform
I’m somewhat surprised that you can provision with Terraform and don’t hit the same error?
I think Terraform is generating it.
IIRC they have computed properties now
Not seeing anywhere it'd be happening though
Anybody from Pulumi proper maybe have any idea how this would be manifesting?
It would still be considered a bug in Terraform if it was generating values that weren’t in the schema that have some semantic value
So, it sets it to be the size
Right now, Pulumi should be doing the same thing
This is inscrutable. Yikes
That’s particularly bizaare behaviour on the part of Terraform - IMO if it is going to do that it also needs to expose the Name as a computed property on the SKU
I would think so
There are other places where they don't do this
If you set up a MySQL server you have to provide all of those and write the name as a string yourself
My guess is it was an attempt to simplify
git blame
and hopes it wasn’t me…
@boundless-monkey-50243 curious - which SKU settings are you ultimately trying to use?
My recollection was that there are esoteric (and mostly undocumented by Azure) mappings between these such that’s it is possible to request them via the options TF exposed here.
Also cc @tall-librarian-49374 who I know has worked a lot with App Service both with and outside of Pulumi.
@white-balloon-205 At the moment, just small/basic/1. Nothing crazy at all, should be supported.
Is there some way to get verbose output that would show me what
actually is?
The Pulumi
flag is, er, not verbose.
No combination I've been able to come up with actually does anything.
Normal App Service SKU is usually nothing crazy
sku: {    tier: "Basic",  size: "B1", }
. Function App looks a bit wild
sku: { tier: "Dynamic", size: "Y1", }
. Name was never in any of my code...
...well, dammit. PEBKAC. Well, sort of.
The documentation called the sizes small/medium/large, I thought the SKUs were based off tier+"size"
(because nothing I have found in Azure is consistent, I assumed I was just doing something else that was inconsistent)
And that was it. Thanks, @tall-librarian-49374 - I appreciate it.
(You read the documentation, it talks about tiers and small/medium/large, and...bleh.)
You are welcome. You can also have a look at a bigger example here:
Whoa, didn't even see an example in there for app services
Thank you