Skip to content

Commit

Permalink
Adding cmds & tests for Container app certs & domains (Azure#107)
Browse files Browse the repository at this point in the history
* Marchp1s and add back Identity (#57)

* Skeleton code

* az containerapp env show

* List kube/managed environments

* Create kube environment, wait doesn't work yet

* Update containerapp stubs (check if it is supported now)

* Containerapp env delete, polling not working yet

* Added polling for create and delete

* Use Microsoft.App RP for show, list, delete command

* Create containerapp env using Microsoft.App RP

* Add optional containerapp env create arguments

* Remove old kube environment code, naming fixes

* Containerapp create almost done

* Done containerapp create, except for --yaml. Need to test

* Containerapp show, list

* Fix helptext

* Containerapp delete

* Containerapp update. Needs secrets api to be implemented, and testing

* Add scale command

* Various validations, small fixes

* listSecrets API for updates, autogen log analytics for env

* Use space delimiter for secrets and env variables

* Verify sub is registered to Microsoft.ContainerRegistration if creating vnet enabled env, remove logs-type parameter

* Containerapp create --yaml

* Fix updating registry to do create or update

* Fix containerapp update command. Add image-name parameter to support multi container updates. Fix updating registries, containers and secrets

* started update with --yaml. Need to do create or update for when an attribute is a list of items

* use space delimiter for startup_command and args, instead of comma delimiter

* Traffic weights

* List and show revisions

* az containerapp revision restart, activate, deactivate

* Add ability for users to clear args/command in az containerapp update

* Various fixes, traffic weights fixes

* Verify subnet subscription is registered to Microsoft.ContainerServices

* GitHub Actions Update (Azure#17)

* Added models. Finished transferring Calvin's previous work.

* Updated wrong models.

* Updated models in custom.py, added githubactionclient.

* Updated envelope to be correct.

* Small bug fixes.

* Updated error handling. Fixed bugs. Initial working state.

* Added better error handling.

* Added error messages for tokens with inappropriate access rights.

* Added back get_acr_cred.

* Fixed problems from merge conflict.

* Updated names of imports from ._models.py to fix pylance erros.

* Removed random imports.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Remove --location since location must be same as managed env

* Add options for flag names: --env-vars and --registry-srever

* Empty string to clear env_vars

* Default revisions_mode to single

* Infer acr credentials if it is acr and credentials are not provided

* fix help msg

* if image is hosted on acr, and no registry server is supplied, infer the registry server

* Added subgroups (Ingress, Registry, Secret) and updated revisions (Azure#18)

* Added ingress subgroup.

* Added help for ingress.

* Fixed ingress traffic help.

* Added registry commands.

* Updated registry remove util to clear secrets if none remaining. Added warning when updating existing registry. Added registry help.

* Changed registry delete to remove.

* Added error message if user tries to remove non assigned registry.

* Changed registry add back to registry set.

* Added secret subgroup commands.

* Removed yaml support from secret set.

* Changed secret add to secret set. Updated consistency between secret set and secret delete. Added secret help. Require at least one secret passed with --secrets for secret commands.

* Changed param name for secret delete from --secrets to --secret-names. Updated help.

* Changed registry remove to registry delete.

* Fixed bug in registry delete.

* Added revision mode set and revision copy.

* Modified update_containerapp_yaml to support updating from non-current revision.

Authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* More p0 fixes (Azure#20)

* Remove --registry-login-server, only allow --registry-server

* Rename --environment-variables to --env-vars

* If no image is supplied, use default quickstart image

* Update help text (Azure#21)

* Update help text

* Update punctuation

* master -> main

* New 1.0.1 version

* Added identity commands + --assign-identity flag to containerapp create (#8)

* Added identity show and assign.

* Finisheed identity remove.

* Added helps, updated identity remove to work with identity names instead of requiring identity resource ids.

* Moved helper function to utils.

* Require --identities flag when removing identities.

* Added message for assign identity with no specified identity.

* Added --assign-identity flag to containerapp create.

* Moved assign-identity flag to containerapp create.

* Fixed small logic error on remove identities when passing duplicate identities. Added warnings for certain edge cases.

* Updated param definition for identity assign --identity default.

* Added identity examples in help.

* Made sure secrets were not removed when assigning identities. Added tolerance for [system] passed with capital letters.

* Fixed error from merge.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Dapr Commands (Azure#23)

* Added ingress subgroup.

* Added help for ingress.

* Fixed ingress traffic help.

* Added registry commands.

* Updated registry remove util to clear secrets if none remaining. Added warning when updating existing registry. Added registry help.

* Changed registry delete to remove.

* Added error message if user tries to remove non assigned registry.

* Changed registry add back to registry set.

* Added secret subgroup commands.

* Removed yaml support from secret set.

* Changed secret add to secret set. Updated consistency between secret set and secret delete. Added secret help. Require at least one secret passed with --secrets for secret commands.

* Changed param name for secret delete from --secrets to --secret-names. Updated help.

* Changed registry remove to registry delete.

* Fixed bug in registry delete.

* Added revision mode set and revision copy.

* Added dapr enable and dapr disable. Need to test more.

* Added list, show, set dapr component. Added dapr enable, disable.

* Added delete dapr delete.

* Added helps and param text.

* Changed dapr delete to dapr remove to match with dapr set.

* Commented out managed identity for whl file.

* Uncommented.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Rename --image-name to --container-name

* Remove allowInsecure since it was messing with the api parsing

* Fix for env var being empty string

* Rename to --dapr-instrumentation-key, only infer ACR credentials if --registry-server is provided

* Remove az containerapp scale

* Fix delete containerapp errors

* Remove ingress, dapr flags from az containerapp update/revision copy

* Fix revision list -o table

* Help text fix

* Bump extension to 0.1.2

* Update managed identities and Dapr help text (Azure#25)

* Update managed identities and Dapr help text

* Update Dapr flags

* Add secretref note

* Env var options + various bug fixes (Azure#26)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fixed style issues, various bug fixes (Azure#27)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

* Fixed whitespace style issues.

* Styled clients and utils to pass pylint.

* Finished client.py pylint fixes.

* Fixed pylint issues.

* Fixed flake8 commands and custom.

* Fixed flake issues in src.

* Added license header to _sdk_models.

* Added confirmation for containerapp delete.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Update src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

* Specific Error Types + Bugfixes (Help, remove app-subnet-resource-id, removed env-var alias, added help text for --name) (Azure#28)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

* Fixed whitespace style issues.

* Styled clients and utils to pass pylint.

* Finished client.py pylint fixes.

* Fixed pylint issues.

* Fixed flake8 commands and custom.

* Fixed flake issues in src.

* Added license header to _sdk_models.

* Added confirmation for containerapp delete.

* Update helps for identity, revision. Removed env-var alias for set-env-vars. Added name param help.

* Removed app-subnet-resource-id.

* Updated infrastructure subnet param help.

* Check if containerapp resource exists before attempting to delete.

* Added check before deleting managed env.

* Changed error types to be more specific.

* Removed check before deletion. Removed comments.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Reset to 0.1.0 version, remove unneeded options-list

* Update min cli core version

* Fixed style issues. (Azure#30)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fix linter issues

* Use custom-show-command

* Removed --ids from revision, secret, registry list.

* Add linter exclusions

* Fix polling on delete containerapp

* Fix error handling

* Add Container App Service

* Fix flake linter

* Fix help text

* Mark extension as preview

* Add python 3.9 and 3.10 as supported

* Remove registries and secrets from az containerapp update, in favor of registry and secret subgroup

* Fix YAML not working

* Move import to inside deserialize function

* Ingress enable --transport default. Secret list returns empty array. Secret update prints message saying user needs to restart their apps. Added show-values flag to secret list. Fixed yaml datetime field issues, replaced x00 values that also came up during testing.

* Fixed dapr in create.

* Revert "Ingress enable --transport default. Secret list returns empty array. Secret update prints message saying user needs to restart their apps. Added show-values flag to secret list. Fixed yaml datetime field issues, replaced x00 values that also came up during testing."

This reverts commit 51bc543.

* Revert "Fixed dapr in create."

This reverts commit 37030ad.

* Ingress enable --transport default. Secret list returns empty array. Secret update prints message saying user needs to restart their apps. Added show-values flag to secret list. Fixed yaml datetime field issues, replaced x00 values that also came up during testing.

* Skeleton code

* az containerapp env show

* List kube/managed environments

* Create kube environment, wait doesn't work yet

* Update containerapp stubs (check if it is supported now)

* Containerapp env delete, polling not working yet

* Added polling for create and delete

* Use Microsoft.App RP for show, list, delete command

* Create containerapp env using Microsoft.App RP

* Add optional containerapp env create arguments

* Remove old kube environment code, naming fixes

* Containerapp create almost done

* Done containerapp create, except for --yaml. Need to test

* Containerapp show, list

* Fix helptext

* Containerapp delete

* Containerapp update. Needs secrets api to be implemented, and testing

* Add scale command

* Various validations, small fixes

* listSecrets API for updates, autogen log analytics for env

* Use space delimiter for secrets and env variables

* Verify sub is registered to Microsoft.ContainerRegistration if creating vnet enabled env, remove logs-type parameter

* Containerapp create --yaml

* Fix updating registry to do create or update

* Fix containerapp update command. Add image-name parameter to support multi container updates. Fix updating registries, containers and secrets

* started update with --yaml. Need to do create or update for when an attribute is a list of items

* use space delimiter for startup_command and args, instead of comma delimiter

* Traffic weights

* List and show revisions

* az containerapp revision restart, activate, deactivate

* Add ability for users to clear args/command in az containerapp update

* Various fixes, traffic weights fixes

* Verify subnet subscription is registered to Microsoft.ContainerServices

* GitHub Actions Update (Azure#17)

* Added models. Finished transferring Calvin's previous work.

* Updated wrong models.

* Updated models in custom.py, added githubactionclient.

* Updated envelope to be correct.

* Small bug fixes.

* Updated error handling. Fixed bugs. Initial working state.

* Added better error handling.

* Added error messages for tokens with inappropriate access rights.

* Added back get_acr_cred.

* Fixed problems from merge conflict.

* Updated names of imports from ._models.py to fix pylance erros.

* Removed random imports.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Remove --location since location must be same as managed env

* Add options for flag names: --env-vars and --registry-srever

* Empty string to clear env_vars

* Default revisions_mode to single

* Infer acr credentials if it is acr and credentials are not provided

* fix help msg

* if image is hosted on acr, and no registry server is supplied, infer the registry server

* Added subgroups (Ingress, Registry, Secret) and updated revisions (Azure#18)

* Added ingress subgroup.

* Added help for ingress.

* Fixed ingress traffic help.

* Added registry commands.

* Updated registry remove util to clear secrets if none remaining. Added warning when updating existing registry. Added registry help.

* Changed registry delete to remove.

* Added error message if user tries to remove non assigned registry.

* Changed registry add back to registry set.

* Added secret subgroup commands.

* Removed yaml support from secret set.

* Changed secret add to secret set. Updated consistency between secret set and secret delete. Added secret help. Require at least one secret passed with --secrets for secret commands.

* Changed param name for secret delete from --secrets to --secret-names. Updated help.

* Changed registry remove to registry delete.

* Fixed bug in registry delete.

* Added revision mode set and revision copy.

* Modified update_containerapp_yaml to support updating from non-current revision.

Authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* More p0 fixes (Azure#20)

* Remove --registry-login-server, only allow --registry-server

* Rename --environment-variables to --env-vars

* If no image is supplied, use default quickstart image

* Update help text (Azure#21)

* Update help text

* Update punctuation

* master -> main

* New 1.0.1 version

* Added identity commands + --assign-identity flag to containerapp create (#8)

* Added identity show and assign.

* Finisheed identity remove.

* Added helps, updated identity remove to work with identity names instead of requiring identity resource ids.

* Moved helper function to utils.

* Require --identities flag when removing identities.

* Added message for assign identity with no specified identity.

* Added --assign-identity flag to containerapp create.

* Moved assign-identity flag to containerapp create.

* Fixed small logic error on remove identities when passing duplicate identities. Added warnings for certain edge cases.

* Updated param definition for identity assign --identity default.

* Added identity examples in help.

* Made sure secrets were not removed when assigning identities. Added tolerance for [system] passed with capital letters.

* Fixed error from merge.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Dapr Commands (Azure#23)

* Added ingress subgroup.

* Added help for ingress.

* Fixed ingress traffic help.

* Added registry commands.

* Updated registry remove util to clear secrets if none remaining. Added warning when updating existing registry. Added registry help.

* Changed registry delete to remove.

* Added error message if user tries to remove non assigned registry.

* Changed registry add back to registry set.

* Added secret subgroup commands.

* Removed yaml support from secret set.

* Changed secret add to secret set. Updated consistency between secret set and secret delete. Added secret help. Require at least one secret passed with --secrets for secret commands.

* Changed param name for secret delete from --secrets to --secret-names. Updated help.

* Changed registry remove to registry delete.

* Fixed bug in registry delete.

* Added revision mode set and revision copy.

* Added dapr enable and dapr disable. Need to test more.

* Added list, show, set dapr component. Added dapr enable, disable.

* Added delete dapr delete.

* Added helps and param text.

* Changed dapr delete to dapr remove to match with dapr set.

* Commented out managed identity for whl file.

* Uncommented.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Rename --image-name to --container-name

* Remove allowInsecure since it was messing with the api parsing

* Fix for env var being empty string

* Rename to --dapr-instrumentation-key, only infer ACR credentials if --registry-server is provided

* Remove az containerapp scale

* Fix delete containerapp errors

* Remove ingress, dapr flags from az containerapp update/revision copy

* Fix revision list -o table

* Help text fix

* Bump extension to 0.1.2

* Update managed identities and Dapr help text (Azure#25)

* Update managed identities and Dapr help text

* Update Dapr flags

* Add secretref note

* Env var options + various bug fixes (Azure#26)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fixed style issues, various bug fixes (Azure#27)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

* Fixed whitespace style issues.

* Styled clients and utils to pass pylint.

* Finished client.py pylint fixes.

* Fixed pylint issues.

* Fixed flake8 commands and custom.

* Fixed flake issues in src.

* Added license header to _sdk_models.

* Added confirmation for containerapp delete.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Update src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

* Specific Error Types + Bugfixes (Help, remove app-subnet-resource-id, removed env-var alias, added help text for --name) (Azure#28)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

* Fixed whitespace style issues.

* Styled clients and utils to pass pylint.

* Finished client.py pylint fixes.

* Fixed pylint issues.

* Fixed flake8 commands and custom.

* Fixed flake issues in src.

* Added license header to _sdk_models.

* Added confirmation for containerapp delete.

* Update helps for identity, revision. Removed env-var alias for set-env-vars. Added name param help.

* Removed app-subnet-resource-id.

* Updated infrastructure subnet param help.

* Check if containerapp resource exists before attempting to delete.

* Added check before deleting managed env.

* Changed error types to be more specific.

* Removed check before deletion. Removed comments.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Reset to 0.1.0 version, remove unneeded options-list

* Update min cli core version

* Fixed style issues. (Azure#30)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fix linter issues

* Use custom-show-command

* Removed --ids from revision, secret, registry list.

* Add linter exclusions

* Fix polling on delete containerapp

* Fix error handling

* Add Container App Service

* Fix flake linter

* Fix help text

* Mark extension as preview

* Add python 3.9 and 3.10 as supported

* Remove registries and secrets from az containerapp update, in favor of registry and secret subgroup

* Fix YAML not working

* Move import to inside deserialize function

* Dapr moved from Template to Configuration

* Use aka.ms link for containerapps yaml

* Updated dapr enable/disable to current spec.

* Fixed oversight.

* Remove revisions-mode from containerapp update

* Fixed dapr enable property names. (Azure#47)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fix exceptions with using --yaml in containerapp create/update

* Rename history msg

* Include fqdn in containerapp table output

* Added ingress messages.

* Revert history msg

* Reduced redundant code between revision copy and containerapp update.

* Fixed merge issues.

* Fixed merge conflicts, moved helper function

Co-authored-by: Calvin Chan <calvinch4n@gmail.com>
Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>
Co-authored-by: Anthony Chu <anthony@anthonychu.ca>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

* Fix help for linter

* various fixes, helptext (Azure#59)

* Fixes (Azure#60)

* Updated managed identity + help. (Azure#61)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Added user-assigned and system-assigned to containerapp create. (Azure#62)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Bump version to 0.1.1 (Azure#63)

* Added more specific MSI help text. (Azure#64)

* Added more specific MSI help text.

* Updated help text.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Bump to 0.3.0 (Azure#65)

* Container App Test suite (Azure#67)

* Add tests for containerapp create

* All tests under the same function to share environment - need to figure how to get multiple functions to share environment

* Basic tests

* use new GH actions API

* remove live only recordings

* update CODEOWNERS

* fix API version naming

* Managed Identity Tests (Azure#69)

* Added managed identity tests.

* Fixed msi tests.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* resolve review comments

* Managed Identity Fixes (Azure#71)

* Added managed identity tests.

* Fixed msi tests.

* Added live_only to managed identity tests.

* Changed region to eastus2 from canary.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Update src/containerapp/azext_containerapp/_params.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

* 4/26 release: Up with --repo/--browse, exec (ssh) command, replica commands, log streaming commands  (Azure#72)

* Skeleton code

* az containerapp env show

* List kube/managed environments

* Create kube environment, wait doesn't work yet

* Update containerapp stubs (check if it is supported now)

* Containerapp env delete, polling not working yet

* Added polling for create and delete

* Use Microsoft.App RP for show, list, delete command

* Create containerapp env using Microsoft.App RP

* Add optional containerapp env create arguments

* Remove old kube environment code, naming fixes

* Containerapp create almost done

* Done containerapp create, except for --yaml. Need to test

* Containerapp show, list

* Fix helptext

* Containerapp delete

* Containerapp update. Needs secrets api to be implemented, and testing

* Add scale command

* Various validations, small fixes

* listSecrets API for updates, autogen log analytics for env

* Use space delimiter for secrets and env variables

* Verify sub is registered to Microsoft.ContainerRegistration if creating vnet enabled env, remove logs-type parameter

* Containerapp create --yaml

* Fix updating registry to do create or update

* Fix containerapp update command. Add image-name parameter to support multi container updates. Fix updating registries, containers and secrets

* started update with --yaml. Need to do create or update for when an attribute is a list of items

* use space delimiter for startup_command and args, instead of comma delimiter

* Traffic weights

* List and show revisions

* az containerapp revision restart, activate, deactivate

* Add ability for users to clear args/command in az containerapp update

* Various fixes, traffic weights fixes

* Verify subnet subscription is registered to Microsoft.ContainerServices

* GitHub Actions Update (Azure#17)

* Added models. Finished transferring Calvin's previous work.

* Updated wrong models.

* Updated models in custom.py, added githubactionclient.

* Updated envelope to be correct.

* Small bug fixes.

* Updated error handling. Fixed bugs. Initial working state.

* Added better error handling.

* Added error messages for tokens with inappropriate access rights.

* Added back get_acr_cred.

* Fixed problems from merge conflict.

* Updated names of imports from ._models.py to fix pylance erros.

* Removed random imports.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Remove --location since location must be same as managed env

* Add options for flag names: --env-vars and --registry-srever

* Empty string to clear env_vars

* Default revisions_mode to single

* Infer acr credentials if it is acr and credentials are not provided

* fix help msg

* if image is hosted on acr, and no registry server is supplied, infer the registry server

* Added subgroups (Ingress, Registry, Secret) and updated revisions (Azure#18)

* Added ingress subgroup.

* Added help for ingress.

* Fixed ingress traffic help.

* Added registry commands.

* Updated registry remove util to clear secrets if none remaining. Added warning when updating existing registry. Added registry help.

* Changed registry delete to remove.

* Added error message if user tries to remove non assigned registry.

* Changed registry add back to registry set.

* Added secret subgroup commands.

* Removed yaml support from secret set.

* Changed secret add to secret set. Updated consistency between secret set and secret delete. Added secret help. Require at least one secret passed with --secrets for secret commands.

* Changed param name for secret delete from --secrets to --secret-names. Updated help.

* Changed registry remove to registry delete.

* Fixed bug in registry delete.

* Added revision mode set and revision copy.

* Modified update_containerapp_yaml to support updating from non-current revision.

Authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* More p0 fixes (Azure#20)

* Remove --registry-login-server, only allow --registry-server

* Rename --environment-variables to --env-vars

* If no image is supplied, use default quickstart image

* Update help text (Azure#21)

* Update help text

* Update punctuation

* master -> main

* New 1.0.1 version

* Added identity commands + --assign-identity flag to containerapp create (#8)

* Added identity show and assign.

* Finisheed identity remove.

* Added helps, updated identity remove to work with identity names instead of requiring identity resource ids.

* Moved helper function to utils.

* Require --identities flag when removing identities.

* Added message for assign identity with no specified identity.

* Added --assign-identity flag to containerapp create.

* Moved assign-identity flag to containerapp create.

* Fixed small logic error on remove identities when passing duplicate identities. Added warnings for certain edge cases.

* Updated param definition for identity assign --identity default.

* Added identity examples in help.

* Made sure secrets were not removed when assigning identities. Added tolerance for [system] passed with capital letters.

* Fixed error from merge.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Dapr Commands (Azure#23)

* Added ingress subgroup.

* Added help for ingress.

* Fixed ingress traffic help.

* Added registry commands.

* Updated registry remove util to clear secrets if none remaining. Added warning when updating existing registry. Added registry help.

* Changed registry delete to remove.

* Added error message if user tries to remove non assigned registry.

* Changed registry add back to registry set.

* Added secret subgroup commands.

* Removed yaml support from secret set.

* Changed secret add to secret set. Updated consistency between secret set and secret delete. Added secret help. Require at least one secret passed with --secrets for secret commands.

* Changed param name for secret delete from --secrets to --secret-names. Updated help.

* Changed registry remove to registry delete.

* Fixed bug in registry delete.

* Added revision mode set and revision copy.

* Added dapr enable and dapr disable. Need to test more.

* Added list, show, set dapr component. Added dapr enable, disable.

* Added delete dapr delete.

* Added helps and param text.

* Changed dapr delete to dapr remove to match with dapr set.

* Commented out managed identity for whl file.

* Uncommented.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Rename --image-name to --container-name

* Remove allowInsecure since it was messing with the api parsing

* Fix for env var being empty string

* Rename to --dapr-instrumentation-key, only infer ACR credentials if --registry-server is provided

* Remove az containerapp scale

* Fix delete containerapp errors

* Remove ingress, dapr flags from az containerapp update/revision copy

* Fix revision list -o table

* Help text fix

* Bump extension to 0.1.2

* Update managed identities and Dapr help text (Azure#25)

* Update managed identities and Dapr help text

* Update Dapr flags

* Add secretref note

* Env var options + various bug fixes (Azure#26)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fixed style issues, various bug fixes (Azure#27)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

* Fixed whitespace style issues.

* Styled clients and utils to pass pylint.

* Finished client.py pylint fixes.

* Fixed pylint issues.

* Fixed flake8 commands and custom.

* Fixed flake issues in src.

* Added license header to _sdk_models.

* Added confirmation for containerapp delete.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Update src/containerapp/azext_containerapp/tests/latest/test_containerapp_scenario.py

Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>

* Specific Error Types + Bugfixes (Help, remove app-subnet-resource-id, removed env-var alias, added help text for --name) (Azure#28)

* Moved dapr arguments to env as a subgroup.

* Added env variable options.

* Changed revision mode set to revision set-mode.

* Added env var options to revision copy.

* Fixed revision copy bug related to env secret refs.

* Changed registry and secret delete to remove. Added registry param helps. Removed replica from table output and added trafficWeight.

* Updating warning text.

* Updated warning text once more.

* Made name optional for revision copy if from-revision flag is passed.

* Fixed whitespace style issues.

* Styled clients and utils to pass pylint.

* Finished client.py pylint fixes.

* Fixed pylint issues.

* Fixed flake8 commands and custom.

* Fixed flake issues in src.

* Added license header to _sdk_models.

* Added confirmation for containerapp delete.

* Update helps for identity, revision. Removed env-var alias for set-env-vars. Added name param help.

* Removed app-subnet-resource-id.

* Updated infrastructure subnet param help.

* Check if containerapp resource exists before attempting to delete.

* Added check before deleting managed env.

* Changed error types to be more specific.

* Removed check before deletion. Removed comments.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Reset to 0.1.0 version, remove unneeded options-list

* Update min cli core version

* Fixed style issues. (Azure#30)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fix linter issues

* Use custom-show-command

* Removed --ids from revision, secret, registry list.

* Add linter exclusions

* Fix polling on delete containerapp

* Fix error handling

* Add Container App Service

* Fix flake linter

* Fix help text

* Mark extension as preview

* Add python 3.9 and 3.10 as supported

* Remove registries and secrets from az containerapp update, in favor of registry and secret subgroup

* Fix YAML not working

* Move import to inside deserialize function

* Dapr moved from Template to Configuration

* Use aka.ms link for containerapps yaml

* Updated dapr enable/disable to current spec.

* Fixed oversight.

* Remove revisions-mode from containerapp update

* Fixed dapr enable property names. (Azure#47)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fix exceptions with using --yaml in containerapp create/update

* Rename history msg

* Include fqdn in containerapp table output

* Added ingress messages.

* Revert history msg

* Add basic test case

* Remove managed-identity support for first release of CLI

* Need to investigate test flakiness

* Update _help.py

removing duplicate help

* Added prototype of container up.

* Fixed deploy from acr registry image infer credentials issue.

* Tried to add source.

* Added acr build.

* Finished acr build functionality.

* Added acr create functionality and pull registry from existing containerapp if it exists.

* Fixed bugs.

* Check if rg exists and create one with name if it doesn't.

* initial containerapp ssh implementation

* fix interactive commands (vim); handle ctrl + c instead of exiting

* fix style and linter issues

* Added disable verbose. Moved utils into utils.py.

* fix for ssh for windows clients

* fix for unix

* Disable verbose now uses sdk poller so it gives running animation.

* Added helps for params. Added error handling for non acr registry passed with source. Ignore param disable_warnings for create and no_wait for up.

* Updated disable_warnings ignore. Removed disable_warnings from update_containerapp.

* add terminal resizing

* reorganize code; implement terminal resizing, add startup command param, etc

* organize code, remove token from warning output

* add validations, add replica commands

* use the correct API for fetching default container; remove is_preview

* Renamed silent to quiet.

* Fixed style issues.

* add log streaming, bump version number and add to HISTORY.rst

* add basic ssh test

* Added workspace name and fqdn to dry_run_str. Added indicators of if the resources are new or existing to dry_run_str.

* fix ssh test for windows

* Check RP for location when not provided. Open Dockerfile and use EXPOSE for CA port.

* fix windows arrow keys after exit

* fix typo, add logstream test, remove token from logstream output

* Removed print statement.

* Updated dockerfile expose automatic ingress feature.

* Removed dry run str, added dry run obj instead.

* use bearer auth; fix --command bug

* add handling for smooth transition to new URL path

* Fixed merge conflict.

* fix merge conflicts

* Create env if name passed and it doesn't exist.

* Added missing import from merge.

* Added prototype for new environment workflow.

* Finished environment logic.

* Minor updates before demo.

* add 'az containerapp github up' (wip)

* various fixes for demo

* rearrange github up code

* merge haroonf/containerappup

* start up refactor

* add --repo to up and refactor up

* reorganize code more; fix various bugs

* fix linter issues, fix lingering exec/tail improvements

* update history

* update output

* bug fixes for --repo

* fix --source bug

* fix --source

* minor bug fixes

* Added API change.

* Finished API change, added helloworld image auto ingress, checked provisioning state beforehand.

* fixes for sisira's comments

* fix minor typo

* bug fix where commands fail if providing registry creds

* Fixed style issues.

* Updated help and version text.

Co-authored-by: Calvin Chan <calvinch4n@gmail.com>
Co-authored-by: Haroon Feisal <38823870+haroonf@users.noreply.github.com>
Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>
Co-authored-by: Anthony Chu <anthony@anthonychu.ca>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
Co-authored-by: Sisira Panchagnula <panchagnula@users.noreply.github.com>

* Fixed small issue with test.

* Removed flake exclusions and removed type=str from params.

* Fixed repo bug when searching for dockerfile, increased timeout on github action complete, fixed datetime import issue from style fix.

* Added env var changes.

* Assume port if ingress is provided with image and port is not.

* Fixed small helloworld error.

* Fixed logger typo.

* Search for acr before creating one.

* Fixed bug where only --environment is passed. Changed hash on acr name to make it more unique. Tiny change in find_existing_acr.

* error out if dockerfile not found (--repo)

* Fixed bug with --image. Changed logger warning output. Disabled warnings on the registry update code for containerapp up. Added HELLOWORLD constant.

* Disabled no_wait. Added better error handling for up API calls. Updated ingress infer warning text. Fixed typo. Moved create_if_needed to environment.

* fix ACR length cap; enforce name/secret limits; trigger GH action if needed (update with GH actions already extant); fail command if GH action ends in failure

* force exact match for ACR retrieval (prevents secrets issues for --repo)

* fix hashing and add GH validations

* don't retrieve a registry if one provided; take RG from env if possible

* Fixed --registry-server with --image bug. (Azure#78)

* Fixed --registry-server with --image bug.

* Fixed style issues.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* use SP creds if provided

* fix github actions (less polling)

* Added prototype for env check.

* Honor location and environment passed to create new containerapp (even if a CA exists on subscription with the same name) (Azure#79)

* Create new Containerapp if user passes env name even if a CA exists with the same name.

* Create a new app if location doesn't match any other app.

* Fixed small bug, added better error handling for multiple environments with the same name on subscription.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* print created SP name/id; prevent using ACR names longer than 20 chars with --repo; add basic --image test

* fix style; add license header

* Finished core logic.

* add max core cli version 2.36.0

* make ACR name more unique (must be globally unique)

* Finished logic.

* sort workflows by date before selecting one

* log workflow

* Added error message with eligible locations if users pass uneligible location.

* Added function to check if env already exists so we don't try to update the location value of an existing environment.

* Added error handling for location northcentralusstage. Added list of eligible locations to unallowed location error message.

* Small fixes, implemented check_env_name_on_rg.

* location bug fix

* fix style

* bump version number

* Updates to tests (Azure#82)

* Updates to update tests

* Update api version for create

* Remove recordings (Azure#83)

* prevent using --only-show-errors, --output, -o in up

* Added FileShare commands. (Azure#84)

* Added FileShare commands.

* Updated params to match spec. Added param help.

* Added help. Removed --ids support.

* Removed automatic import statements.

* Added back type in help.

* Added tests.

* Updated param names to better reflect AzureFile dependency.

* Added validation to ensure share name and account name are longer than 2 characters. Seems to be an API issue.

* Added warning message if user is updating existing storage.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Fixed bug. (Azure#86)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* register log analytics resource provider if not registered when creating an env with up

* fix style

* Fixed linter issue.

* fix linter issues

* update history file

* Moved constant to constants.py.

* add timeout to container app ping for ssh/logstream

* Various tests (Ingress, Traffic, Dapr, Env) (Azure#87)

* Added env tests.

* Added ingress tests.

* Added ingress traffic tests.

* Fixed small issue.

* Added remove test for dapr components.

* Removed live_only from containerapp commands. Added recordings.

* Removed live_only from env commands.

* Removed sleep 60 since we use poll for delete anyways.

* Wrote better dapr-component tests. Fixed old tests that required live only.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Revert "Various tests (Ingress, Traffic, Dapr, Env) (Azure#87)" (Azure#88)

This reverts commit 40ca5b9.

* Reverted fileshare. (Azure#90)

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>

* Tests (dapr-components, env, ingress, traffic) (Azure#89)

* Added env tests.

* Added ingress tests.

* Added ingress traffic tests.

* Fixed small issue.

* Added remove test for dapr components.

* Removed live_only from containerapp commands. Added recordings.

* Removed live_only from env commands.

* Removed sleep 60 since we use poll for delete anyways.

* Wrote better dapr-component tests. Fixed old tests that required live only.

* Added suppression for log analytics dummy secrets.

* Rerecorded tests.

* rerecord failing tests

* Updated credscan.

Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>
Co-authored-by: Silas Strawn <strawnsc@gmail.com>

* adding certs cmd & test

* adding hostname cmds & test

* changes based on comments

* changes based on comments

Co-authored-by: Haroon Feisal <38823870+haroonf@users.noreply.github.com>
Co-authored-by: Calvin Chan <calvinch4n@gmail.com>
Co-authored-by: Haroon Feisal <haroonfeisal@microsoft.com>
Co-authored-by: Anthony Chu <anthony@anthonychu.ca>
Co-authored-by: Xing Zhou <Zhou.Xing@microsoft.com>
Co-authored-by: Silas Strawn <strawnsc@gmail.com>
Co-authored-by: Sisira Panchagnula <panchagnula@users.noreply.github.com>
  • Loading branch information
8 people committed May 19, 2022
1 parent a637114 commit 0eca228
Show file tree
Hide file tree
Showing 16 changed files with 6,163 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/containerapp/HISTORY.rst
Expand Up @@ -6,6 +6,9 @@ Release History
0.3.5
++++++
* Add parameter --zone-redundant to 'az containerapp env create'
* Added 'az containerapp env certificate' to manage certificates in a container app environment
* Added 'az containerapp hostname' to manage hostnames in a container app
* Added 'az containerapp ssl upload' to upload a certificate, add a hostname and the binding to a container app

0.3.4
++++++
Expand Down
104 changes: 104 additions & 0 deletions src/containerapp/azext_containerapp/_clients.py
Expand Up @@ -415,6 +415,22 @@ def get_auth_token(cls, cmd, resource_group_name, name):
r = send_raw_request(cmd.cli_ctx, "POST", request_url)
return r.json()

@classmethod
def validate_domain(cls, cmd, resource_group_name, name, hostname):
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/containerApps/{}/listCustomHostNameAnalysis?api-version={}&customHostname={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
name,
STABLE_API_VERSION,
hostname)

r = send_raw_request(cmd.cli_ctx, "POST", request_url)
return r.json()


class ManagedEnvironmentClient():
@classmethod
Expand Down Expand Up @@ -584,6 +600,94 @@ def list_by_resource_group(cls, cmd, resource_group_name, formatter=lambda x: x)

return env_list

@classmethod
def show_certificate(cls, cmd, resource_group_name, name, certificate_name):
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
api_version = STABLE_API_VERSION
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}?api-version={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
name,
certificate_name,
api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url, body=None)
return r.json()

@classmethod
def list_certificates(cls, cmd, resource_group_name, name, formatter=lambda x: x):
certs_list = []

management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
api_version = STABLE_API_VERSION
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates?api-version={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
name,
api_version)

r = send_raw_request(cmd.cli_ctx, "GET", request_url, body=None)
j = r.json()
for cert in j["value"]:
formatted = formatter(cert)
certs_list.append(formatted)
return certs_list

@classmethod
def create_or_update_certificate(cls, cmd, resource_group_name, name, certificate_name, certificate):
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
api_version = STABLE_API_VERSION
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}?api-version={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
name,
certificate_name,
api_version)

r = send_raw_request(cmd.cli_ctx, "PUT", request_url, body=json.dumps(certificate))
return r.json()

@classmethod
def delete_certificate(cls, cmd, resource_group_name, name, certificate_name):
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
api_version = STABLE_API_VERSION
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/certificates/{}?api-version={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
name,
certificate_name,
api_version)

return send_raw_request(cmd.cli_ctx, "DELETE", request_url, body=None)

@classmethod
def check_name_availability(cls, cmd, resource_group_name, name, name_availability_request):
management_hostname = cmd.cli_ctx.cloud.endpoints.resource_manager
api_version = STABLE_API_VERSION
sub_id = get_subscription_id(cmd.cli_ctx)
url_fmt = "{}/subscriptions/{}/resourceGroups/{}/providers/Microsoft.App/managedEnvironments/{}/checkNameAvailability?api-version={}"
request_url = url_fmt.format(
management_hostname.strip('/'),
sub_id,
resource_group_name,
name,
api_version)

r = send_raw_request(cmd.cli_ctx, "POST", request_url, body=json.dumps(name_availability_request))
return r.json()


class GitHubActionClient():
@classmethod
Expand Down
2 changes: 2 additions & 0 deletions src/containerapp/azext_containerapp/_constants.py
Expand Up @@ -12,3 +12,5 @@
LOG_ANALYTICS_RP = "Microsoft.OperationalInsights"

MAX_ENV_PER_LOCATION = 2

CHECK_CERTIFICATE_NAME_AVAILABILITY_TYPE = "Microsoft.App/managedEnvironments/certificates"
93 changes: 93 additions & 0 deletions src/containerapp/azext_containerapp/_help.py
Expand Up @@ -423,6 +423,56 @@
az containerapp env storage remove -g MyResourceGroup --storage-name MyStorageName -n MyEnvironment
"""

# Certificates Commands
helps['containerapp env certificate'] = """
type: group
short-summary: Commands to manage certificates for the Container Apps environment.
"""

helps['containerapp env certificate list'] = """
type: command
short-summary: List certificates for an environment.
examples:
- name: List certificates for an environment.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment
- name: List certificates by certificate id.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment --certificate MyCertificateId
- name: List certificates by certificate name.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment --certificate MyCertificateName
- name: List certificates by certificate thumbprint.
text: |
az containerapp env certificate list -g MyResourceGroup --name MyEnvironment --thumbprint MyCertificateThumbprint
"""

helps['containerapp env certificate upload'] = """
type: command
short-summary: Add or update a certificate.
examples:
- name: Add or update a certificate.
text: |
az containerapp env certificate upload -g MyResourceGroup --name MyEnvironment --certificate-file MyFilepath
- name: Add or update a certificate with a user-provided certificate name.
text: |
az containerapp env certificate upload -g MyResourceGroup --name MyEnvironment --certificate-file MyFilepath --certificate-name MyCertificateName
"""

helps['containerapp env certificate delete'] = """
type: command
short-summary: Delete a certificate from the Container Apps environment.
examples:
- name: Delete a certificate from the Container Apps environment by certificate name
text: |
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --certificate MyCertificateName
- name: Delete a certificate from the Container Apps environment by certificate id
text: |
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --certificate MyCertificateId
- name: Delete a certificate from the Container Apps environment by certificate thumbprint
text: |
az containerapp env certificate delete -g MyResourceGroup --name MyEnvironment --thumbprint MyCertificateThumbprint
"""

# Identity Commands
helps['containerapp identity'] = """
Expand Down Expand Up @@ -714,3 +764,46 @@
text: |
az containerapp dapr disable -n MyContainerapp -g MyResourceGroup
"""

# custom domain Commands
helps['containerapp ssl'] = """
type: group
short-summary: Upload certificate to a managed environment, add hostname to an app in that environment, and bind the certificate to the hostname
"""

helps['containerapp ssl upload'] = """
type: command
short-summary: Upload certificate to a managed environment, add hostname to an app in that environment, and bind the certificate to the hostname
"""

helps['containerapp hostname'] = """
type: group
short-summary: Commands to manage hostnames of a container app.
"""

helps['containerapp hostname bind'] = """
type: command
short-summary: Add or update the hostname and binding with an existing certificate.
examples:
- name: Add or update hostname and binding.
text: |
az containerapp hostname bind -n MyContainerapp -g MyResourceGroup --hostname MyHostname --certificate MyCertificateId
"""

helps['containerapp hostname delete'] = """
type: command
short-summary: Delete hostnames from a container app.
examples:
- name: Delete secrets from a container app.
text: |
az containerapp hostname delete -n MyContainerapp -g MyResourceGroup --hostname MyHostname
"""

helps['containerapp hostname list'] = """
type: command
short-summary: List the hostnames of a container app.
examples:
- name: List the hostnames of a container app.
text: |
az containerapp hostname list -n MyContainerapp -g MyResourceGroup
"""
24 changes: 24 additions & 0 deletions src/containerapp/azext_containerapp/_models.py
Expand Up @@ -181,6 +181,14 @@
"tags": None
}

ContainerAppCertificateEnvelope = {
"location": None,
"properties": {
"password": None,
"value": None
}
}

DaprComponent = {
"properties": {
"componentType": None, # String
Expand Down Expand Up @@ -232,6 +240,22 @@
"subscriptionId": None # str
}

ContainerAppCustomDomainEnvelope = {
"properties": {
"configuration": {
"ingress": {
"customDomains": None
}
}
}
}

ContainerAppCustomDomain = {
"name": None,
"bindingType": "SniEnabled",
"certificateId": None
}

AzureFileProperties = {
"accountName": None,
"accountKey": None,
Expand Down
33 changes: 33 additions & 0 deletions src/containerapp/azext_containerapp/_params.py
Expand Up @@ -149,6 +149,20 @@ def load_arguments(self, _):
with self.argument_context('containerapp env show') as c:
c.argument('name', name_type, help='Name of the Container Apps Environment.')

with self.argument_context('containerapp env certificate upload') as c:
c.argument('certificate_file', options_list=['--certificate-file', '-f'], help='The filepath of the .pfx or .pem file')
c.argument('certificate_name', options_list=['--certificate-name', '-c'], help='Name of the certificate which should be unique within the Container Apps environment.')
c.argument('certificate_password', options_list=['--password', '-p'], help='The certificate file password')

with self.argument_context('containerapp env certificate list') as c:
c.argument('name', id_part=None)
c.argument('certificate', options_list=['--certificate', '-c'], help='Name or resource id of the certificate.')
c.argument('thumbprint', options_list=['--thumbprint', '-t'], help='Thumbprint of the certificate.')

with self.argument_context('containerapp env certificate delete') as c:
c.argument('certificate', options_list=['--certificate', '-c'], help='Name or resource id of the certificate.')
c.argument('thumbprint', options_list=['--thumbprint', '-t'], help='Thumbprint of the certificate.')

with self.argument_context('containerapp env storage') as c:
c.argument('name', id_part=None)
c.argument('storage_name', help="Name of the storage.")
Expand Down Expand Up @@ -257,3 +271,22 @@ def load_arguments(self, _):
c.argument('service_principal_client_id', help='The service principal client ID. Used by Github Actions to authenticate with Azure.', options_list=["--service-principal-client-id", "--sp-cid"])
c.argument('service_principal_client_secret', help='The service principal client secret. Used by Github Actions to authenticate with Azure.', options_list=["--service-principal-client-secret", "--sp-sec"])
c.argument('service_principal_tenant_id', help='The service principal tenant ID. Used by Github Actions to authenticate with Azure.', options_list=["--service-principal-tenant-id", "--sp-tid"])

with self.argument_context('containerapp ssl upload') as c:
c.argument('hostname', help='The custom domain name.')
c.argument('environment', options_list=['--environment', '-e'], help='Name or resource id of the Container App environment.')
c.argument('certificate_file', options_list=['--certificate-file', '-f'], help='The filepath of the .pfx or .pem file')
c.argument('certificate_password', options_list=['--password', '-p'], help='The certificate file password')
c.argument('certificate_name', options_list=['--certificate-name', '-c'], help='Name of the certificate which should be unique within the Container Apps environment.')

with self.argument_context('containerapp hostname bind') as c:
c.argument('hostname', help='The custom domain name.')
c.argument('thumbprint', options_list=['--thumbprint', '-t'], help='Thumbprint of the certificate.')
c.argument('certificate', options_list=['--certificate', '-c'], help='Name or resource id of the certificate.')
c.argument('environment', options_list=['--environment', '-e'], help='Name or resource id of the Container App environment.')

with self.argument_context('containerapp hostname list') as c:
c.argument('name', id_part=None)

with self.argument_context('containerapp hostname delete') as c:
c.argument('hostname', help='The custom domain name.')

0 comments on commit 0eca228

Please sign in to comment.