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 containerapp create --bind "my-app" throws error when service has dashes in the name "-" #6524

Closed
charris-msft opened this issue Jul 18, 2023 · 5 comments · Fixed by #6566
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. ContainerApp CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue.

Comments

@charris-msft
Copy link

Describe the bug

Container Apps lets me create a container with dashes ("-") in the name, but then I can't reference that container in the --bind parameter.

az containerapp create --name "$PSQL_CLI_APP"
--image mcr.microsoft.com/k8se/services/postgres:14 --bind my-aca-pgaddon"
--environment "$ENVIRONMENT" --resource-group "$RESOURCE_GROUP"
--min-replicas 1 --max-replicas 1
--command "/bin/sleep" "infinity"
The Binding Name can only contain letters, numbers (0-9), periods ('.'), and underscores ('_'). The length must not be more than 60 characters.

Related command

az containerapp create

Errors

The Binding Name can only contain letters, numbers (0-9), periods ('.'), and underscores ('_'). The length must not be more than 60 characters.

Issue script & Debug output

az containerapp create --name "$PSQL_CLI_APP"
--image mcr.microsoft.com/k8se/services/postgres:14 --bind my-aca-pgaddon"
--environment "$ENVIRONMENT" --resource-group "$RESOURCE_GROUP"
--min-replicas 1 --max-replicas 1
--command "/bin/sleep" "infinity"

The Binding Name can only contain letters, numbers (0-9), periods ('.'), and underscores ('_'). The length must not be more than 60 characters

Expected behavior

I expect the command to accept the service with a dash in the name because I was allowed to create it in the first place.

Environment Summary

azure-cli 2.50.0

core 2.50.0
telemetry 1.0.8

Extensions:
acrtransfer 1.1.0
arcdata 1.5.0
azure-dev 0.0.1b456
azure-iot 0.21.2
connectedk8s 1.3.19
connectedmachine 0.5.1
containerapp 0.3.32
containerapp-compose 0.2.2
customlocation 0.1.3
db-up 0.2.7
k8s-configuration 1.7.0
k8s-extension 1.4.1
kusto 0.5.0
portal 0.1.3
rdbms-connect 1.0.3
serviceconnector-passwordless 0.3.2
ssh 1.1.6
webapp 0.4.0

Dependencies:
msal 1.22.0
azure-mgmt-resource 23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\charris.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb 7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

No response

@charris-msft charris-msft added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Jul 18, 2023
@yonzhan
Copy link
Collaborator

yonzhan commented Jul 18, 2023

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

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot ContainerApp CXP Attention This issue is handled by CXP team. labels Jul 18, 2023
@navba-MSFT navba-MSFT self-assigned this Jul 18, 2023
@navba-MSFT navba-MSFT added the needs-author-feedback More information is needed from author to address the issue. label Jul 18, 2023
@navba-MSFT
Copy link
Contributor

@charris-msft Thanks for reaching out to us and reporting this issue. Could you please share the --debug output here ?

@navba-MSFT
Copy link
Contributor

@charris-msft I am pasting the response I received for my above PR.

Currently, while using --bind, we expect the user to provide us the svc_name:[binding_name] where the binding_name is optional and the binding_name should follow
"The Binding Name can only contain letters, numbers (0-9), periods ('.'), and underscores ('_'). The length must not be more than 60 characters." because this is what service linker expects.
If we have a svc_name that has a "-", we use the same as our binding_name and ask the user to provide an acceptable binding_name. Since binding_names would appear in env vars, we cannot allow "-" in the binding_name plus service linker doesn't accept it.
IMO, this PR will break stuff and a more longer term solution should be pondered upon:

  1. Restrict the dev service names to the acceptable set. OR
  2. Map bad chars like "-" to an "_" OR generate an error asking for a compliant binding_name.

There were talks going on about how to handle it and there is an issue on the same: https://github.com/orgs/serverless-paas-balam/projects/2/views/1?pane=issue&itemId=34057347

CC @duglin @yash-nisar

@microsoft-github-policy-service
Copy link
Contributor

Hi, we're sending this friendly reminder because we haven't heard back from you in a while. We need more information about this issue to help address it. Please be sure to give us your input within the next 7 days. If we don't hear back from you within 14 days of this comment the issue will be automatically closed. Thank you!

@charris-msft
Copy link
Author

My issue is essentially already covered in #6566.

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 bug This issue requires a change to an existing behavior in the product in order to be resolved. ContainerApp CXP Attention This issue is handled by CXP team. needs-author-feedback More information is needed from author to address the issue.
Projects
None yet
3 participants