Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add documentation for the PowerBIDatasetRefresh Operator. #42754

Merged
merged 12 commits into from
Oct 24, 2024
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.



.. _howto/connection:powerbi:

Microsoft Power BI Connection
=============================

The Microsoft Power BI connection type enables the Power BI Integrations.

The :class:`~airflow.providers.microsoft.azure.hooks.powerbi.PowerBIHook` and :class:`~airflow.providers.microsoft.azure.operators.powerbi.PowerBIDatasetOperator` requires a connection of type ``powerbi`` to authenticate with the Power BI.

Authenticating to Power BI
-------------------------------

1. Use `token credentials
<https://docs.microsoft.com/en-us/azure/developer/python/azure-sdk-authenticate?tabs=cmd#authenticate-with-token-credentials>`_
i.e. add specific credentials (client_id, client_secret, tenant_id) to the Airflow connection.

Default Connection IDs
----------------------

All hooks and operators related to Microsoft Power BI use ``powerbi_default`` by default.

Configuring the Connection
--------------------------

Client ID
Specify the ``client_id`` used for the initial connection.
This is needed for *token credentials* authentication mechanism.


Client Secret
Specify the ``client_secret`` used for the initial connection.
This is needed for *token credentials* authentication mechanism.


Tenant ID
Specify the ``tenant_id`` used for the initial connection.
This is needed for *token credentials* authentication mechanism.

.. spelling:word-list::

Entra
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at

.. http://www.apache.org/licenses/LICENSE-2.0

.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.


Microsoft Power BI Operators
=============================
`Microsoft Power BI <https://powerbi.microsoft.com/>`__, is a unified, scalable platform for self-service and enterprise business intelligence(BI).


Prerequisite Tasks
^^^^^^^^^^^^^^^^^^

.. include:: /operators/_partials/prerequisite_tasks.rst

.. _howto/operator:PowerBIDatasetRefreshOperator:

PowerBIDatasetRefreshOperator
----------------------------------

To trigger a refresh for the specified dataset from the specified workspace, use the :class:`~airflow.providers.microsoft.azure.operators.powerbi.PowerBIDatasetRefreshOperator`.


.. exampleinclude:: /../../providers/tests/system/microsoft/azure/example_powerbi_dataset_refresh.py
:language: python
:dedent: 0
:start-after: [START howto_operator_powerbi_refresh_async]
:end-before: [END howto_operator_powerbi_refresh_async]

Reference
---------

For further information, look at:

* `Use the Microsoft Graph API <https://learn.microsoft.com/en-us/graph/use-the-api/>`__
* `Using the Power BI REST APIs <https://learn.microsoft.com/en-us/rest/api/power-bi/>`__
* `Using the Fabric REST APIs <https://learn.microsoft.com/en-us/rest/api/fabric/articles/using-fabric-apis/>`__
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ class PowerBIDatasetRefreshOperator(BaseOperator):
"""
Refreshes a Power BI dataset.

.. seealso::
For more information on how to use this operator, take a look at the guide:
:ref:`howto/operator:PowerBIDatasetRefreshOperator`

:param dataset_id: The dataset id.
:param group_id: The workspace id.
:param conn_id: Airflow Connection ID that contains the connection information for the Power BI account used for authentication.
Expand Down
2 changes: 2 additions & 0 deletions providers/src/airflow/providers/microsoft/azure/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ integrations:
tags: [azure]
- integration-name: Microsoft Power BI
external-doc-url: https://learn.microsoft.com/en-us/rest/api/power-bi/
how-to-guide:
- /docs/apache-airflow-providers-microsoft-azure/operators/powerbi.rst
tags: [azure]

operators:
Expand Down