Azure / azure-cli-extensions

Public Repository for Extensions of Azure CLI.
https://docs.microsoft.com/en-us/cli/azure
MIT License
381 stars 1.2k forks source link

Arc: appservice kube gives "required pods not present" #7174

Open mribrgr opened 8 months ago

mribrgr commented 8 months ago

Describe the bug

Seem to not be able to find the required app service pods, maybe wrong params.

When running az appservice kube create --resource-group $resource_group --name $name --custom-location $CUSTOM_LOCATION_NAME with the name being set to my arc-cluster-resource name and the custom_location_name being the name of the custom location (I used the same when running az customlocation create)

I get: "The required app service pods in not present in the kubernetes cluster."

Related command

az appservice kube create --resource-group $resource_group --name $name --custom-location $CUSTOM_LOCATION_NAME

Errors

"The required app service pods in not present in the kubernetes cluster."

Issue script & Debug output

cli.azure.cli.core.util: Request method: 'PUT'
cli.azure.cli.core.util: Request headers:
cli.azure.cli.core.util:     'User-Agent': 'python/3.11.6 (macOS-14.2.1-arm64-arm-64bit) AZURECLI/2.55.0 (HOMEBREW)'
cli.azure.cli.core.util:     'Accept-Encoding': 'gzip, deflate'
cli.azure.cli.core.util:     'Accept': '*/*'
cli.azure.cli.core.util:     'Connection': 'keep-alive'
cli.azure.cli.core.util:     'x-ms-client-request-id': '2d25f213-4b8e-410a-a35f-36b48ea00c71'
cli.azure.cli.core.util:     'Content-Type': 'application/json'
cli.azure.cli.core.util:     'CommandName': 'appservice kube create'
cli.azure.cli.core.util:     'ParameterSetName': '--resource-group --name --custom-location --debug'
cli.azure.cli.core.util:     'Authorization': 'Bearer eyJ0eXAiOiJKV...'
cli.azure.cli.core.util:     'Content-Length': '436'
cli.azure.cli.core.util: Request body:
cli.azure.cli.core.util: {"kind": null, "location": "westeurope", "tags": null, "properties": {"extendedLocation": {"customLocation": "/subscriptions/<mysubscriptionid>/resourceGroups/myresourcegroup/providers/Microsoft.ExtendedLocation/customLocations/mylocationname"}, "staticIp": null, "arcConfiguration": {"artifactsStorageType": "NetworkFileSystem", "artifactStorageClassName": "default", "frontEndServiceConfiguration": {"kind": "LoadBalancer"}}}}
urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443
urllib3.connectionpool: https://management.azure.com:443 "PUT /subscriptions/<mysubscriptionid>/resourceGroups/myresourcegroup/providers/Microsoft.Web/kubeEnvironments/myclustername?api-version=2020-12-01 HTTP/1.1" 400 510
cli.azure.cli.core.util: Response status: 400
cli.azure.cli.core.util: Response headers:
cli.azure.cli.core.util:     'Cache-Control': 'no-cache'
cli.azure.cli.core.util:     'Pragma': 'no-cache'
cli.azure.cli.core.util:     'Content-Length': '510'
cli.azure.cli.core.util:     'Content-Type': 'application/json; charset=utf-8'
cli.azure.cli.core.util:     'Expires': '-1'
cli.azure.cli.core.util:     'Strict-Transport-Security': 'max-age=31536000; includeSubDomains'
cli.azure.cli.core.util:     'Server': 'Microsoft-IIS/10.0'
cli.azure.cli.core.util:     'X-AspNet-Version': '4.0.30319'
cli.azure.cli.core.util:     'X-Powered-By': 'ASP.NET'
cli.azure.cli.core.util:     'x-ms-ratelimit-remaining-subscription-writes': '1199'
cli.azure.cli.core.util:     'x-ms-request-id': 'f3b0402d-26c9-4ad6-acb0-001cfa29a531'
cli.azure.cli.core.util:     'x-ms-correlation-request-id': 'f3b0402d-26c9-4ad6-acb0-001cfa29a531'
cli.azure.cli.core.util:     'x-ms-routing-request-id': 'GERMANYNORTH:20240111T102637Z:f3b0402d-26c9-4ad6-acb0-001cfa29a531'
cli.azure.cli.core.util:     'X-Content-Type-Options': 'nosniff'
cli.azure.cli.core.util:     'Date': 'Thu, 11 Jan 2024 10:26:37 GMT'
cli.azure.cli.core.util: Response content:
cli.azure.cli.core.util: {"Code":"BadRequest","Message":"The required app service pods in not present in the kubernetes cluster.","Target":null,"Details":[{"Message":"The required app service pods in not present in the kubernetes cluster."},{"Code":"BadRequest"},{"ErrorEntity":{"ExtendedCode":"59964","MessageTemplate":"The required app service pods in not present in the kubernetes cluster.","Parameters":[],"Code":"BadRequest","Message":"The required app service pods in not present in the kubernetes cluster."}}],"Innererror":null}
cli.azure.cli.core.azclierror: Traceback (most recent call last):
  File "/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
    results.append(self._run_job(expanded_arg, cmd_copy))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
             ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
           ^^^^^^^^^^^^^^^^^^
  File "/Users/myusername/.azure/cliextensions/appservice-kube/azext_appservice_kube/custom.py", line 367, in create_kube_environment
    raise ValidationError(msg)
azure.cli.core.azclierror.ValidationError: The required app service pods in not present in the kubernetes cluster.

cli.azure.cli.core.azclierror: The required app service pods in not present in the kubernetes cluster.
az_command_data_logger: The required app service pods in not present in the kubernetes cluster.
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x105580400>]
az_command_data_logger: exit code: 1

Expected behavior

not getting an error, but instead get it running through

Environment Summary


azure-cli                         2.55.0 *

core                              2.55.0 *
telemetry                          1.1.0

Extensions:
appservice-kube                    0.1.9
connectedk8s                       1.6.2
customlocation                     0.1.3
k8s-extension                      1.5.3

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

Python location '/opt/homebrew/Cellar/azure-cli/2.55.0/libexec/bin/python'
Extensions directory '/Users/mauritiusberger/.azure/cliextensions'

Python (Darwin) 3.11.6 (main, Oct  2 2023, 13:45:54) [Clang 15.0.0 (clang-1500.0.40.1)]

Legal docs and information: aka.ms/AzureCliLegal

### Additional context

_No response_
yonzhan commented 8 months ago

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

microsoft-github-policy-service[bot] commented 8 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @akashkeshari.

microsoft-github-policy-service[bot] commented 8 months ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @AzureAppServiceCLI, @antcp.