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

Replacement Service: appservice #12132

Merged
merged 68 commits into from
Sep 9, 2021
Merged

Conversation

jackofallops
Copy link
Member

@jackofallops jackofallops commented Jun 9, 2021

This PR introduces a new Service that will, over time, replace the Web service resources. This first change brings several new resources:

  • azurerm_windows_web_app, azurerm_linux_web_app, which are intended to replace azurerm_web_app with O/S specific resources to better support their respective configuration and property validation within the provider.
  • azurerm_app_service_source_control - a new meta resource to better support the Source Control configuration of Web Apps (and Function Apps later, when they are added).
  • azurerm_source_control_token - A replacement typed resource and data source for adding an Access Token to App Service (GtHub, BitBucket, OneDrive, or DropBox). Note: This is a contextual resource and is created for the account, identity, or principal that creates it. This means that the whichever identity that needs to access it for App Service Deployments must be the account to run the Terraform to create it.

Still outstanding:

  • Tags!
  • App Service Plan replacement resource
  • Data Sources
  • Lots more tests
  • Fix azurerm_app_service_source_control resource - not working as intended
  • Docs
  • General tidying up
  • Switch to local SDK (Nice to have)
  • update azurerm_app_service_github_token to generic token as previous resource

Note:
These new features are the first part of what will become version 3.0 of the provider, so are only available when the appropriate environment variable is set, details will be included in the change notes, but setting ARM_PROVIDER_THREEPOINTZERO_RESOURCES=true will permit the use of these new resource.

@jackofallops jackofallops self-assigned this Jun 9, 2021
@ghost ghost added size/XXL labels Jun 9, 2021
@jackofallops jackofallops changed the title reqs SDK bump Replacement Service: appservice Jun 9, 2021
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from 5bf652e to e4074cb Compare June 15, 2021 14:01
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from d53ea91 to 94dbf06 Compare June 28, 2021 14:05
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch 2 times, most recently from 837f73d to e32a27f Compare July 14, 2021 14:32
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from 51532d6 to 71ab73c Compare July 19, 2021 14:24
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from 71ab73c to 040b837 Compare July 20, 2021 09:46
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Thanks @jackofallops - comments left inline

Optional: true,
Elem: &pluginsdk.Schema{
Type: pluginsdk.TypeString,
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we at last validate this is not an empty string?

Type: pluginsdk.TypeList,
Optional: true,
Elem: &pluginsdk.Schema{Type: pluginsdk.TypeString},
},
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we validate this is at least not empty??

ValidateFunc: webValidate.AppServiceEnvironmentID, // TODO - Bring over to this service
},

"per_site_scaling": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

should this be

Suggested change
"per_site_scaling": {
"per_site_scaling_enabled": {

@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from 64806d7 to c98872b Compare July 26, 2021 08:22
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from c90a3fe to 27f4ffd Compare August 9, 2021 15:00

func (r AppServiceSourceControlResource) Create() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 30 * time.Minute,
Copy link
Collaborator

Choose a reason for hiding this comment

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

should we be passing this through from somewhere?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not to the best of my knowledge, this is the Typed SDK equivalent of Create: pluginsdk.DefaultTimeout(30 * time.Minute), so should be defined here with the function rather than collected from elsewhere? Happy to discuss alternatives.


func (r AppServiceSourceControlResource) Read() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 5 * time.Minute,
Copy link
Collaborator

Choose a reason for hiding this comment

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

and here


func (r AppServiceSourceControlTokenResource) Read() sdk.ResourceFunc {
return sdk.ResourceFunc{
Timeout: 5 * time.Minute,
Copy link
Collaborator

Choose a reason for hiding this comment

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

ect

website/docs/r/linux_web_app.html.markdown Show resolved Hide resolved

* `scm_use_main_ip_restriction` - (Optional) Should the Linux Web App `ip_restriction` configuration be used for the SCM also.

* `use_32_bit_worker` - (Optional) Should the Linux Web App use a 32-bit worker.
Copy link
Collaborator

Choose a reason for hiding this comment

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

use seems redundant?

Suggested change
* `use_32_bit_worker` - (Optional) Should the Linux Web App use a 32-bit worker.
* `32_bit_worker` - (Optional) Should the Linux Web App use a 32-bit worker.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a carry over from the superseded resource, I'll update it 👍

website/docs/r/linux_web_app.html.markdown Show resolved Hide resolved

* `os_type` - (Optional) The O/S type for the App Services to be hosted in this plan. Possible values include `Windows` (default), `Linux`, and `WindowsContainer`.

* `per_site_scaling` - (Optional) Should Per Site Scaling be enabled. Defaults to `false`.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* `per_site_scaling` - (Optional) Should Per Site Scaling be enabled. Defaults to `false`.
* `per_site_scaling_enabled` - (Optional) Should Per Site Scaling be enabled. Defaults to `false`.

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a carry over from the superseded resource, I'll update it 👍

@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch 2 times, most recently from 91428d8 to 70cc7fa Compare August 20, 2021 06:04
@jackofallops jackofallops force-pushed the f/app-service-three-point-oh branch from 3ec1e98 to 982ce4b Compare September 7, 2021 07:39

## App Service

App Service, aka `web`, was one of the earliest supported services in the provider and has evolved significantly over time, both as a Service and the resources within the provider. Over that time feature additions, behavioural changes, and a host of other change have made the current resources increasingly difficult to maintain and update. We're taking the opportunity in 3.0 to rewrite this service from the ground up.
Copy link
Member

Choose a reason for hiding this comment

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

I think there's an s missing here

Suggested change
App Service, aka `web`, was one of the earliest supported services in the provider and has evolved significantly over time, both as a Service and the resources within the provider. Over that time feature additions, behavioural changes, and a host of other change have made the current resources increasingly difficult to maintain and update. We're taking the opportunity in 3.0 to rewrite this service from the ground up.
App Service, aka `web`, was one of the earliest supported services in the provider and has evolved significantly over time, both as a Service and the resources within the provider. Over that time feature additions, behavioural changes, and a host of other changes have made the current resources increasingly difficult to maintain and update. We're taking the opportunity in 3.0 to rewrite this service from the ground up.

@jackofallops jackofallops marked this pull request as ready for review September 9, 2021 13:06
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

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

Aside from a couple minor comments this LGTM 🚀🚀🚀🚀

website/docs/r/app_service_github_token.html.markdown Outdated Show resolved Hide resolved
website/docs/r/windows_web_app.html.markdown Show resolved Hide resolved
website/docs/r/windows_web_app.html.markdown Show resolved Hide resolved
website/docs/r/windows_web_app.html.markdown Outdated Show resolved Hide resolved
website/docs/r/service_plan.html.markdown Outdated Show resolved Hide resolved
website/docs/r/linux_web_app.html.markdown Show resolved Hide resolved
website/docs/r/linux_web_app.html.markdown Show resolved Hide resolved
@jackofallops jackofallops merged commit 65c0e7e into main Sep 9, 2021
@jackofallops jackofallops deleted the f/app-service-three-point-oh branch September 9, 2021 18:42
jackofallops added a commit that referenced this pull request Sep 9, 2021
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants