Integrations/AzureCompute_v2/AzureCompute_v2.py
def list_resource_groups_command():
    """
    List all Resource Groups belonging to your Azure subscription

    returns:
        Resource-Group Objects
    """
    response = list_resource_groups()
    # Retrieve relevant properties to return to context
    value = response.get('value')
    resource_groups = []
    for resource_group in value:
        resource_group_context = {
            'Name': resource_group.get('name'),
            'ID': resource_group.get('id'),
            'Location': resource_group.get('location'),
            'ProvisioningState': resource_group.get('properties', {}).get('provisioningState')
        }
        resource_groups.append(resource_group_context)

    title = 'List of Resource Groups'
    human_readable = tableToMarkdown(title, resource_groups, removeNull=True)
    entry_context = {'Azure.ResourceGroup(val.Name && val.Name === obj.Name)': resource_groups}
    demisto.results({
        'Type': entryTypes['note'],
        'Contents': response,
        'ContentsFormat': formats['text'],
        'ReadableContentsFormat': formats['markdown'],
        'HumanReadable': human_readable,
        'EntryContext': entry_context
    })

    List all Resource Groups belonging to your Azure subscription

    returns:
        Resource-Group Objects
    
List all Resource Groups belonging to your Azure subscription
returns:
Resource-Group Objects
List all Resource Groups belonging to your Azure subscription returns : Resource - Group Objects
def list_resource_groups_command():
    response = list_resource_groups()
    value = response.get('value')
    resource_groups = []
    for resource_group in value:
        resource_group_context = {
            'Name': resource_group.get('name'),
            'ID': resource_group.get('id'),
            'Location': resource_group.get('location'),
            'ProvisioningState': resource_group.get('properties', {}).get('provisioningState')
        }
        resource_groups.append(resource_group_context)
    title = 'List of Resource Groups'
    human_readable = tableToMarkdown(title, resource_groups, removeNull=True)
    entry_context = {'Azure.ResourceGroup(val.Name && val.Name === obj.Name)': resource_groups}
    demisto.results({
        'Type': entryTypes['note'],
        'Contents': response,
        'ContentsFormat': formats['text'],
        'ReadableContentsFormat': formats['markdown'],
        'HumanReadable': human_readable,
        'EntryContext': entry_context
    })
def list_resource_groups_command ( ) : response = list_resource_groups ( ) value = response . get ( 'value' ) resource_groups = [ ] for resource_group in value : resource_group_context = { 'Name' : resource_group . get ( 'name' ) , 'ID' : resource_group . get ( 'id' ) , 'Location' : resource_group . get ( 'location' ) , 'ProvisioningState' : resource_group . get ( 'properties' , { } ) . get ( 'provisioningState' ) } resource_groups . append ( resource_group_context ) title = 'List of Resource Groups' human_readable = tableToMarkdown ( title , resource_groups , removeNull = True ) entry_context = { 'Azure.ResourceGroup(val.Name && val.Name === obj.Name)' : resource_groups } demisto . results ( { 'Type' : entryTypes [ 'note' ] , 'Contents' : response , 'ContentsFormat' : formats [ 'text' ] , 'ReadableContentsFormat' : formats [ 'markdown' ] , 'HumanReadable' : human_readable , 'EntryContext' : entry_context } )
List all Resource Groups belonging to your Azure subscription
returns:
Resource-Group Objects
List all Resource Groups belonging to your Azure subscription returns : Resource - Group Objects
"""
    List all Resource Groups belonging to your Azure subscription

    returns:
        Resource-Group Objects
    """ # Retrieve relevant properties to return to context