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

New Resource - azurerm_function_app_flex_consumption #28199

Merged
merged 43 commits into from
Feb 27, 2025

Conversation

xiaxyi
Copy link
Contributor

@xiaxyi xiaxyi commented Dec 6, 2024

Community Note

  • Please vote on this PR by adding a 👍 reaction to the original PR to help the community and maintainers prioritize for review
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for PR followers and do not help prioritize for review

Description

To make a separate pr for this new feature, referring to the #27531

PR Checklist

  • I have followed the guidelines in our Contributing Documentation.
  • I have checked to ensure there aren't other open Pull Requests for the same update/change.
  • I have checked if my changes close any open issues. If so please include appropriate closing keywords below.
  • I have updated/added Documentation as required written in a helpful and kind way to assist users that may be unfamiliar with the resource / data source.
  • I have used a meaningful PR title to help maintainers and other users understand this change and help prevent duplicate work.
    For example: “resource_name_here - description of change e.g. adding property new_property_name_here

Changes to existing Resource / Data Source

  • I have added an explanation of what my changes do and why I'd like you to include them (This may be covered by linking to an issue above, but may benefit from additional explanation).
  • I have written new tests for my resource or datasource changes & updated any relevent documentation.
  • I have successfully run tests with my changes locally. If not, please provide details on testing challenges that prevented you running the tests.
  • (For changes that include a state migration only). I have manually tested the migration path between relevant versions of the provider.

Testing

  • My submission includes Test coverage as described in the Contribution Guide and the tests pass. (if this is not possible for any reason, please include details of why you did or could not add test coverage)

Change Log

Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.

  • azurerm_resource - support for the thing1 property [GH-00000]

This is a (please select all that apply):

  • Bug Fix
  • New Feature (ie adding a service, resource, or data source)
  • Enhancement
  • Breaking Change

Related Issue(s)

Fixes #0000

Note

If this PR changes meaningfully during the course of review please update the title and description as required.

@nzthiago
Copy link

nzthiago commented Dec 6, 2024

@xiaxyi - thank you for this PR. Only note from me is we don't want customers to worry about operating system, with no plans for a Windows version of Flex Consumption in the foreseeable future. Can we please simplify the name and code not to have Linux in it for Flex Consumption? Other than that I'm happy with separating it out into its own resource type, thank you.

@joshvito
Copy link
Contributor

Patiently awaiting this feature! Thanks

@ryaneastabrook
Copy link

Ran into same issue, would love to see this merged!

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

In addition to the local location overrides for the tests, can you please address these last few comments.


* `app_settings` - (Optional) A map of key-value pairs for [App Settings](https://docs.microsoft.com/azure/azure-functions/functions-app-settings) and custom values.

~> **NOTE:** For storage related settings, please use related properties that are available such as `storage_account_access_key`, terraform will assign the value to keys such as `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`, `AzureWebJobsStorage` in app_setting.
Copy link
Member

Choose a reason for hiding this comment

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

Since these reviews, we've introduced a guide on documentation standards. Please title case all of the notes

Suggested change
~> **NOTE:** For storage related settings, please use related properties that are available such as `storage_account_access_key`, terraform will assign the value to keys such as `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`, `AzureWebJobsStorage` in app_setting.
~> **Note:** For storage related settings, please use related properties that are available such as `storage_account_access_key`, terraform will assign the value to keys such as `WEBSITE_CONTENTAZUREFILECONNECTIONSTRING`, `AzureWebJobsStorage` in app_setting.

Copy link
Contributor Author

@xiaxyi xiaxyi Feb 12, 2025

Choose a reason for hiding this comment

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

I think this was addressed?
image

Copy link
Member

@stephybun stephybun Feb 12, 2025

Choose a reason for hiding this comment

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

@xiaxyi this hasn't been addressed, I'm asking for all instances of NOTE (uppercase) in the documentation to be recased to Note (titlecase).

@@ -47,6 +47,7 @@ func (r Registration) Resources() []sdk.Resource {
LinuxFunctionAppSlotResource{},
LinuxWebAppResource{},
LinuxWebAppSlotResource{},
FunctionAppFlexConsumptionResource{},
Copy link
Member

Choose a reason for hiding this comment

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

still not sorted alphabetically

@@ -67,6 +67,8 @@ The following arguments are supported:

* `site_config` - (Required) A `site_config` block as defined below.

* `flex_function_app_deployment` - (Optional) A `flex_consumption_app_deployment` block as defined below.
Copy link
Member

Choose a reason for hiding this comment

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

These documentation updates on the linux function app should be removed since these properties haven't been added to the resource.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@dvasdekis
Copy link

Hi @stephybun it appears that the requested changes have been made in the latest commit?

@ryaneastabrook
Copy link

Is there any help the community can provide to get this moving again?

@nzthiago
Copy link

Thank you for the follow ups everyone. We are making progress. The testing automation subscription is running into a 'Flex Consumption pricing tier is not enabled for this subscription' message and we are actively working to unblock it so @xiaxyi's testing can resume.

@xiaxyi
Copy link
Contributor Author

xiaxyi commented Feb 26, 2025

Hi @stephybun, I'm not sure about why all the test cases failed due to the 400 error, despite of the fact that I've set the test location to eastus2 via the environment ARM_TEST_LOCATION. I've ran all the failed test cases separately and now they all passed. Would you mind continue to review this PR and let me know your comments? Thanks!

os_type = "Linux"
sku_name = "FC1"
}
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
`, data.RandomInteger, data.Locations.Primary, data.RandomString, data.RandomInteger)
`, data.RandomInteger, "eastus2", data.RandomString, data.RandomInteger) // location needs to be hardcoded for the moment because flex isn't available in all regions yet and appservice already has location overrides in TC

Choose a reason for hiding this comment

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

@stephybun : If we are suggesting to hardcode it to eastus2, does that mean customers can only create the resource in eastus2 region, even if other regions are supported from Azure? If I'm not wrong, there are many regions which support flex consumption plans.

Copy link
Member

Choose a reason for hiding this comment

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

@pcsrijith this hardcodes the region only for our acceptance tests and has no bearing on what regions users will be able to provision this in.

@nzthiago
Copy link

nzthiago commented Feb 26, 2025

@stephybun it looks like data.Locations.Primary is set to West Europe in the acceptance test. Flex Consumption is currently in Australia East, East Asia, East US, East US 2, North Europe, Southcentral US, Southeast Asia, Sweden Central,
UK South, West US 2, West US 3.

Not a huge deal but would data.Locations.Secondary or data.Locations.Ternary match one of those? If so, it might be better instead of fully hardcoding the region.

Copy link
Member

@stephybun stephybun left a comment

Choose a reason for hiding this comment

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

Tests looks good, thanks @xiaxyi LGTM 👍
image

@stephybun stephybun merged commit 4a05d26 into hashicorp:main Feb 27, 2025
33 checks passed
@github-actions github-actions bot added this to the v4.21.0 milestone Feb 27, 2025
stephybun added a commit that referenced this pull request Feb 27, 2025
@pcsrijith
Copy link

Thank you @xiaxyi , @nzthiago and @stephybun for MR. Will create the resources as soon as 4.21.0 goes live.

jackofallops added a commit that referenced this pull request Feb 27, 2025
* Update CHANGELOG.md for #28840

* Update CHANGELOG.md #28808

* Update CHANGELOG.md #27962

* Update CHANGELOG.md for #28859

* Update for #28825

* Update CHANGELOG.md for #28864

* Update CHANGELOG.md #28539

* Update CHANGELOG.md #28685

* Update CHANGELOG.md for #28818

* Update for #28857 #28799 #28856

* Update for #28122

* Update for #28248 #27805

* Update for #28853

* Update for #28316 #28494 #28696

* Update for #28754

* Update CHANGELOG.md #28771

* Update CHANGELOG.md #28842

* Update for #28879

* Update for #28199

* Update CHANGELOG.md #28862

* prep for release v4.21.0

---------

Co-authored-by: sreallymatt <[email protected]>
Co-authored-by: Wodans Son <[email protected]>
Co-authored-by: stephybun <[email protected]>
Co-authored-by: catriona-m <[email protected]>
Co-authored-by: Matthew Frahry <[email protected]>
Co-authored-by: Wyatt Fry <[email protected]>
@xiaxyi xiaxyi changed the title New Resource - azurerm_linux_function_app_flex_consumption New Resource - azurerm_function_app_flex_consumption Feb 27, 2025
@AELO23
Copy link

AELO23 commented Feb 28, 2025

this is awesome!!

@xiaxyi
Copy link
Contributor Author

xiaxyi commented Mar 3, 2025

Please try using
storage_container_endpoint= "${azurerm_storage_account.test.primary_blob_endpoint}${azurerm_storage_container.test.name}"

@david-haugh
Copy link

Thanks, everyone, for this! Does it include a parameter for always-ready instances?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.