# Buggy code
def azure_connect_service(service, credentials, region_name=None):
    try:
        if service == "storageaccounts":
            return StorageManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "monitor":
            return MonitorManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "sqldatabase":
            return SqlManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "keyvault":
            return KeyVaultManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "appgateway":
            return NetworkManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "rediscache":
            return RedisManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "securitycenter":
            return SecurityCenter(
                credentials.credentials, credentials.subscription_id, ""
            )
        elif service == "loadbalancer":
            return NetworkManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        else:
            printException("Service %s not supported" % service)
            return None

    except Exception as e:
        printException(e)
        return None


# Traceback (NameError)
File '/report/inc-awsconfig/exceptions.js' already exists. Do you want to overwrite it (y/n)?
EOF when reading a lineCreating /report/report.html ...

File '/report/report.html' already exists. Do you want to overwrite it (y/n)? Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/AWSScout2/output/utils.py", line 22, in prompt_4_yes_no
choice = raw_input().lower()
NameError: name 'raw_input' is not defined

# Fixed code
def azure_connect_service(service, credentials, region_name=None):
    try:
        if service == "storageaccounts":
            return StorageManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "monitor":
            return MonitorManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "sqldatabase":
            return SqlManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "keyvault":
            return KeyVaultManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "appgateway":
            return NetworkManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "network":
            return NetworkManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "rediscache":
            return RedisManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "securitycenter":
            return SecurityCenter(
                credentials.credentials, credentials.subscription_id, ""
            )
        elif service == "appservice":
            return WebSiteManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        elif service == "loadbalancer":
            return NetworkManagementClient(
                credentials.credentials, credentials.subscription_id
            )
        else:
            printException("Service %s not supported" % service)
            return None

    except Exception as e:
        printException(e)
        return None