Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Web: adding support for computeMode to App Service plans #2645

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2228,6 +2228,19 @@
"description": "Family code of the resource SKU.",
"type": "string"
},
"computeMode": {
"description": "Shared or dedicated app hosting.",
"enum": [
"Shared",
"Dedicated",
"Dynamic"
],
"type": "string",
"x-ms-enum": {
"name": "ComputeModeOptions",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you are redefining the same enum ComputeModeOptions multiple times but with different values for "modelAsString". What you may do is

  • Create a single definition for it and have it referenced wherever required
  • Modify "modelAsString":true for each definition of ComputeModeOptions

I'd recommend the former

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah I was just trying to debug that 😄

I've gone with the latter for the moment to get the build to pass, and I'll now look into the former :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed a change for the former 🤞

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dsgouda sorry to pester, but would you be able to advise/explain how I can fix this build on Java and Go, since it appears fine in the Node build?

"modelAsString": false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure you want to set "modelAsString":false this could cause breaking changes when/if the enum values are modified.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, you may want to update some of the x-ms-examples with this property

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I copied and paste this from another section below, so I assume that’s intentional ¯_(ツ)_/¯

I can definitely add an example though, sure 👍🏼

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As long as you are aware of the implications of breaking changes, we are OK with this. If you think that the value of this enum may change in the future we recommend setting "modelAsString":true
If unsure, we can leave it as is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed changes to update this and the existing reference to true. There appears to be no examples for creating an App Service Plan at the moment; I can add one but I believe it'd be better for the service team to provide complete samples of the common scenarios?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tombuildsstuff What is the motivation for adding computemode to App Service Plan. You can get that information about dedicated/shared/dynamic from the App Service Plan SKU. https://docs.microsoft.com/en-us/rest/api/appservice/appserviceplans/createorupdate#skudescription

Consumption Plan:
"sku": {
"name": "Y1",
"tier": "Dynamic",
"size": "Y1",
"family": "Y",
"capacity": 0
}

From: https://docs.microsoft.com/en-us/rest/api/appservice/appserviceplans/getserverfarmskus

{
"value": [
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "F1",
"tier": "Free"
},
"capacity": {
"minimum": 0,
"maximum": 0,
"default": 0,
"scaleType": "none"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "D1",
"tier": "Shared"
},
"capacity": {
"minimum": 0,
"maximum": 0,
"default": 0,
"scaleType": "none"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "B1",
"tier": "Basic"
},
"capacity": {
"minimum": 1,
"maximum": 3,
"default": 1,
"scaleType": "manual"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "B2",
"tier": "Basic"
},
"capacity": {
"minimum": 1,
"maximum": 3,
"default": 1,
"scaleType": "manual"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "B3",
"tier": "Basic"
},
"capacity": {
"minimum": 1,
"maximum": 3,
"default": 1,
"scaleType": "manual"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "S1",
"tier": "Standard"
},
"capacity": {
"minimum": 1,
"maximum": 10,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "S2",
"tier": "Standard"
},
"capacity": {
"minimum": 1,
"maximum": 10,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "S3",
"tier": "Standard"
},
"capacity": {
"minimum": 1,
"maximum": 10,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "P1",
"tier": "Premium"
},
"capacity": {
"minimum": 1,
"maximum": 20,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "P2",
"tier": "Premium"
},
"capacity": {
"minimum": 1,
"maximum": 20,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "P3",
"tier": "Premium"
},
"capacity": {
"minimum": 1,
"maximum": 20,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "I1",
"tier": "Isolated"
},
"capacity": {
"minimum": 1,
"maximum": 20,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "I2",
"tier": "Isolated"
},
"capacity": {
"minimum": 1,
"maximum": 20,
"default": 1,
"scaleType": "automatic"
}
},
{
"resourceType": "Microsoft.Web/serverfarms",
"sku": {
"name": "I3",
"tier": "Isolated"
},
"capacity": {
"minimum": 1,
"maximum": 20,
"default": 1,
"scaleType": "automatic"
}
}
],
"nextLink": null,
"id": null
}

}
},
"capacity": {
"format": "int32",
"description": "Current number of instances assigned to the resource.",
Expand Down Expand Up @@ -2792,4 +2805,4 @@
]
}
]
}
}