diff --git a/src/application-insights/azext_applicationinsights/custom.py b/src/application-insights/azext_applicationinsights/custom.py index 851451989a3..c641662f401 100644 --- a/src/application-insights/azext_applicationinsights/custom.py +++ b/src/application-insights/azext_applicationinsights/custom.py @@ -93,6 +93,6 @@ def show_api_key(client, application, resource_group_name, api_key=None): def delete_api_key(client, application, resource_group_name, api_key): existing_key = list(filter(lambda result: result.name == api_key, client.list(resource_group_name, application))) - if not existing_key: + if existing_key != []: return client.delete(resource_group_name, application, existing_key[0].id.split('/')[-1]) raise CLIError('--api-key provided but key not found for deletion.') diff --git a/src/index.json b/src/index.json index 084639e5f58..8cc374466b2 100644 --- a/src/index.json +++ b/src/index.json @@ -398,7 +398,7 @@ "summary": "Support for managing Application Insights components and querying metrics, events, and logs from such components.", "version": "0.1.1" }, - "sha256Digest": "4dbcd75076683e09e12c1bb8e26057dbdd69da5c3300c735d0fc1a4cd049622b" + "sha256Digest": "487434c50589a18a0186d47b5f6638457190669e42888b2dd416fffd4bbcf621" } ], "azure-batch-cli-extensions": [