https://pulumi.com logo
b

boundless-monkey-50243

10/26/2018, 5:50 PM
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

microscopic-florist-22719

10/26/2018, 5:51 PM
cc @luke @stocky-spoon-28903
b

boundless-monkey-50243

10/26/2018, 5:52 PM
Ack. Rubber duck: that's the bleeping data source, not the component
s

stocky-spoon-28903

10/26/2018, 5:52 PM
🙂 I do that at least 5 times per day
b

boundless-monkey-50243

10/26/2018, 5:52 PM
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

stocky-spoon-28903

10/26/2018, 5:55 PM
Hmm let me take a look at it
b

boundless-monkey-50243

10/26/2018, 5:55 PM
Immediately I'm going "oh hey, version hell", but I don't know where I'd prod between Pulumi and Terraform
s

stocky-spoon-28903

10/26/2018, 5:56 PM
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

boundless-monkey-50243

10/26/2018, 5:56 PM
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

boundless-monkey-50243

10/26/2018, 5:58 PM
Yeah - just got there.
Now I legit wonder how this ever worked.
s

stocky-spoon-28903

10/26/2018, 6:00 PM
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

boundless-monkey-50243

10/26/2018, 6:05 PM
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

stocky-spoon-28903

10/26/2018, 6:36 PM
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

boundless-monkey-50243

10/26/2018, 6:39 PM
This is inscrutable. Yikes
s

stocky-spoon-28903

10/26/2018, 6:41 PM
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

boundless-monkey-50243

10/26/2018, 6:49 PM
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

stocky-spoon-28903

10/26/2018, 6:55 PM
My guess is it was an attempt to simplify
opens
git blame
and hopes it wasn’t me…
w

white-balloon-205

10/26/2018, 7:29 PM
@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

boundless-monkey-50243

10/26/2018, 7:50 PM
@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

tall-librarian-49374

10/26/2018, 7:58 PM
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

boundless-monkey-50243

10/26/2018, 7:59 PM
...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

tall-librarian-49374

10/26/2018, 8:03 PM
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

boundless-monkey-50243

10/26/2018, 8:03 PM
Whoa, didn't even see an example in there for app services
Thank you
t

tall-librarian-49374

10/26/2018, 8:04 PM
5 Views