Delete Azure Resources
Summary
Delete Azure Resources may be used to delete the Microsoft Azure® resources instantiated by the Run Cases on Azure tool, including the Batch account job and pool, and the associated Storage account container.
To learn more about the Liquids HCA Tool in general, please see Liquids HCA Tool Frequently Asked Questions
To learn more about the structure of the Liquids HCA Tool project geodatabase, please see Liquids HCA Tool Data Dictionary.
Usage
Before running, you should make sure that you have downloaded any results you wish to retain using the Download Cases from Azure tool.
Delete Azure Resources uses the following tool parameters:
- Working Directory – This should be the same working directory that you specified in the Create GeoClaw Cases
- Delete Pool – This checkbox parameter allows you to specify whether to delete the landspill-azure-pool Azure pool used for GeoClaw processing in your Azure Batch account. When enabled, this parameter causes the pool to be deleted. This parameter is enabled by default. Note that a pool cannot be modified once it is instantiated; therefore, to make any changes to the pool, you must first delete it. The pool will automatically scale to zero nodes when not in use, and so does not consume Azure resources while not in use.
- Delete Job – This checkbox parameter allows you to specify whether to delete the landspill-azure-job Azure job from your Azure Batch account. When enabled, this parameter causes the job (and its tasks) to be deleted. This parameter is enabled by default. The job manages the GeoClaw cases submitted by Run Cases on Azure; each task in the job corresponds to a GeoClaw case. As each task completes, results are copied to the associated Storage account container; so, there is generally no reason to retain the job once processing is complete.
- Delete Storage Container – This checkbox parameter allows you to specify whether to delete the landspill-azure-container Azure Blob service container and the TABLElandspillazure Azure Table service table from your Azure Batch account’s associated Storage account. When enabled, this parameter causes both the container and the table to be deleted. This parameter is disabled by default. The container contains all of your GeoClaw results; you should not delete it until you have downloaded your results using Download Cases from Azure. Exercise caution because the container and table are not backed up on Azure and are unrecoverable once deleted.
- Azure Credential Method – You can either use the encrypted, passcode-protected Azure credential file that you created using the Create Encrypted Azure Credential File tool or you can manually input your Azure Batch and associated Storage account credentials. When you select “Encrypted file” for this parameter, the following required dependent parameters are exposed:
- Encrypted Credential File – This parameter is the path to your encrypted, passcode-protected credential file. By default, the tool looks for a credential file named bin in the scratch folder for the active ArcGIS Pro project.
- Encrypted Credential File Passcode – This parameter requires you to specify the passcode that you supplied when creating your encrypted Azure credential file. The encrypted Azure credential file can only be unencrypted for use when you supply this passcode. You should apply the same security measures for safeguarding this passcode that you apply to your Windows password.
The following required dependent parameters are exposed when you select “Manual input” for the Azure Credential Method parameter:
-
- Azure Batch Account Name – Your Azure Batch account name.
- Azure Batch Account Key – The primary or secondary access key for your Azure Batch account.
- Azure Batch Account URL – The URL for your Azure Batch account.
- Azure Storage Account Name – The name of the Azure Storage account associated with your Azure Batch account.
- Azure Storage Account Key – Key1 or Key2 for the Azure Storage account associated with your Azure Batch account.
In a typical Liquids HCA Tool workflow, Delete Azure Resources is run after Download Cases from Azure.
For visual reference on Liquids HCA Tool execution order, see Liquids HCA Tool Process Flow Diagrams.
Syntax
DeleteAzureResources_ (working_dir, delete_pool, delete_job, delete_container, cred_type, {cred_file}, {passcode}, {azure_batch_name}, {azure_batch_key}, {azure_batch_URL}, {azure_storage_name}, {azure_storage_key})
Parameter | Explanation | Data Type |
working_dir |
Dialog Reference Specify the working directory storing your release point case folders. There is no Python reference for this parameter. |
Workspace |
delete_pool |
Dialog Reference Check this checkbox to delete the Azure pool. There is no Python reference for this parameter. |
Boolean |
delete_job |
Dialog Reference Check this checkbox to delete the Azure job. There is no Python reference for this parameter. |
Boolean |
delete_container |
Dialog Reference Check this checkbox to delete the Azure storage container. There is no Python reference for this parameter. |
Boolean |
cred_type |
Dialog Reference Select the Azure authentication method. There is no Python reference for this parameter. |
String |
cred_file (Optional) |
Dialog Reference Select your encrypted, passcode-protected Azure credential file. There is no Python reference for this parameter. |
File |
Passcode (Optional) |
Dialog Reference Specify the passcode for your encrypted, passcode-protected Azure credential file. There is no Python reference for this parameter. |
String Hidden |
azure_batch_name (Optional) |
Dialog Reference Specify the name of your Azure Batch account. There is no Python reference for this parameter. |
String Hidden |
azure_batch_key (Optional) |
Dialog Reference Specify your Azure Batch account key. There is no Python reference for this parameter. |
String Hidden |
azure_batch_URL (Optional) |
Dialog Reference Specify your Azure Batch account URL. There is no Python reference for this parameter. |
String Hidden |
azure_storage_name (Optional) |
Dialog Reference Specify your Azure Storage account name. There is no Python reference for this parameter. |
String Hidden |
azure_storage_key (Optional) |
Dialog Reference Specify your Azure Storage account key. There is no Python reference for this parameter. |
String Hidden |
Code sample
The following script demonstrates how to use Delete Azure Resources with encrypted passcode-protected file:
import arcpy
arcpy.ImportToolbox(r”C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\liquidshca\esri\toolboxes\LiquidsHCA.pyt”)
in_dir = r”C:\data”
delete_pool = True
delete_job = True
delete_container = True
file_path = r”C:\data\azure_cred.bin”
passcode = XXXXXXX
cred_type = “Encrypted file”
batch_name = None
batch_key = None
batch_url = None
storage_name = None
storage_key = None
arcpy.liquidshca.DeleteAzureResources(in_dir, delete_pool, delete_job, container, cred_type, file_path, passcode, batch_name, batch_key, batch_url, storage_name, storage_key)
Environments
Licensing information
This tool requires a valid Liquids HCA Tool user license or subscription. Please see the Request License and Register License tool help topics for details on obtaining and registering a Gas HCA Tool software license.
Related topics
- Introduction to the Liquids HCA Tool
- Liquids HCA Tool Frequently Asked Questions
- Liquids HCA Tool Data Dictionary
- Create GeoClaw Cases
- Run Cases on Azure
- Download Cases from Azure
Tags
Liquids HCA, Release Point, GeoClaw, Microsoft Azure, Batch account, Storage account.
Credits
Copyright © 2003-2020 by G2 Integrated Solutions, LLC. All Rights Reserved.
geoclaw-azure-launcher:
Copyright © 2019-2020 Pi-Yueh Chuang, Lorena A. Barba, and G2 Integrated Solutions, LLC. All Rights Reserved.
Use limitations
There are no access and use limitations for this item.