@distributed_trace_async
async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
    'Cancels a currently running template deployment.\n\n        You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n        deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n        deployment stops the currently running template deployment and leaves the resources partially\n        deployed.\n\n        :param deployment_name: The name of the deployment.\n        :type deployment_name: str\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: None, or the result of cls(response)\n        :rtype: None\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = kwargs.pop('api_version', '2019-08-01')
    request = build_deployments_cancel_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.cancel_at_tenant_scope.metadata['url'])
    request = _convert_request(request)
    request.url = self._client.format_url(request.url)
    pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
    response = pipeline_response.http_response
    if (response.status_code not in [204]):
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        raise HttpResponseError(response=response, error_format=ARMErrorFormat)
    if cls:
        return cls(pipeline_response, None, {})
Cancels a currently running template deployment.

You can cancel a deployment only if the provisioningState is Accepted or Running. After the
deployment is canceled, the provisioningState is set to Canceled. Canceling a template
deployment stops the currently running template deployment and leaves the resources partially
deployed.

:param deployment_name: The name of the deployment.
:type deployment_name: str
:keyword callable cls: A custom type or function that will be passed the direct response
:return: None, or the result of cls(response)
:rtype: None
:raises: ~azure.core.exceptions.HttpResponseError
@distributed_trace_async
async def cancel_at_tenant_scope(self, deployment_name: str, **kwargs: Any) -> None:
    'Cancels a currently running template deployment.\n\n        You can cancel a deployment only if the provisioningState is Accepted or Running. After the\n        deployment is canceled, the provisioningState is set to Canceled. Canceling a template\n        deployment stops the currently running template deployment and leaves the resources partially\n        deployed.\n\n        :param deployment_name: The name of the deployment.\n        :type deployment_name: str\n        :keyword callable cls: A custom type or function that will be passed the direct response\n        :return: None, or the result of cls(response)\n        :rtype: None\n        :raises: ~azure.core.exceptions.HttpResponseError\n        '
    cls = kwargs.pop('cls', None)
    error_map = {401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError}
    error_map.update(kwargs.pop('error_map', {}))
    api_version = kwargs.pop('api_version', '2019-08-01')
    request = build_deployments_cancel_at_tenant_scope_request(deployment_name=deployment_name, api_version=api_version, template_url=self.cancel_at_tenant_scope.metadata['url'])
    request = _convert_request(request)
    request.url = self._client.format_url(request.url)
    pipeline_response = (await self._client._pipeline.run(request, stream=False, **kwargs))
    response = pipeline_response.http_response
    if (response.status_code not in [204]):
        map_error(status_code=response.status_code, response=response, error_map=error_map)
        raise HttpResponseError(response=response, error_format=ARMErrorFormat)
    if cls:
        return cls(pipeline_response, None, {})