Bug in az kusto script create and unclear wording on summary.
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
We are using DevOps pipelines to automate script creation on our databases in Azure Data Explorer. We manage buildings, each building has its own database and needs the same functionality.
However, when we run the looping script below; not all scripts actually get updated. The strange thing is that we are not getting errors; the adx cluster does update some of the scripts so the code works. Building A can get updated script A while building B's script A does not. We have not found any pattern in this behavior, if we rerun building B could have been updated while A was not.
We tried removing the no-wait tag but that has no influence on the strange output. Is this known behavior?
### Related command
find "$buildingFunctionsDir" -type f -name "*.kql" | while read -r kql_file; do
echo "Adding function: $kql_file" | tee -a $output_file
# Read the content of the .kql file and remove the BOM (if present)
functionQuery=$(cat "$kql_file" | sed '1s/^\xEF\xBB\xBF//' )
GUID=$(uuidgen)
result=$(az kusto script create --debug --cluster-name $clusterName --database-name $db --force-update-tag $GUID --name $scriptName --resource-group $resourceGroupName --no-wait --script-content "$functionQuery" 2>&1)
echo $result | tee -a $output_file
done
### Errors
The command failed without errors.
### Issue script & Debug output
DEBUG: cli.knack.cli: Command arguments: ['kusto', 'script', 'create', '--debug', '--cluster-name', '****', '--database-name', '****', '--force-update-tag', '083736c3-56cf-478a-811e-9b37d8955c63', '--name', 'PipelineFunctions', '--resource-group', '****', '--no-wait', '--script-content', '...Kusto Script Content...'] DEBUG: cli.knack.cli: __init__ debug log: Cannot enable color. DEBUG: cli.knack.cli: Event: Cli.PreExecute [] DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [...] DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate [] DEBUG: cli.azure.cli.core: Modules found from index for 'kusto': ['azext_kusto'] DEBUG: cli.azure.cli.core: Loading command modules: DEBUG: cli.azure.cli.core: Name Load Time Groups Commands DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0 DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next'] DEBUG: cli.azure.cli.core: Loading extensions: DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory DEBUG: cli.azure.cli.core: kusto 0.008 16 78 /opt/az/azcliextensions/kusto DEBUG: cli.azure.cli.core: Total (1) 0.008 16 78 DEBUG: cli.azure.cli.core: Loaded 16 groups, 78 commands. DEBUG: cli.azure.cli.core: Found a match in the command table. DEBUG: cli.azure.cli.core: Raw command : kusto script create DEBUG: cli.azure.cli.core: Command table: kusto script create INFO: az_command_data_logger: command args: kusto script create --debug --cluster-name {} --database-name {} --force-update-tag {} --name {} --resource-group {} --no-wait --script-content {} DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [...] INFO: az_command_data_logger: extension name: kusto INFO: az_command_data_logger: extension version: 0.5.0 WARNING: Command group 'kusto' is experimental and under development. Reference and support levels: https://aka.ms/CLI_refstatus DEBUG: cli.azure.cli.core.commands.client_factory: Getting management service client client_type=KustoManagementClient DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/service_principal_entries.json', encrypt=False DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='/home/vsts/work/_temp/.azclitask/msal_token_cache.json', encrypt=False DEBUG: cli.azure.cli.core.auth.binary_cache: load: /home/vsts/work/_temp/.azclitask/msal_http_cache.bin DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None) DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/.../oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/.../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/.../v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/.../oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/.../oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/.../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/.../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'} DEBUG: msal.application: Broker enabled? False DEBUG: msal.application
### Expected behavior
Add updated script to all buildings equally and throw errors otherwise.
### Environment Summary
azure-cli 2.50.0
core 2.50.0
telemetry 1.0.8
Extensions:
azure-devops 0.26.0
Dependencies:
msal 1.22.0
azure-mgmt-resource 23.1.0b2
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.