azure-cli: It is not possible to create data connectors with az sentinel data-connector
Describe the bug
I am trying to create and enable data connectors in Azure Sentinel. The documentation doesn’t help much, but it should be a two step process:
az sentinel data-connector create
to create the data connector in Azure Sentinelaz sentinel data-connector connect
to enable
I am not able to go past the first step. In particular, the command below should work:
az sentinel data-connector create --data-connector-id AzureActiveDirectory
–resource-group my-rg \
–workspace-name my-workspace
–subscription my-subscription
But I am getting the following error:
The command failed with an unexpected error. Here is the traceback:
Model 'AAZObjectType' has no field named 'kind'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/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.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_command.py", line 149, in __call__
return self._handler(*args, **kwargs)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 31, in _handler
self._execute_operations()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1105, in _execute_operations
self.DataConnectorsCreateOrUpdate(ctx=self.ctx)()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1115, in __call__
request = self.make_request()
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_operation.py", line 318, in make_request
self.content, self.form_content, self.stream_content)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1209, in content
_builder.discriminate_by("kind", "APIPolling")
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_content_builder.py", line 159, in discriminate_by
schema.discriminate_by(prop_name, prop_value)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_field_type.py", line 243, in discriminate_by
raise AAZUnknownFieldError(self, key)
azure.cli.core.aaz.exceptions.AAZUnknownFieldError: Model 'AAZObjectType' has no field named 'kind'
I tried to add the --kind argument, but then I get the error unrecognized arguments: --kind StaticUI
.
Related command
az sentinel data-connector create
Errors
The command failed with an unexpected error. Here is the traceback:
Model 'AAZObjectType' has no field named 'kind'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/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.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_command.py", line 149, in __call__
return self._handler(*args, **kwargs)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 31, in _handler
self._execute_operations()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1105, in _execute_operations
self.DataConnectorsCreateOrUpdate(ctx=self.ctx)()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1115, in __call__
request = self.make_request()
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_operation.py", line 318, in make_request
self.content, self.form_content, self.stream_content)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1209, in content
_builder.discriminate_by("kind", "APIPolling")
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_content_builder.py", line 159, in discriminate_by
schema.discriminate_by(prop_name, prop_value)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_field_type.py", line 243, in discriminate_by
raise AAZUnknownFieldError(self, key)
azure.cli.core.aaz.exceptions.AAZUnknownFieldError: Model 'AAZObjectType' has no field named 'kind'
Issue script & Debug output
cli.knack.cli: Command arguments: ['sentinel', 'data-connector', 'create', '--data-connector-id', 'AzureActiveDirectory', '--resource-group', 'my-rg', '--workspace-name', 'my-workspace', '--subscription', 'my-subscription', '--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 0x104f6df30>, <function OutputProducer.on_global_arguments at 0x104ffaef0>, <function CLIQuery.on_global_arguments at 0x1050643a0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'sentinel': ['azext_sentinel']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: Total (0) 0.000 0 0
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: sentinel 0.060 17 21 /Users/me/.azure/cliextensions/sentinel
cli.azure.cli.core: Total (1) 0.060 17 21
cli.azure.cli.core: Loaded 17 groups, 21 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : sentinel data-connector create
cli.azure.cli.core: Command table: sentinel data-connector create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x105b0e9e0>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/Users/me/.azure/commands/2023-08-04.12-14-47.sentinel_data-connector_create.70650.log'.
az_command_data_logger: command args: sentinel data-connector create --data-connector-id {} --resource-group {} --workspace-name {} --subscription {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.<locals>.add_subscription_parameter at 0x105b23370>]
cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [<function register_ids_argument.<locals>.add_ids_arguments at 0x105c05090>, <function register_cache_arguments.<locals>.add_cache_arguments at 0x105c051b0>]
cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [<function OutputProducer.handle_output_argument at 0x104ffaf80>, <function CLIQuery.handle_query_parameter at 0x105064430>, <function register_ids_argument.<locals>.parse_ids_arguments at 0x105c05120>]
az_command_data_logger: extension name: sentinel
az_command_data_logger: extension version: 0.2.0
This command is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus
cli.azure.cli.core.auth.persistence: build_persistence: location='/Users/me/.azure/msal_token_cache.json', encrypt=False
cli.azure.cli.core.auth.binary_cache: load: /Users/me/.azure/msal_http_cache.bin
urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/50811143-5dac-46d6-92e0-3f954e222f9f/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/50811143-5dac-46d6-92e0-3f954e222f9f/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/50811143-5dac-46d6-92e0-3f954e222f9f/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/50811143-5dac-46d6-92e0-3f954e222f9f/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/50811143-5dac-46d6-92e0-3f954e222f9f/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/50811143-5dac-46d6-92e0-3f954e222f9f/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/50811143-5dac-46d6-92e0-3f954e222f9f/kerberos', 'tenant_region_scope': 'EU', '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? False
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/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.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_command.py", line 149, in __call__
return self._handler(*args, **kwargs)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 31, in _handler
self._execute_operations()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1105, in _execute_operations
self.DataConnectorsCreateOrUpdate(ctx=self.ctx)()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1115, in __call__
request = self.make_request()
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_operation.py", line 318, in make_request
self.content, self.form_content, self.stream_content)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1209, in content
_builder.discriminate_by("kind", "APIPolling")
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_content_builder.py", line 159, in discriminate_by
schema.discriminate_by(prop_name, prop_value)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_field_type.py", line 243, in discriminate_by
raise AAZUnknownFieldError(self, key)
azure.cli.core.aaz.exceptions.AAZUnknownFieldError: Model 'AAZObjectType' has no field named 'kind'
cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: Model 'AAZObjectType' has no field named 'kind'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/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.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_command.py", line 149, in __call__
return self._handler(*args, **kwargs)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 31, in _handler
self._execute_operations()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1105, in _execute_operations
self.DataConnectorsCreateOrUpdate(ctx=self.ctx)()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1115, in __call__
request = self.make_request()
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_operation.py", line 318, in make_request
self.content, self.form_content, self.stream_content)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1209, in content
_builder.discriminate_by("kind", "APIPolling")
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_content_builder.py", line 159, in discriminate_by
schema.discriminate_by(prop_name, prop_value)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_field_type.py", line 243, in discriminate_by
raise AAZUnknownFieldError(self, key)
azure.cli.core.aaz.exceptions.AAZUnknownFieldError: Model 'AAZObjectType' has no field named 'kind'
az_command_data_logger: Model 'AAZObjectType' has no field named 'kind'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/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.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_command.py", line 149, in __call__
return self._handler(*args, **kwargs)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 31, in _handler
self._execute_operations()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1105, in _execute_operations
self.DataConnectorsCreateOrUpdate(ctx=self.ctx)()
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1115, in __call__
request = self.make_request()
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_operation.py", line 318, in make_request
self.content, self.form_content, self.stream_content)
File "/Users/me/.azure/cliextensions/sentinel/azext_sentinel/aaz/latest/sentinel/data_connector/_create.py", line 1209, in content
_builder.discriminate_by("kind", "APIPolling")
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_content_builder.py", line 159, in discriminate_by
schema.discriminate_by(prop_name, prop_value)
File "/opt/homebrew/Cellar/azure-cli/2.50.0/libexec/lib/python3.10/site-packages/azure/cli/core/aaz/_field_type.py", line 243, in discriminate_by
raise AAZUnknownFieldError(self, key)
azure.cli.core.aaz.exceptions.AAZUnknownFieldError: Model 'AAZObjectType' has no field named 'kind'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x105b0ec20>]
az_command_data_logger: exit code: 1
cli.__main__: Command ran in 0.154 seconds (init: 0.052, invoke: 0.102)
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 7558 in cache
telemetry.check: Negative: The /Users/me/.azure/telemetry.txt was modified at 2023-08-04 12:05:17.665744, which in less than 600.000000 s
Expected behavior
The command should have finished with a success code, and the data connector should have been created on Azure Sentinel
Environment Summary
{
"azure-cli": "2.50.0",
"azure-cli-core": "2.50.0",
"azure-cli-telemetry": "1.0.8",
"extensions": {
"account": "0.2.5",
"azure-devops": "0.26.0",
"resource-graph": "2.1.0",
"sentinel": "0.2.0"
}
}
Additional context
No response
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 19 (7 by maintainers)
Thank you for your info, I’ll contact service team for the root cause.
It comes from shorthand syntax, e.g.,
and
Ref: https://github.com/Azure/azure-cli/blob/dev/doc/shorthand_syntax.md