-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
[App Service] Add support for linux sitecontainers #30776
base: dev
Are you sure you want to change the base?
Conversation
Validation for Azure CLI Full Test Starting...
Thanks for your contribution! |
Validation for Breaking Change Starting...
Thanks for your contribution! |
Thank you for your contribution! We will review the pull request and get back to you soon. |
The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR. Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions). pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>
|
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.
Can we do these validations too:
- Only one main container should be allowed to be added.
- Target port if provided should be an integer in port range 1-65535
- Environment Value should be an AppSetting ref, so it should exist in site appsettings list.
- Avoid port conflicts in multiple sidecars. Same target port in multiple sidecars should be flagged.
- Check system identity is enabled for site, if auth-type is system identity.
- Check user-assigned managed identity is already added to site and client-id is one among them for MI case.
raise ValidationError("The sitecontainer spec file does not exist at the path '{}'" | ||
.format(sitecontainers_spec_file)) | ||
with open(sitecontainers_spec_file, 'r') as file: | ||
sitecontainers_spec_json = json.load(file) |
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 will throw an exception if json is malformed. Lets catch and send appropriate error message.
response.append(_create_or_update_webapp_sitecontainer_internal(cmd, name, resource_group, | ||
spec.name, sitecontainer, slot)) | ||
else: | ||
if container_name is None or image is None or target_port is None: |
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.
is_main should be mandatory, but target port can be optional.
|
||
|
||
def create_webapp_sitecontainers(cmd, name, resource_group, container_name=None, image=None, target_port=None, | ||
slot=None, startup_cmd=None, is_main=None, system_assigned_identity=None, |
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.
nit: make slot as last argument.
|
||
|
||
def get_webapp_sitecontainer_log(cmd, name, resource_group, container_name, slot=None): | ||
scm_url = _get_scm_url(cmd, resource_group, name, slot) |
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.
Does this handle regionalized urls?
Related command
az webapp create
az webapp sitecontainers create
az webapp sitecontainers update
az webapp sitecontainers delete
az webapp sitecontainers show
az webapp sitecontainers list
az webapp sitecontainers log
az webapp sitecontainers status
Description
Adding support for sitecontainers commands for azure web apps. Sitecontainers is a new capability supported on linux webapps: https://azure.github.io/AppService/2024/11/08/Global-Availability-Sidecars.html
Testing Guide
Create a new webapp of type=sitecontainers
az webapp create --name {} --resource-group {} --sitecontainers-app
Create Sitecontainers
az webapp sitecontainers create --name {} --resource-group {} --container-name {} --image {} --target-port {}
az webapp sitecontainers create --name {} --resource-group {} --sitecontainers-spec-file {}
az webapp sitecontainers update --name {} --resource-group {} --container-name {} --image {} --target-port {}
az webapp sitecontainers delete --name {} --resource-group {} --container-name {}
az webapp sitecontainers show --name {} --resource-group {} --container-name {}
az webapp sitecontainers show --name {} --resource-group {}
az webapp sitecontainers log --name {} --resource-group {} --container-name {}
az webapp sitecontainers status --name {} --resource-group {} --container-name {}
History Notes
[App Service]
az webapp sitecontainers
: Add new commands for linux web app sitecontainersThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.