-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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_on_container
#27249
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @xiaxyi ,
Thanks for this PR - I've taken a look through and left some comments inline. If we can fix those up, this should be good to go 👍
|
||
"resource_group_name": commonschema.ResourceGroupName(), | ||
|
||
"container_app_environment_id": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shall we use "container_app_environment_id": commonschema.ResourceIDReferenceForceNew(managedenvironments.ManagedEnvironmentID{}),
?
|
||
"registry": helpers.RegistrySchemaLinuxFunctionAppOnContainer(), | ||
|
||
"container_image": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please put Required
fields ahead of Optional
ones
Description: "The Connection String for linking the Linux Function App to Application Insights.", | ||
}, | ||
|
||
"app_scale_limit": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add ValidateFunc
to set the value range
Description: "The number of workers this function app can scale out to. Only applicable to apps on the Consumption and Premium plan.", | ||
}, | ||
|
||
"elastic_instance_minimum": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add ValidateFunc
to set the value range
storageString = fmt.Sprintf(helpers.StorageStringFmtKV, linuxFunctionAppOnContainer.StorageKeyVaultSecretID) | ||
} | ||
|
||
siteConfig := helpers.ExpandSiteConfigLinuxFunctionAppOnContainer(linuxFunctionAppOnContainer.SiteConfig, nil, metadata, linuxFunctionAppOnContainer.Registries[0], linuxFunctionAppOnContainer.FunctionExtensionsVersion, storageString) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if len(linuxFunctionAppOnContainer.Registries) == 0
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the required field
|
||
* `functions_extension_version` - (Optional) The runtime version associated with the Function App. Defaults to `~4`. | ||
|
||
* `key_vault_reference_identity_id` - (Optional) The User Assigned Identity ID used for accessing KeyVault secrets. The identity must be assigned to the application in the `identity` block. [For more information see - Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `key_vault_reference_identity_id` - (Optional) The User Assigned Identity ID used for accessing KeyVault secrets. The identity must be assigned to the application in the `identity` block. [For more information see - Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) | |
* `key_vault_reference_identity_id` - (Optional) The User Assigned Identity ID used for accessing KeyVault secrets. The identity must be assigned to the application in the `identity` block. See [Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) for more information. |
|
||
* `key_vault_reference_identity_id` - (Optional) The User Assigned Identity ID used for accessing KeyVault secrets. The identity must be assigned to the application in the `identity` block. [For more information see - Access vaults with a user-assigned identity](https://docs.microsoft.com/azure/app-service/app-service-key-vault-references#access-vaults-with-a-user-assigned-identity) | ||
|
||
* `storage_account_access_key` - (Optional) The access key which will be used to access the backend storage account for the Function App. Conflicts with `storage_uses_managed_identity`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you please put Conflicts with ...
into **NOTE**
?
|
||
* `application_insights_key` - (Optional) The Instrumentation Key for connecting the Containerized Linux Function App to Application Insights. | ||
|
||
* `app_scale_limit` - (Optional) The number of workers this function app can scale out to. Only applicable to apps on the Consumption and Premium plan. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `app_scale_limit` - (Optional) The number of workers this function app can scale out to. Only applicable to apps on the Consumption and Premium plan. | |
* `app_scale_limit` - (Optional) The number of workers this function app can scale out to, which is only applicable to apps on the Consumption and Premium plan. Defaults to `10` |
|
||
registry { | ||
registry_server_url = "mcr.microsoft.com" | ||
registry_username = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you also test registry_username
and registry_password
with values?
|
||
type LinuxFunctionAppOnContainerResource struct{} | ||
|
||
func TestAccLinuxFunctionAppOnContainer_basicDocker(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems storage_key_vault_secret_id, site_config.application_insights_key, site_config.elastic_instance_minimum ,site_config.linux_fx_version, identity
are not test. Could you add these testcases?
This PR is being labeled as "stale" because it has not been updated for 30 or more days. If this PR is still valid, please remove the "stale" label. If this PR is blocked, please add it to the "Blocked" milestone. If you need some help completing this PR, please leave a comment letting us know. Thank you! |
Thanks @ms-zhenhua for the review, I updated the code per comment, also made the PR to "ready to review" status as the api issue was fixed. |
Looks like a feature we have been looking for. When can we expect a release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test failure
------- Stdout: -------
=== RUN TestAccLinuxFunctionAppOnContainer_basicMCRUpdate
=== PAUSE TestAccLinuxFunctionAppOnContainer_basicMCRUpdate
=== CONT TestAccLinuxFunctionAppOnContainer_basicMCRUpdate
testcase.go:173: Step 2/3 error: Pre-apply plan check(s) failed:
'azurerm_linux_function_app_on_container.test' - expected action to not be Replace, path: [[name]] tried to update a value that is ForceNew
--- FAIL: TestAccLinuxFunctionAppOnContainer_basicMCRUpdate (1118.55s)
FAIL
Community Note
Description
Support the new resource - hosting azure function app in container app environment.
PR Checklist
For example: “
resource_name_here
- description of change e.g. adding propertynew_property_name_here
”Changes to existing Resource / Data Source
Testing
--- PASS: TestAccLinuxFunctionAppOnContainer_completePublicRegistry (1043.98s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice 1067.438s
--- PASS: TestAccLinuxFunctionAppOnContainer_basicPublicRegistry (1093.35s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice 1116.159s
--- PASS: TestAccLinuxFunctionAppOnContainer_storageUsesMSI (1073.56s)
PASS
ok github.com/hashicorp/terraform-provider-azurerm/internal/services/appservice 1082.432s
Change Log
Below please provide what should go into the changelog (if anything) conforming to the Changelog Format documented here.
azurerm_resource
- support for thething1
property [GH-00000]This is a (please select all that apply):
Related Issue(s)
#23470
Note
If this PR changes meaningfully during the course of review please update the title and description as required.