@@ -33,6 +33,7 @@ usage() {
3333 echo " --help Show this help message and exit"
3434}
3535
36+
3637# -----------------------------------------------------------------------------
3738# Color Output Functions
3839#
@@ -59,7 +60,6 @@ usage() {
5960# Call the desired function with the text to print in color, e.g.:
6061# red "This is an error message"
6162# -----------------------------------------------------------------------------
62-
6363end=" \033[0m"
6464red=" \033[0;31m"
6565function red {
@@ -203,7 +203,6 @@ parse_input() {
203203# The command's output is stored in the variable 'AzOutput', and the exit code in 'AzRetVal'.
204204# Errors from the az command do not cause the script to exit; they are handled by the caller.
205205# ---------------------------------------------------------------------------
206-
207206az_wrapper () {
208207 if [ " $dry_run " = " true" ]; then
209208 echo " az $* "
@@ -293,6 +292,7 @@ rollback() {
293292}
294293
295294
295+
296296# rollback_delete_customer_app
297297# ----------------------------
298298# Deletes an Azure AD application with the specified name, including its role assignments.
@@ -316,8 +316,6 @@ rollback() {
316316# 0 if the application is not found or deleted successfully.
317317# Exits with error if multiple applications are found or if any operation fails.
318318# -------------------------------------------------------------------------------
319-
320-
321319rollback_delete_customer_app () {
322320 az_wrapper ad app list --filter " displayName eq '$app_name '" --query " [].appId" -o tsv
323321
@@ -351,6 +349,7 @@ rollback_delete_customer_app() {
351349}
352350
353351
352+
354353# Function to prompt user for confirmation
355354check_if_user_would_like_to_proceed () {
356355 local message=" $1 "
@@ -380,6 +379,7 @@ check_if_user_would_like_to_proceed() {
380379}
381380
382381
382+
383383# Function to delete multi-tenant service principal role assignments
384384rollback_delete_multi_tenant_sp_role_assignments (){
385385 if service_principal_doesnt_exists " $multi_tenant_app_id " ; then
@@ -403,7 +403,6 @@ rollback_delete_multi_tenant_sp_role_assignments(){
403403# - Deletes all role assignments by their IDs.
404404# - If deletion fails, prints a warning message with the error details.
405405# --------------------------------------------------------------------------
406-
407406rollback_delete_role_assignments (){
408407 local app_to_delete=$1
409408 local role_assignments
@@ -486,7 +485,6 @@ set_scope() {
486485# Returns:
487486# 0 if the user has sufficient permissions, otherwise exits with an error.
488487# ------------------------------------------------------------------------------
489-
490488validate_user_permissions () {
491489 local scope_type=" $1 "
492490
@@ -748,7 +746,6 @@ service_principal_doesnt_exists() {
748746# - Creates role assignments in Azure for the specified application and scope.
749747# - May create multiple role assignments depending on the onboarding mode.
750748# ------------------------------------------------------------------------------------
751-
752749create_role_assignments_for_cloudguard_app () {
753750 local app_id=$1
754751 if [ -z " $sp_id " ]; then
@@ -785,7 +782,6 @@ create_role_assignments_for_cloudguard_app() {
785782# - If the assignment does not exist, attempts to create it.
786783# - Exits with an error message if listing or creating the role assignment fails.
787784# ------------------------------------------------------------------------------------
788-
789785app_add_role_assignment_if_needed () {
790786 local app_id=$1
791787 local scope=$2
0 commit comments