https://pulumi.com logo
Title
a

ancient-eve-13947

11/24/2021, 1:33 PM
how do I set the scaling properties for an app service (what you find under "Scale out (App Service plan)" in the portal) for an app service or an app service plan, using the azure native provider?
t

tall-librarian-49374

11/24/2021, 1:39 PM
I think it’s in
skuCapacity
in App Service Plan
a

ancient-eve-13947

11/24/2021, 1:41 PM
okay, I'll check that out - thanks!
t

tall-librarian-49374

11/24/2021, 1:45 PM
a

ancient-eve-13947

11/24/2021, 2:16 PM
hmm. so I did this:
var plan= new web.AppServicePlan(`${name}plan`, {
        resourceGroupName,
        kind: "Linux",                
        reserved: true,            
        sku: {
            size: "S1",
            tier: "Standard",
            name: "S1",
            skuCapacity: {
                minimum: scaling.replicas,
                maximum: 2*scaling.replicas,
                default: scaling.replicas,
            }
        },
    });
which also compiles fine (typescript), and if i look at the definition
AppServicePlanArg {
//...
sku?: pulumi.Input<inputs.web.SkuDescriptionArgs>;
//...
}
SkuDescriptionArgs: {
...
skuCapacity?: pulumi.Input<inputs.web.SkuCapacityArgs>;
...
}
it looks right, too, but I get the error:
Code="InvalidRequestContent" Message="The request content was invalid and could not be deserialized: 'Could not find member 'skuCapacity' on object of type 'ResourceSku'. Path 'sku.skuCapacity', line 1, position 170.'."
I'll try and run npm update, maybe the API has changed?
the related definitions look unchanged
(and I am on the latest Pulumi CLI, I got a scheduler job updating it daily)
any idea?
preview goes through without any issues, only when it actually tries to execute the plan, I get the error.
t

tall-librarian-49374

11/24/2021, 2:31 PM
a

ancient-eve-13947

11/24/2021, 2:36 PM
can you check whether you can repro this? if yes, then a) it's probably relevant to you and b) I know this path is a no-go, and I'll have to have a look at that other version you linked. regarding that one: the link explains how to create such an AutoscaleResource - but how do I link that to the webapp? also, background: I really don't need autoscaling. I just need to be able to set N instances of the appservice. maybe there is a simpler way? ah, okay, I just saw the last example you linked, so I basically translate from ARM to pulumi, okay.
t

tall-librarian-49374

11/24/2021, 2:42 PM
I just need to be able to set N instances of the appservice
Isn’t this
sku.capacity
?
(confusingly, they have an integer
capacity
and object
skuCapacity
on the same level)
a

ancient-eve-13947

11/24/2021, 3:16 PM
ah
!
okay, lemme try this
that did the trick - thank you!
🎉 1
t

tall-librarian-49374

11/24/2021, 6:10 PM
Sorry for sending you the wrong way first!