So I'm finding myself wedged with the Azure API, p...
# general
b
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: https://www.terraform.io/docs/providers/azurerm/d/app_service_plan.html#sku
m
cc @luke @stocky-spoon-28903
b
Ack. Rubber duck: that's the bleeping data source, not the component
s
🙂 I do that at least 5 times per day
b
It's actually...still broken
The provider does not specify a
SKU.Name
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
s
Hmm let me take a look at it
b
Immediately I'm going "oh hey, version hell", but I don't know where I'd prod between Pulumi and Terraform
s
I don’t see
sku.Name
listed on the terraform docs: https://www.terraform.io/docs/providers/azurerm/r/app_service_plan.html#sku
Taking a look at the code
b
Agreed
The Azure CLI very much wants an SKU provided by name (which is awful, but at this point I'm almost used to it)
b
Yeah - just got there.
Now I legit wonder how this ever worked.
s
So this is something missing from Terraform
I’m somewhat surprised that you can provision with Terraform and don’t hit the same error?
b
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?
s
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
b
This is inscrutable. Yikes
s
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
b
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
s
My guess is it was an attempt to simplify
opens
git blame
and hopes it wasn’t me…
w
@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.
b
@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
SKU.Name
actually is?
The Pulumi
--verbose
flag is, er, not verbose.
No combination I've been able to come up with actually does anything.
t
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...
b
...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.)
t
You are welcome. You can also have a look at a bigger example here: https://github.com/pulumi/examples/blob/master/azure-ts-appservice/index.ts
b
Whoa, didn't even see an example in there for app services
Thank you
t