def get_args():
    arg_parser = ArgParser(default_config_files=[
        './azureml_shutdown_idle_compute_instances.ini',
        './tmp/azureml_shutdown_idle_compute_instances.ini',
        '/config/*.ini',
    ])
    arg_parser.add(
        '-s',
        '--subscription-id',
        required=True,
        help='ID of the Azure subscription containing the Azure ML workspace')
    arg_parser.add('-g',
                   '--resource-group',
                   required=True,
                   help='Resource group containing the Azure ML workspace')
    arg_parser.add('-w',
                   '--workspace-name',
                   required=True,
                   help='Name of the Azure ML workspace')
    arg_parser.add(
        '-t',
        '--idle-threshold-sec',
        default=3600,
        type=int,
        help=
        'Idle period in seconds for a compute instance to be considered idle (default 3600)'
    )
    arg_parser.add(
        '--interval-sec',
        default=0,
        type=int,
        help=
        'Poll the status of compute instances every interval-sec seconds (default 0 = poll status once and exit)'
    )
    arg_parser.add('-a',
                   '--authentication',
                   default=AUTH_MI,
                   choices=[AUTH_CLI, AUTH_MI, AUTH_SP],
                   help='Authentication method')
    arg_parser.add(
        '--ip-address',
        default=IP_AUTO,
        choices=[IP_AUTO, IP_PRIVATE, IP_PUBLIC],
        help=
        'IP address to use for SSH connections (default auto = autodetect, private IP address first)'
    )
    arg_parser.add('--tenant-id',
                   help='Tenant ID for service principal authentication')
    arg_parser.add(
        '--service-principal-id',
        help='Service principal ID for service principal authentication')
    arg_parser.add(
        '--service-principal-password',
        help='Service principal secret for service principal authentication')
    arg_parser.add('-v',
                   '--verbosity',
                   default='INFO',
                   choices=[
                       'CRITICAL',
                       'ERROR',
                       'WARNING',
                       'INFO',
                       'DEBUG',
                   ],
                   help='Verbosity of script output')
    arg_parser.add('-c',
                   '--config',
                   is_config_file=True,
                   help='Configuration file')

    args = arg_parser.parse_args()

    if args.authentication == AUTH_SP and (
            not args.tenant_id or not args.service_principal_id
            or not args.service_principal_password):
        print(
            'Tenant ID, service principal ID and service principal password are required when using service-principal authentication.'
        )
        arg_parser.print_help()
        sys.exit(1)

    return args