<jupyter_start><jupyter_text>Tear it all downOnce you are done with your cluster you can use the following two commands to destroy it all.<jupyter_code>from azureml.core import Workspace
from azureml.core.compute import AksCompute, ComputeTarget
from dotenv import set_key, get_key, find_dotenv
from testing_utilities import get_auth
ws = Workspace.from_config(auth=get_auth())
print(ws.name, ws.resource_group, ws.location, ws.subscription_id, sep="\n")
env_path = find_dotenv(raise_error_if_not_found=True)
resource_group = get_key(env_path, 'resource_group')
aks_name = get_key(env_path, 'aks_name')<jupyter_output><empty_output><jupyter_text>Once you are done with your cluster you can use the following command to delete the AKS cluster. This step may take a few minutes.<jupyter_code>aks_target = AksCompute(name=aks_name,workspace=ws)
aks_aml_name = aks_target.cluster_resource_id.rsplit("/")[-1]
!az aks delete -n $aks_aml_name -g $resource_group -y<jupyter_output><empty_output><jupyter_text>Finally, you should delete the resource group. This also deletes the AKS cluster and can be used instead of the above command if the resource group is only used for this purpose.<jupyter_code>!az group delete --name $resource_group -y<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08142292490118577, 'fraction_numerical': 0.0007905138339920949, 'mean_word_length': 7.167741935483871, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '112839', 'license': 'MIT', 'n_tokens_mistral': 413, 'n_tokens_neox': 409, 'n_words': 125, 'path': '{{cookiecutter.project_name}}/Keras_Tensorflow/aks/07_TearDown.ipynb', 'repo_name': 'Microsoft/AKSDeploymentTutorial_AML', 'size': '1265'}