`az synapse pipeline delete` does not delete pipelines in nested folders
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
### Describe the bug
```sh
az synapse pipeline delete
```
does not delete pipelines in nested folders.
Some pipelines are deleted, while some are not. The issue may be to be connected to `--yes` flag, where the response code is `202` in stead of `204` from the [api](https://learn.microsoft.com/en-us/rest/api/synapse/data-plane/pipeline/delete-pipeline?tabs=HTTP)
A folder structure example setup inside Synapse workspace:
```sh
Pipelines:
- Folder1
./pipeline1.json
./pipeline2.json
- NestedFolder1
./nestedPipeline1.json
- Folder2
- NestedFolder2
./nestedPipeline2.json
```
The expected result is that the pipelines are deleted, the command returns successful.
Have tried `--no-wait` and `--yes`, but the issue is not resolved.
### Related command
az synapse pipeline delete --yes --no-wait --name "nestedPipeline1.json" --workspace-name $WORKSPACE
### Errors
No error message.
### Issue script & Debug output
> az synapse pipeline delete --yes --no-wait --name "nestedPipeline1.json" --workspace-name $WORKSPACE
2023-08-22T12:07:37.0889073Z Deleting nestedPipeline1
2023-08-22T12:07:37.5296019Z DEBUG: cli.knack.cli: Command arguments: ['synapse', 'pipeline', 'delete', '--yes', '--no-wait', '--name', 'nestedPipeline1', '--workspace-name', 'workspace', '--debug']
2023-08-22T12:07:37.5296830Z DEBUG: cli.knack.cli: __init__ debug log:
2023-08-22T12:07:37.5297303Z Cannot enable color.
2023-08-22T12:07:37.5297710Z DEBUG: cli.knack.cli: Event: Cli.PreExecute []
2023-08-22T12:07:37.5298289Z DEBUG: cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [, , ]
2023-08-22T12:07:37.5318711Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
2023-08-22T12:07:37.5328617Z DEBUG: cli.azure.cli.core: Modules found from index for 'synapse': ['azure.cli.command_modules.synapse']
2023-08-22T12:07:37.5329202Z DEBUG: cli.azure.cli.core: Loading command modules:
2023-08-22T12:07:37.5329541Z DEBUG: cli.azure.cli.core: Name Load Time Groups Commands
2023-08-22T12:07:37.5498519Z DEBUG: cli.azure.cli.core: synapse 0.017 54 246
2023-08-22T12:07:37.5498978Z DEBUG: cli.azure.cli.core: Total (1) 0.017 54 246
2023-08-22T12:07:37.5508874Z DEBUG: cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_ai_examples', 'azext_next']
2023-08-22T12:07:37.5509482Z DEBUG: cli.azure.cli.core: Loading extensions:
2023-08-22T12:07:37.5509810Z DEBUG: cli.azure.cli.core: Name Load Time Groups Commands Directory
2023-08-22T12:07:37.5510173Z DEBUG: cli.azure.cli.core: Total (0) 0.000 0 0
2023-08-22T12:07:37.5510508Z DEBUG: cli.azure.cli.core: Loaded 54 groups, 246 commands.
2023-08-22T12:07:37.5511666Z DEBUG: cli.azure.cli.core: Found a match in the command table.
2023-08-22T12:07:37.5512051Z DEBUG: cli.azure.cli.core: Raw command : synapse pipeline delete
2023-08-22T12:07:37.5512358Z DEBUG: cli.azure.cli.core: Command table: synapse pipeline delete
2023-08-22T12:07:37.5512870Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate []
2023-08-22T12:07:37.5513674Z DEBUG: cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'D:\a\_temp\.azclitask\commands\2023-08-22.12-07-37.synapse_pipeline_delete.4748.log'.
2023-08-22T12:07:37.5516387Z INFO: az_command_data_logger: command args: synapse pipeline delete --yes --no-wait --name {} --workspace-name {} --debug
2023-08-22T12:07:37.5518133Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [.add_subscription_parameter at 0x04300220>]
2023-08-22T12:07:37.9136291Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostArgumentLoad []
2023-08-22T12:07:37.9137224Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostCommandTableCreate [.add_ids_arguments at 0x0430C2F8>, .add_cache_arguments at 0x0430C388>]
2023-08-22T12:07:37.9149728Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnCommandTableLoaded []
2023-08-22T12:07:37.9150170Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPreParseArgs []
2023-08-22T12:07:37.9158209Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnPostParseArgs [, , .parse_ids_arguments at 0x0430C340>]
2023-08-22T12:07:37.9312955Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='D:\\a\\_temp\\.azclitask\\service_principal_entries.bin', encrypt=True
2023-08-22T12:07:37.9387716Z DEBUG: cli.azure.cli.core.auth.persistence: build_persistence: location='D:\\a\\_temp\\.azclitask\\msal_token_cache.bin', encrypt=True
2023-08-22T12:07:37.9395961Z DEBUG: cli.azure.cli.core.auth.binary_cache: load: D:\a\_temp\.azclitask\msal_http_cache.bin
2023-08-22T12:07:37.9401731Z DEBUG: urllib3.util.retry: Converted retries value: 1 -> Retry(total=1, connect=None, read=None, redirect=None, status=None)
2023-08-22T12:07:37.9409495Z DEBUG: msal.authority: openid_config = {'token_endpoint': 'https://login.microsoftonline.com/tenant/oauth2/v2.0/token', 'token_endpoint_auth_methods_supported': ['client_secret_post', 'private_key_jwt', 'client_secret_basic'], 'jwks_uri': 'https://login.microsoftonline.com/tenant/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/tenant/v2.0', 'request_uri_parameter_supported': False, 'userinfo_endpoint': 'https://graph.microsoft.com/oidc/userinfo', 'authorization_endpoint': 'https://login.microsoftonline.com/tenant/oauth2/v2.0/authorize', 'device_authorization_endpoint': 'https://login.microsoftonline.com/tenant/oauth2/v2.0/devicecode', 'http_logout_supported': True, 'frontchannel_logout_supported': True, 'end_session_endpoint': 'https://login.microsoftonline.com/tenant/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/tenant/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'}
2023-08-22T12:07:37.9411624Z DEBUG: msal.application: Broker enabled? False
2023-08-22T12:07:37.9412014Z DEBUG: msal.application: Region to be used: None
2023-08-22T12:07:37.9559153Z DEBUG: cli.azure.cli.core.auth.credential_adaptor: CredentialAdaptor.get_token: scopes=('https://dev.azuresynapse.net/.default',), kwargs={}
2023-08-22T12:07:37.9560053Z DEBUG: cli.azure.cli.core.auth.msal_authentication: ServicePrincipalCredential.get_token: scopes=('https://dev.azuresynapse.net/.default',), kwargs={}
2023-08-22T12:07:37.9568573Z DEBUG: msal.application: Cache hit an AT
2023-08-22T12:07:37.9569289Z DEBUG: msal.telemetry: Generate or reuse correlation_id: 489911d8-d8f3-4135-8b6a-defcef161104
2023-08-22T12:07:37.9596218Z DEBUG: urllib3.connectionpool: Starting new HTTPS connection (1): workspace.dev.azuresynapse.net:443
2023-08-22T12:07:38.1802974Z DEBUG: urllib3.connectionpool: https://workspace.dev.azuresynapse.net:443 "DELETE /pipelines/nestedPipeline1?api-version=2020-12-01 HTTP/1.1" 202 391
2023-08-22T12:07:38.1827921Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnTransformResult [, ]
2023-08-22T12:07:38.1829939Z DEBUG: cli.knack.cli: Event: CommandInvoker.OnFilterResult []
2023-08-22T12:07:38.1831277Z DEBUG: cli.knack.cli: Event: Cli.SuccessfulExecute []
2023-08-22T12:07:38.1831794Z DEBUG: cli.knack.cli: Event: Cli.PostExecute []
2023-08-22T12:07:38.1832285Z INFO: az_command_data_logger: exit code: 0
2023-08-22T12:07:38.1832692Z INFO: cli.__main__: Command ran in 1.029 seconds (init: 0.374, invoke: 0.654)
2023-08-22T12:07:38.2230779Z INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1
2023-08-22T12:07:38.2231631Z INFO: telemetry.client: Accumulated 0 events. Flush the clients.
2023-08-22T12:07:38.2232129Z INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1
2023-08-22T12:07:38.2236948Z INFO: telemetry.save: Save telemetry record of length 3368 in cache
2023-08-22T12:07:38.2239489Z INFO: telemetry.main: Begin creating telemetry upload process.
2023-08-22T12:07:38.2242677Z INFO: telemetry.process: Creating upload process: "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\Lib\site-packages\azure\cli\telemetry\__init__.pyc D:\a\_temp\.azclitask"
2023-08-22T12:07:38.2298178Z INFO: telemetry.process: Return from creating process
2023-08-22T12:07:38.2353419Z INFO: telemetry.main: Finish creating telemetry upload process.
### Expected behavior
The deleted pipeline is not visible in the Synapse workspace after command is run successfully.
`az synapase pipeline list --workspace-name $WORKSPACE` does not include the previous
### Environment Summary
C:\Windows\system32\cmd.exe /D /S /C ""C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd" --version"
azure-cli 2.51.0
core 2.51.0
telemetry 1.1.0
Extensions:
azure-devops 0.26.0
Dependencies:
msal 1.24.0b1
azure-mgmt-resource 23.1.0b2
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.