def deployment_export_template(name, resource_group, **kwargs):
    '''
    .. versionadded:: 2019.2.0

    Exports the template used for the specified deployment.

    :param name: The name of the deployment to query.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_export_template testdeploy testgroup

    '''
    resconn = __utils__['azurearm.get_client']('resource', **kwargs)
    try:
        deploy = resconn.deployments.export_template(
            deployment_name=name,
            resource_group_name=resource_group
        )
        result = deploy.as_dict()
    except CloudError as exc:
        __utils__['azurearm.log_cloud_error']('resource', str(exc), **kwargs)
        result = {'error': str(exc)}

    return result