Azure / azure-cli

Azure Command-Line Interface
MIT License
3.88k stars 2.84k forks source link

Naming convention error when deploying IoT Operations (az iot ops init) #28986

Open JzNotJz opened 2 weeks ago

JzNotJz commented 2 weeks ago

Describe the bug

The Kubernetes cluster is created in GitHub Codespaces following the step by step quick start guide at https://learn.microsoft.com/en-us/azure/iot-operations/get-started/quickstart-deploy, and the cluster is certified to be configured correctly for deployment using verify-host command.

when deploying Azure IoT Operations, it failed with error message pointing to name convention problem.

Related command

az iot ops init --simulate-plc --cluster $CLUSTER_NAME --resource-group $RESOURCE_GROUP --kv-id $(az keyvault show --name ${CLUSTER_NAME:0:24} -o tsv --query id)

Errors

Command group 'iot ops' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus

Azure IoT Operations init
Workflow Id: c6e5cb626abd44b3ad320052970c6a12

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers
✔ Enumerate pre-flight checks

⠹ DONE! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Elapsed: 0:00:46

{ "status": "Failed", "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'aziotops.init.c6e5cb626abd44b3ad320052970c6a12' is not valid according to the validation procedure. The tracking id is '10754e43-543b-410c-8a28-aeeab84a1529'. See inner errors for details.", "details": [ { "code": "OpenAPISpecValidationFailedForTemplateDeploymentResources", "message": "One or more resources in template deployment preflight validation request failed during OpenApi spec (swagger) validation. Please check error details for the resource identifiers.", "details": [ { "code": "HttpRequestPayloadAPISpecValidationFailed", "message": "HTTP request payload failed validation against API specification with one or more errors. Please see details for more information.", "target": "/subscriptions/***/resourceGroups/IoTOps_QS/providers/Microsoft.IoTOperationsDataProcessor/instances/potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor", "details": [ { "code": "Pattern", "message": "String does not match pattern ^[a-z0-9][a-z0-9-]{1,60}[a-z0-9]$: potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor. Paths in payload: '.path.instanceName'" } ] } ] } ] } }

Issue script & Debug output

cli.knack.cli: Command arguments: ['iot', 'ops', 'init', '--simulate-plc', '--cluster', 'potential-space-rotary-phone-97xv76v9qr5fg45', '--resource-group', 'IoTOps_QS', '--kv-id', '/subscriptions/*/resourceGroups/IoTOps_QS/providers/Microsoft.KeyVault/vaults/potential-space-rotary-p', '--debug'] cli.knack.cli: init debug log: Enable color in terminal. cli.knack.cli: Event: Cli.PreExecute [] cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7f211db9c040>, <function OutputProducer.on_global_arguments at 0x7f211db4a160>, <function CLIQuery.on_global_arguments at 0x7f211db83c40>] cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] cli.azure.cli.core: Modules found from index for 'iot': ['azure.cli.command_modules.iot', 'azext_edge'] cli.azure.cli.core: Loading command modules: cli.azure.cli.core: Name Load Time Groups Commands cli.azure.cli.core: iot 0.208 19 82 cli.azure.cli.core: Total (1) 0.208 19 82 cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] cli.azure.cli.core: Loading extensions: cli.azure.cli.core: Name Load Time Groups Commands Directory cli.azure.cli.core: azure-iot-ops 0.213 9 29 /home/codespace/.azure/cliextensions/azure-iot-ops cli.azure.cli.core: Total (1) 0.213 9 29
cli.azure.cli.core: Loaded 27 groups, 111 commands. cli.azure.cli.core: Found a match in the command table. cli.azure.cli.core: Raw command : iot ops init cli.azure.cli.core: Command table: iot ops init cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7f211cc18ae0>] cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/codespace/.azure/commands/2024-05-17.18-14-00.iot_ops_init.163693.log'. az_command_data_logger: command args: iot ops init --simulate-plc --cluster {} --resource-group {} --kv-id {} --debug cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7f211cc69bc0>] cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad [] cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument..add_ids_arguments at 0x7f211cc80e00>, <function register_cache_arguments..add_cache_arguments at 0x7f211cc80f40>] cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded [] cli.knack.cli: Event: CommandInvoker.OnPreParseArgs [] cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x7f211db4a200>, <function CLIQuery.handle_query_parameter at 0x7f211db83ce0>, <function register_ids_argument..parse_ids_arguments at 0x7f211cc80ea0>, <function version_check_handler at 0x7f211b57a700>] az_command_data_logger: extension name: azure-iot-ops az_command_data_logger: extension version: 0.5.0b1 Command group 'iot ops' is in preview and under development. Reference and support levels: https://aka.ms/CLI_refstatus urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "HEAD / HTTP/1.1" 400 0 urllib3.connectionpool: Starting new HTTPS connection (1): graph.microsoft.com:443 urllib3.connectionpool: https://graph.microsoft.com:443 "HEAD / HTTP/1.1" 405 0 azure.identity._internal.decorators: AzureCliCredential.get_token succeeded azure.identity._internal.decorators: [Authenticated account] Client ID: 04b07795-8ddb-461a-bbee-02f9e1bf7b46. Tenant ID: 20544857-edc6-43b7-9cb7-1aef604d6ac1. User Principal Name: unavailableUpn. Object ID (user): 7f4bc615-a227-4729-8475-a2a20b273134 urllib3.connectionpool: Starting new HTTPS connection (1): management.azure.com:443 urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/****/resourceGroups/IoTOps_QS/providers/Microsoft.Kubernetes/connectedClusters/potential-space-rotary-phone-97xv76v9qr5fg45?api-version=2024-01-01 HTTP/1.1" 200 1870 urllib3.connectionpool: Starting new HTTPS connection (1): 0.0.0.0:35609 urllib3.connectionpool: https://0.0.0.0:35609 "GET /api/v1/namespaces/azure-arc/configmaps/azure-clusterconfig HTTP/1.1" 200 None kubernetes.client.rest: response body: {"kind":"ConfigMap","apiVersion":"v1","metadata":{"name":"azure-clusterconfig","namespace":"azure-arc","uid":"d9bffb9f-0d3f-49bf-b8d9-02f18b34307d","resourceVersion":"884","creationTimestamp":"2024-05-17T14:32:16Z","labels":{"app.kubernetes.io/managed-by":"Helm"},"annotations":{"meta.helm.sh/release-name":"azure-arc","meta.helm.sh/release-namespace":"azure-arc-release"},"managedFields":[{"manager":"helm","operation":"Update","apiVersion":"v1","time":"2024-05-17T14:32:16Z","fieldsType":"FieldsV1","fieldsV1":{"f:data":{".":{},"f:ACTIVE_DIRECTORY_ENDPOINT":{},"f:ARC_AGENT_HELM_CHART_NAME":{},"f:ARC_AGENT_RELEASE_TRAIN":{},"f:AZURE_ARC_AGENT_VERSION":{},"f:AZURE_ARC_AUTOUPDATE":{},"f:AZURE_ARC_HELM_NAMESPACE":{},"f:AZURE_ARC_RELEASE_NAME":{},"f:AZURE_ENVIRONMENT":{},"f:AZURE_REGION":{},"f:AZURE_RESOURCE_GROUP":{},"f:AZURE_RESOURCE_MANAGER_ENDPOINT":{},"f:AZURE_RESOURCE_NAME":{},"f:AZURE_SUBSCRIPTION_ID":{},"f:AZURE_TENANT_ID":{},"f:CLUSTER_CONNECT_AGENT_ENABLED":{},"f:CLUSTER_TYPE":{},"f:CUSTOM_IDENTITY_PROVIDER_ENABLED":{},"f:DEBUG_LOGGING":{},"f:ENABLE_EXTENSION_EVENT_COLLECTION_DATAPLANE":{},"f:ENABLE_EXTENSION_EVENT_COLLECTION_SERVICE":{},"f:ENABLE_OIDC_ISSUER":{},"f:EVENTS_URL":{},"f:EVENTS_URL_CROSS_NAMESPACE":{},"f:EXTENSION_CATALOG_CACHE_TTL_IN_MINUTES":{},"f:EXTENSION_CATALOG_DOWNLOAD_PATH":{},"f:EXTENSION_CATALOG_DOWNLOAD_VERSION":{},"f:EXTENSION_OPERATOR_ENABLED":{},"f:FLUX_CLIENT_DEFAULT_LOCATION":{},"f:FLUX_UPSTREAM_SERVICE_ENABLED":{},"f:FORCE_UPDATE_MSI_ADAPTER":{},"f:GITOPS_ENABLED":{},"f:GOFIPS":{},"f:GUARD_PKI_HOSTPATH":{},"f:HELM_AUTO_UPDATE_CHECK_FREQUENCY_IN_MINUTES":{},"f:HTTP_CUSTOM_DIALER_CHECK_HOST":{},"f:HTTP_CUSTOM_DIALER_CHECK_INTERVAL":{},"f:HTTP_CUSTOM_DIALER_DNS_ADDRESS":{},"f:HTTP_CUSTOM_DIALER_TIMEOUT":{},"f:HTTP_USE_CUSTOM_DIALER":{},"f:IS_CLIENT_SECRET_A_TOKEN":{},"f:IS_LEAST_PRIVILEGES_MODE":{},"f:IS_MARKETPLACE_STAGING_ENVIRONMENT":{},"f:IS_PACKAGE_SOURCE_VALIDATION_AUDIT_ONLY":{},"f:K8S_EVENT_LOGGING_ENABLED":{},"f:KUBERNETES_DISTRO":{},"f:KUBERNETES_INFRA":{},"f:MANAGED_IDENTITY_AUTH":{},"f:MAX_ENTRIES_PER_STORE":{},"f:MAX_STORES":{},"f:MSI_ADAPTER_ARTIFACT_PATH":{},"f:NO_AUTH_HEADER_DATA_PLANE":{},"f:ONBOARDING_SECRET_NAME":{},"f:ONBOARDING_SECRET_NAMESPACE":{},"f:PACKAGE_SOURCE_VALIDATION_ENABLED":{},"f:PLATFORM_SERVICE_ACCOUNT_NAME":{},"f:RESOURCE_SYNC_ENABLE_CHUNKED_SYNC":{},"f:RESOURCE_SYNC_LIST_CHUNK_SIZE":{},"f:RP_NAMESPACE":{},"f:TAGS":{}},"f:metadata":{"f:annotations":{".":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}}}}]},"data":{"ACTIVE_DIRECTORY_ENDPOINT":"","ARC_AGENT_HELM_CHART_NAME":"azure-arc-k8sagents","ARC_AGENT_RELEASE_TRAIN":"stable","AZURE_ARC_AGENT_VERSION":"1.15.6","AZURE_ARC_AUTOUPDATE":"true","AZURE_ARC_HELM_NAMESPACE":"azure-arc-release","AZURE_ARC_RELEASE_NAME":"azure-arc","AZURE_ENVIRONMENT":"AZUREPUBLICCLOUD","AZURE_REGION":"eastus","AZURE_RESOURCE_GROUP":"IoTOps_QS","AZURE_RESOURCE_MANAGER_ENDPOINT":"","AZURE_RESOURCE_NAME":"potential-space-rotary-phone-97xv76v9qr5fg45","AZURE_SUBSCRIPTION_ID":"*****","AZURE_TENANT_ID":"20544857-edc6-43b7-9cb7-1aef604d6ac1","CLUSTER_CONNECT_AGENT_ENABLED":"true","CLUSTER_TYPE":"ConnectedClusters","CUSTOM_IDENTITY_PROVIDER_ENABLED":"false","DEBUG_LOGGING":"false","ENABLE_EXTENSION_EVENT_COLLECTION_DATAPLANE":"false","ENABLE_EXTENSION_EVENT_COLLECTION_SERVICE":"true","ENABLE_OIDC_ISSUER":"false","EVENTS_URL":"http://extension-events-collector:8082","EVENTS_URL_CROSS_NAMESPACE":"http://extension-events-collector.azure-arc.svc.cluster.local:8082","EXTENSION_CATALOG_CACHE_TTL_IN_MINUTES":"14400","EXTENSION_CATALOG_DOWNLOAD_PATH":"https://mcr.microsoft.com/azurearck8s/extension-catalog","EXTENSION_CATALOG_DOWNLOAD_VERSION":"public","EXTENSION_OPERATOR_ENABLED":"true","FLUX_CLIENT_DEFAULT_LOCATION":"mcr.microsoft.com/azurearck8s/arc-preview/fluxctl:0.2.0","FLUX_UPSTREAM_SERVICE_ENABLED":"true","FORCE_UPDATE_MSI_ADAPTER":"false","GITOPS_ENABLED":"true","GOFIPS":"0","GUARD_PKI_HOSTPATH":"","HELM_AUTO_UPDATE_CHECK_FREQUENCY_IN_MINUTES":"60","HTTP_CUSTOM_DIALER_CHECK_HOST":"microsoft.com","HTTP_CUSTOM_DIALER_CHECK_INTERVAL":"5m","HTTP_CUSTOM_DIALER_DNS_ADDRESS":"1.1.1.1:53","HTTP_CUSTOM_DIALER_TIMEOUT":"30s","HTTP_USE_CUSTOM_DIALER":"false","IS_CLIENT_SECRET_A_TOKEN":"false","IS_LEAST_PRIVILEGES_MODE":"false","IS_MARKETPLACE_STAGING_ENVIRONMENT":"false","IS_PACKAGE_SOURCE_VALIDATION_AUDIT_ONLY":"true","K8S_EVENT_LOGGING_ENABLED":"true","KUBERNETES_DISTRO":"k3s","KUBERNETES_INFRA":"generic","MANAGED_IDENTITY_AUTH":"true","MAX_ENTRIES_PER_STORE":"680","MAX_STORES":"30","MSI_ADAPTER_ARTIFACT_PATH":"mcr.microsoft.com/azurearck8s/msi-adapter:1.0.8","NO_AUTH_HEADER_DATA_PLANE":"false","ONBOARDING_SECRET_NAME":"azure-arc-connect-privatekey","ONBOARDING_SECRET_NAMESPACE":"azure-arc","PACKAGE_SOURCE_VALIDATION_ENABLED":"true","PLATFORM_SERVICE_ACCOUNT_NAME":"","RESOURCE_SYNC_ENABLE_CHUNKED_SYNC":"true","RESOURCE_SYNC_LIST_CHUNK_SIZE":"200","RP_NAMESPACE":"Microsoft.Kubernetes","TAGS":"map[]"}}

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight

Azure IoT Operations init

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers

⠇ Work. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Elapsed: 0:00:05
urllib3.connectionpool: https://management.azure.com:443 "GET /subscriptions/**/resourceGroups/IoTOps_QS/providers/Microsoft.Kubernetes/connectedClusters/potential-space-rotary-phone-97xv76v9qr5fg45/providers/Microsoft.KubernetesConfiguration/extensions?api-version=2022-11-01 HTTP/1.1" 200 28 urllib3.connectionpool: Starting new HTTPS connection (1): 0.0.0.0:35609 urllib3.connectionpool: https://0.0.0.0:35609 "GET /apis/rbac.authorization.k8s.io/v1/clusterrolebindings?fieldSelector=metadata.name%3D%3DAzureArc-Microsoft.ExtendedLocation-RP-RoleBinding HTTP/1.1" 200 1192 kubernetes.client.rest: response body: {"kind":"ClusterRoleBindingList","apiVersion":"rbac.authorization.k8s.io/v1","metadata":{"resourceVersion":"12205"},"items":[{"metadata":{"name":"AzureArc-Microsoft.ExtendedLocation-RP-RoleBinding","uid":"285c37a2-542a-477a-847b-7637d35f7cbc","resourceVersion":"905","creationTimestamp":"2024-05-17T14:32:16Z","labels":{"app.kubernetes.io/managed-by":"Helm"},"annotations":{"connectedclusters.arc.azure.com/skip-authz-check":"true","meta.helm.sh/release-name":"azure-arc","meta.helm.sh/release-namespace":"azure-arc-release"},"managedFields":[{"manager":"helm","operation":"Update","apiVersion":"rbac.authorization.k8s.io/v1","time":"2024-05-17T14:32:16Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:annotations":{".":{},"f:connectedclusters.arc.azure.com/skip-authz-check":{},"f:meta.helm.sh/release-name":{},"f:meta.helm.sh/release-namespace":{}},"f:labels":{".":{},"f:app.kubernetes.io/managed-by":{}}},"f:roleRef":{},"f:subjects":{}}}]},"subjects":[{"kind":"User","apiGroup":"rbac.authorization.k8s.io","name":"7e1392f4-dae5-409b-a417-a88ee2c25003"}],"roleRef":{"apiGroup":"rbac.authorization.k8s.io","kind":"ClusterRole","name":"AzureArc-Microsoft.ExtendedLocation-RP-Role"}}]}

cli.azure.cli.core.util: No subscription ID specified in the URL https://management.azure.com/providers/Microsoft.ResourceGraph/resources?api-version=2022-10-01 cli.azure.cli.core.util: Retrieving token for resource https://management.core.windows.net/ cli.azure.cli.core.auth.persistence: build_persistence: location='/home/codespace/.azure/msal_token_cache.json', encrypt=False cli.azure.cli.core.auth.binary_cache: load: /home/codespace/.azure/msal_http_cache.bin msal.authority: Initializing with Entra authority: https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1 msal.authority: openid_config("https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/v2.0/.well-known/openid-configuration") = {'token_endpoint': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/discovery/v2.0/keys', 'response_modes_supported': ['query', 'fragment', 'form_post'], 'subject_types_supported': ['pairwise'], 'id_token_signing_alg_values_supported': ['RS256'], 'response_types_supported': ['code', 'id_token', 'code id_token', 'id_token token'], 'scopes_supported': ['openid', 'profile', 'email', 'offline_access'], 'issuer': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/oauth2/v2.0/logout', 'claims_supported': ['sub', 'iss', 'cloud_instance_name', 'cloud_instance_host_name', 'cloud_graph_host_name', 'msgraph_host', 'aud', 'exp', 'iat', 'auth_time', 'acr', 'nonce', 'preferred_username', 'name', 'tid', 'ver', 'at_hash', 'c_hash', 'email'], 'kerberos_endpoint': 'https://login.microsoftonline.com/20544857-edc6-43b7-9cb7-1aef604d6ac1/kerberos', 'tenant_region_scope': 'NA', 'cloud_instance_name': 'microsoftonline.com', 'cloud_graph_host_name': 'graph.windows.net', 'msgraph_host': 'graph.microsoft.com', 'rbac_url': 'https://pas.windows.net'} msal.application: Broker enabled? None

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers

⠏ Work. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Elapsed: 0:00:06
urllib3.connectionpool: https://management.azure.com:443 "POST /providers/Microsoft.ResourceGraph/resources?api-version=2022-10-01 HTTP/1.1" 200 76

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers
✔ Enumerate pre-flight checks

⠧ Work. ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Elapsed: 0:00:08

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers
✔ Enumerate pre-flight checks

Azure IoT Operations init
Workflow Id: ff5ab7c377be4f5a8c30420d1448ef32

-> Pre-Flight
✔ Ensure registered IoT Ops resource providers
✔ Enumerate pre-flight checks

⠏ DONE! ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ Elapsed: 0:00:38

cli.azure.cli.core.azclierror: Traceback (most recent call last): File "/opt/az/lib/python3.11/site-packages/knack/cli.py", line 233, in invoke cmd_result = self.invocation.execute(args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 664, in execute raise ex File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 731, in _run_jobs_serially results.append(self._run_job(expanded_arg, cmd_copy)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 701, in _run_job result = cmd_copy(params) ^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/init.py", line 334, in call return self.handler(*args, kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/az/lib/python3.11/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler return op(command_args) ^^^^^^^^^^^^^^^^^^ File "/home/codespace/.azure/cliextensions/azure-iot-ops/azext_edge/edge/commands_edge.py", line 204, in init return deploy( ^^^^^^^ File "/home/codespace/.azure/cliextensions/azure-iot-ops/azext_edge/edge/providers/orchestration/work.py", line 670, in deploy return manager.do_work() ^^^^^^^^^^^^^^^^^ File "/home/codespace/.azure/cliextensions/azure-iot-ops/azext_edge/edge/providers/orchestration/work.py", line 292, in do_work raise AzureResponseError(dumps(pre_flight_result, indent=2)) azure.cli.core.azclierror.AzureResponseError: { "status": "Failed", "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'aziotops.init.ff5ab7c377be4f5a8c30420d1448ef32' is not valid according to the validation procedure. The tracking id is '8e3945c2-7fb0-457a-a33e-d03b42e63336'. See inner errors for details.", "details": [ { "code": "OpenAPISpecValidationFailedForTemplateDeploymentResources", "message": "One or more resources in template deployment preflight validation request failed during OpenApi spec (swagger) validation. Please check error details for the resource identifiers.", "details": [ { "code": "HttpRequestPayloadAPISpecValidationFailed", "message": "HTTP request payload failed validation against API specification with one or more errors. Please see details for more information.", "target": "/subscriptions/*****/resourceGroups/IoTOps_QS/providers/Microsoft.IoTOperationsDataProcessor/instances/potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor", "details": [ { "code": "Pattern", "message": "String does not match pattern ^[a-z0-9][a-z0-9-]{1,60}[a-z0-9]$: potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor. Paths in payload: '.path.instanceName'" } ] } ] } ] } }

cli.azure.cli.core.azclierror: { "status": "Failed", "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'aziotops.init.ff5ab7c377be4f5a8c30420d1448ef32' is not valid according to the validation procedure. The tracking id is '8e3945c2-7fb0-457a-a33e-d03b42e63336'. See inner errors for details.", "details": [ { "code": "OpenAPISpecValidationFailedForTemplateDeploymentResources", "message": "One or more resources in template deployment preflight validation request failed during OpenApi spec (swagger) validation. Please check error details for the resource identifiers.", "details": [ { "code": "HttpRequestPayloadAPISpecValidationFailed", "message": "HTTP request payload failed validation against API specification with one or more errors. Please see details for more information.", "target": "/subscriptions/f658c78b-3636-4a63-8ed4-0d864d3203f7/resourceGroups/IoTOps_QS/providers/Microsoft.IoTOperationsDataProcessor/instances/potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor", "details": [ { "code": "Pattern", "message": "String does not match pattern ^[a-z0-9][a-z0-9-]{1,60}[a-z0-9]$: potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor. Paths in payload: '.path.instanceName'" } ] } ] } ] } } az_command_data_logger: { "status": "Failed", "error": { "code": "InvalidTemplateDeployment", "message": "The template deployment 'aziotops.init.ff5ab7c377be4f5a8c30420d1448ef32' is not valid according to the validation procedure. The tracking id is '8e3945c2-7fb0-457a-a33e-d03b42e63336'. See inner errors for details.", "details": [ { "code": "OpenAPISpecValidationFailedForTemplateDeploymentResources", "message": "One or more resources in template deployment preflight validation request failed during OpenApi spec (swagger) validation. Please check error details for the resource identifiers.", "details": [ { "code": "HttpRequestPayloadAPISpecValidationFailed", "message": "HTTP request payload failed validation against API specification with one or more errors. Please see details for more information.", "target": "/subscriptions/*****/resourceGroups/IoTOps_QS/providers/Microsoft.IoTOperationsDataProcessor/instances/potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor", "details": [ { "code": "Pattern", "message": "String does not match pattern ^[a-z0-9][a-z0-9-]{1,60}[a-z0-9]$: potential-space-rotary-phone-97xv76v9qr5fg45-ops-init-processor. Paths in payload: '.path.instanceName'" } ] } ] } ] } } cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f211cc18d60>] az_command_data_logger: exit code: 1 cli.main: Command ran in 41.043 seconds (init: 0.176, invoke: 40.867) telemetry.main: Begin splitting cli events and extra events, total events: 1 telemetry.client: Accumulated 0 events. Flush the clients. telemetry.main: Finish splitting cli events and extra events, cli events: 1 telemetry.save: Save telemetry record of length 5285 in cache telemetry.main: Begin creating telemetry upload process. telemetry.process: Creating upload process: "/opt/az/bin/python3 /opt/az/lib/python3.11/site-packages/azure/cli/telemetry/init.py /home/codespace/.azure" telemetry.process: Return from creating process telemetry.main: Finish creating telemetry upload process.

Expected behavior

IoT Operations is deployed.

Environment Summary

{ "azure-cli": "2.60.0", "azure-cli-core": "2.60.0", "azure-cli-telemetry": "1.1.0", "extensions": { "azure-iot-ops": "0.5.0b1", "connectedk8s": "1.7.2", "k8s-extension": "1.6.1" } }

Additional context

No response

yonzhan commented 2 weeks ago

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

microsoft-github-policy-service[bot] commented 2 weeks ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @Azure/azure-iot-cli-triage.

microsoft-github-policy-service[bot] commented 2 weeks ago

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @RandalliLama, @schaabs, @jlichwa.

digimaun commented 2 weeks ago

Hi @JzNotJz, it looks like your instance name is too long by 1 character. You can use --dp-instance to provide a shorter custom name to the data processor instance. For future reference init documentation is here https://learn.microsoft.com/en-us/cli/azure/iot/ops?view=azure-cli-latest#az-iot-ops-init (which is same content as when appending --help/-h to the command).

JzNotJz commented 2 weeks ago

Hi @digimaun thanks for prompt response. I followed the QuickStarts of IoT Operations Preview. Would you please confirm that if it would cause other problem if I hardcoded the instance name for a shorter one? I would prefer someone to update the Codespaces so that others would not run into the same problem in the future. Please advise. Thanks.

digimaun commented 1 week ago

There should be no issue using a different, shorter, instance name. The default instance name is a convention rather than a rule. Acknowledged on updating the Codespaces docs.