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

[FEATURE REQ] mgmt function app, convenience API for creating function app with managedEnvironmentId #37156

Closed
8 tasks done
Tracked by #36552
XiaofeiCao opened this issue Oct 12, 2023 · 4 comments
Closed
8 tasks done
Tracked by #36552
Assignees
Labels
Mgmt - Track 2 Mgmt This issue is related to a management-plane library. needs-triage This is a new issue that needs to be triaged to the appropriate team.

Comments

@XiaofeiCao
Copy link
Contributor

XiaofeiCao commented Oct 12, 2023

docs: https://learn.microsoft.com/en-us/azure/azure-functions/functions-container-apps-hosting

It's a new hosting plan compared to previous App Service Plans: All hosting plans

Some major implementation differences(found in azure-cli, may not be exhaustive):
For managed container app environment based(Centauri) Function Apps

  1. SiteConfig needs to be set to SiteInner.siteConfig when creating FunctionApp, instead of updating SiteConfig after Function App is created. Though future update on site configs will be using update method.
  2. Some property values are different, e.g. kind in SiteInner need to be "functionapp,linux,container,azurecontainerapps"
  3. Some update methods(updateSiteConfig, updateAppSettings) are LRO for Centauri Function Apps, but not defined as such in swagger. Need to manual poll. 

Tasks

@XiaofeiCao XiaofeiCao self-assigned this Oct 12, 2023
@XiaofeiCao XiaofeiCao added Mgmt This issue is related to a management-plane library. Mgmt - Track 2 labels Oct 12, 2023
@github-actions github-actions bot added the needs-triage This is a new issue that needs to be triaged to the appropriate team. label Oct 12, 2023
@weidongxu-microsoft
Copy link
Member

For (3), should we ask service to fix?

LRO not marked as LRO means every SDK fails.

@XiaofeiCao
Copy link
Contributor Author

XiaofeiCao commented Oct 26, 2023

For (3), should we ask service to fix?

LRO not marked as LRO means every SDK fails.

Yeah, I'll ask them for confirmation. CLI team seems to be aware of this issue too:
https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/azure/cli/command_modules/appservice/custom.py#L1558

@XiaofeiCao
Copy link
Contributor Author

Use cases for function app on Azure Container Apps

Create function app with managed environment

FunctionApp functionApp = appServiceManager.functionApps().define(webappName)
    .withRegion(Region.US_EAST)
    .withNewResourceGroup(rgName1)
    .withManagedEnvironmentId(managedEnvironmentId) // create with managedEnvironmentId
    //.withManagedEnvironmentName(managedEnvironmentName) // create with managedEnvironmentName
    .withMaxReplicas(10) // with scale setting
    .withMinReplicas(3) // with scale setting
    .withBuiltInImage(FunctionRuntimeStack.JAVA_17)
    .withAppSetting("WEBSITE_RUN_FROM_PACKAGE", FUNCTION_APP_PACKAGE_URL)
    .create();

Update scale settings

functionApp.update()
    .withMaxReplicas(15) // with scale setting
    .withMinReplicas(5) // with scale setting
    .apply();

@XiaofeiCao
Copy link
Contributor Author

2.34.0 released.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Mgmt - Track 2 Mgmt This issue is related to a management-plane library. needs-triage This is a new issue that needs to be triaged to the appropriate team.
Projects
None yet
Development

No branches or pull requests

2 participants