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

az functionapp config container set fails #28141

Open
sridharvenkat opened this issue Jan 7, 2024 · 9 comments
Open

az functionapp config container set fails #28141

sridharvenkat opened this issue Jan 7, 2024 · 9 comments
Assignees
Labels
Auto-Assign Auto assign by bot azf_investigation_needed azf_reviewed bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.

Comments

@sridharvenkat
Copy link

sridharvenkat commented Jan 7, 2024

Describe the bug

I am unable to set a container image to function apps using Azure CLI. The function app is under "Container Apps Environment". I am able to do the same using portal, just that it won't work in CLI. The error is "Internal Server Error", doesn't provide much information as well.

Related command

az functionapp config container set --docker-custom-image-name .azurecr.io/:4338e0ec91f0bb3216e4 --docker-registry-server-password --docker-registry-server-url https://.azurecr.io --docker-registry-server-user --name --resource-group

Errors

Operation returned an invalid status 'Internal Server Error'
Content: {"Message":"An error has occurred."}

Issue script & Debug output

urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions//resourceGroups//providers/Microsoft.Web/sites//config/appsettings?api-version=2022-03-01 HTTP/1.1" 500 36
cli.azure.cli.core.sdk.policies: Response status: 500
cli.azure.cli.core.sdk.policies: Response headers:
cli.azure.cli.core.sdk.policies: 'Cache-Control': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Pragma': 'no-cache'
cli.azure.cli.core.sdk.policies: 'Content-Length': '36'
cli.azure.cli.core.sdk.policies: 'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.sdk.policies: 'Expires': '-1'
cli.azure.cli.core.sdk.policies: 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.sdk.policies: 'Server': 'Microsoft-IIS/10.0'
cli.azure.cli.core.sdk.policies: 'X-AspNet-Version': '4.0.30319'
cli.azure.cli.core.sdk.policies: 'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.sdk.policies: 'x-ms-failure-cause': 'service'
cli.azure.cli.core.sdk.policies: 'x-ms-ratelimit-remaining-subscription-writes': '1199'
cli.azure.cli.core.sdk.policies: 'x-ms-request-id': '7d1eeaf6-1d3d-4aa8-ab54-143b6422f61c'
cli.azure.cli.core.sdk.policies: 'x-ms-correlation-request-id': '7d1eeaf6-1d3d-4aa8-ab54-143b6422f61c'
cli.azure.cli.core.sdk.policies: 'x-ms-routing-request-id': 'WESTUS:20240107T210608Z:7d1eeaf6-1d3d-4aa8-ab54-143b6422f61c'
cli.azure.cli.core.sdk.policies: 'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.sdk.policies: 'Date': 'Sun, 07 Jan 2024 21:06:08 GMT'
cli.azure.cli.core.sdk.policies: 'Connection': 'close'
cli.azure.cli.core.sdk.policies: Response content:
cli.azure.cli.core.sdk.policies: {"Message":"An error has occurred."}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 464, in update_application_settings_polling
_generic_settings_operation(cmd.cli_ctx, resource_group_name, name,
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/_appservice_utils.py", line 33, in _generic_settings_operation
return operation(resource_group_name, name, setting_properties)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 78, in wrapper_use_tracer
return func(*args, **kwargs)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/mgmt/web/v2022_03_01/operations/_web_apps_operations.py", line 18341, in update_application_settings
raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Internal Server Error'
Content: {"Message":"An error has occurred."}

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 663, in execute
raise ex
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 697, in _run_job
result = cmd_copy(params)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 333, in call
return self.handler(*args, **kwargs)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 1783, in update_container_settings_functionapp
return update_container_settings(cmd, resource_group_name, name, registry_server,
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 1761, in update_container_settings
update_app_settings(cmd, resource_group_name, name, settings, slot)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 438, in update_app_settings
update_application_settings_polling(cmd, resource_group_name, name, app_settings, slot, client)
File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/appservice/custom.py", line 477, in update_application_settings_polling
raise CLIError(ex)
knack.util.CLIError: Operation returned an invalid status 'Internal Server Error'
Content: {"Message":"An error has occurred."}

cli.azure.cli.core.azclierror: Operation returned an invalid status 'Internal Server Error'
Content: {"Message":"An error has occurred."}
az_command_data_logger: Operation returned an invalid status 'Internal Server Error'
Content: {"Message":"An error has occurred."}

Expected behavior

Sets a container image to the function app

Environment Summary

azure-cli 2.55.0

core 2.55.0
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
ml 2.22.0
ssh 2.0.2

Dependencies:
msal 1.24.0b2
azure-mgmt-resource 23.1.0b2

Python location '/usr/bin/python3.9'
Extensions directory '/home/sridharan/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Oct 12 2023, 19:48:32)
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

@sridharvenkat sridharvenkat added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jan 7, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Jan 7, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Auto-Assign Auto assign by bot labels Jan 7, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added Functions az functionapp Service Attention This issue is responsible by Azure service team. labels Jan 7, 2024
@sridharvenkat
Copy link
Author

Any update on this?

@kamperiadis
Copy link
Contributor

Hi @sridharvenkat We are currently investigating this issue and we will get back to you on this. Thank you for your patience.

@raorugan
Copy link

Hi @sridharvenkat you need to use below parameters such as --image, --registry-password, --registry-username to update the image in cli . (refer this doc link -https://github.com/Azure/azure-functions-on-container-apps?tab=readme-ov-file#update-function-container-image)

az functionapp config container set --image /<image_name>: --registry-password --registry-username --name --resource-group

The current parameters used in your cmdlet are deprecated (https://learn.microsoft.com/en-us/cli/azure/functionapp/config/container?view=azure-cli-latest#az-functionapp-config-container-set)
image

@raorugan
Copy link

raorugan commented Jan 18, 2024

@sridharvenkat - can you please look into the acr image name as well , it seems incorrect. https://.azurecr.io https:// is not required. Can you try below format highlighted
image

<your_acr_name>.azurecr.io/<image_name>:

@kamperiadis
Copy link
Contributor

Hi @sridharvenkat Just wanted to check in and see if the suggestions above resolved the issue you were experiencing?

@kamperiadis kamperiadis added the needs-author-feedback More information is needed from author to address the issue. label Jan 19, 2024
@sridharvenkat
Copy link
Author

@raorugan, image name parameter did not contain https, only the register server URL had it. I guess while posting this bug, GitHub also removed some text from my command text. Also, I tried the commands with and without deprecated parameter names.

@microsoft-github-policy-service microsoft-github-policy-service bot added needs-team-attention This issue needs attention from Azure service team or SDK team and removed needs-author-feedback More information is needed from author to address the issue. labels Jan 23, 2024
@raorugan
Copy link

Hi @sridharvenkat can you share the error messages you are currently seeing?

@Elizabeth-Martin2
Copy link

@sridharvenkat - can you please look into the acr image name as well , it seems incorrect. https://.azurecr.io https:// is not required. Can you try below format highlighted image

<your_acr_name>.azurecr.io/<image_name>:

I was getting the same "Internal Server Error" and the above resolved the issue for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot azf_investigation_needed azf_reviewed bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Functions az functionapp needs-team-attention This issue needs attention from Azure service team or SDK team Service Attention This issue is responsible by Azure service team.
Projects
None yet
Development

No branches or pull requests

8 participants