lib/sles4sap/qesap/azure.pm
NAME
qe-sap-deployment test lib for Azure
COPYRIGHT
Copyright 2025 SUSE LLC
SPDX-License-Identifier: FSFAP
AUTHORS
QE SAP <qe-sap@suse.de>
DESCRIPTION
Azure related functions for the qe-sap-deployment test lib
Methods
qesap_az_get_resource_group
Query and return the resource group used by the qe-sap-deployment
- SUBSTRING - optional substring to be used with additional grep at the end of the command
-
qesap_az_get_active_peerings
Get active peering for Azure jobs
- RG - Resource group in question
-
- VNET - vnet name of rg
-
qesap_az_clean_old_peerings
Delete leftover peering for Azure jobs that finished without cleaning up
- RG - Resource group in question
-
- VNET - vnet name of rg
-
qesap_az_setup_native_fencing_permissions
qesap_az_setup_native_fencing_permissions(vmname=>$vm_name,
resource_group=>$resource_group);
Sets up managed identity (MSI) by enabling system assigned identity and
role 'Virtual Machine Contributor'
- VM_NAME - VM name
-
- RESOURCE_GROUP - resource group resource belongs to
-
qesap_az_get_tenant_id
qesap_az_get_tenant_id( subscription_id => $subscription_id )
Returns tenant ID related to the specified subscription ID.
- SUBSCRIPTION_ID - valid azure subscription
-
qesap_az_create_sas_token
Generate a SAS URI token for a storage container of choice
Return the token string
- STORAGE - Storage account name used fur the --account-name argument in az commands
-
- CONTAINER - container name within the storage account
-
- KEYNAME - name of the access key within the storage account
-
- PERMISSION - access permissions. Syntax is what documented in 'az storage container generate-sas --help'. Some of them of interest: (a)dd (c)reate (d)elete (e)xecute (l)ist (m)ove (r)ead (w)rite. Default is 'r'
-
- LIFETIME - life time of the token in minutes, default is 10min
-
qesap_az_list_container_files
Returns a list of the files that exist inside a given path in a given container in Azure storage.
Generated command looks like this:
az storage blob list --account-name <account_name> --container-name <container_name> --sas-token "<my_token>" --prefix <path_inside_container> --query "[].{name:name}" --output tsv
- STORAGE - Storage account name used fur the --account-name argument in az commands
-
- CONTAINER - container name within the storage account
-
- TOKEN - name of the SAS token to access the account (needs to have l permission)
-
- PREFIX - the local path inside the container (to list file inside a folder named 'dir', this would be 'dir')
-
qesap_az_diagnostic_log
Call `az vm boot-diagnostics json` for each running VM in the resource group associated to this openQA job
Return a list of diagnostic file paths on the JumpHost