util#
Miscellaneous utilities for interacting with Azure.
Functions#
|
Look up an Azure service principal from its display name. |
|
Ensure that an object either behaves like a |
Module Contents#
- lookup_service_principal(display_name: str) list#
Look up an Azure service principal from its display name.
Requires the Azure CLI.
Parameters#
- display_name
The display name of the service principal to look up.
Returns#
- list
The results, if any, or an empty list if no match was found.
- ensure_listlike(x: any) collections.abc.MutableSequence#
Ensure that an object either behaves like a
MutableSequenceand if not return a one-itemlistcontaining the object.Useful for handling list-of-strings inputs alongside single strings.
Based on this StackOverflow approach.
Parameters#
- x
The item to ensure is
list-like.
Returns#
- MutableSequence
xifxis aMutableSequenceotherwise[x](i.e. a one-item list containingx).