Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions providers/microsoft/azure/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ PIP package Version required
``azure-mgmt-containerregistry`` ``>=8.0.0``
``azure-mgmt-compute`` ``>=33.0.0``
``azure-mgmt-containerinstance`` ``>=10.1.0``
``requests`` ``>=2.27.0``
``msgraph-core`` ``>=1.3.3``
``msgraphfs`` ``>=0.3.0``
``microsoft-kiota-http`` ``>=1.9.4,<2.0.0``
Expand Down
84 changes: 84 additions & 0 deletions providers/microsoft/azure/docs/connections/aas.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
.. 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:azure_analysis_services:

Microsoft Azure Analysis Services
==================================

The Microsoft Azure Analysis Services connection type enables the Azure Analysis Services integration.

Authenticating to Azure Analysis Services
------------------------------------------

There are two ways to connect to Azure Analysis Services using Airflow.

1. Use `client secret credentials <https://learn.microsoft.com/en-us/azure/analysis-services/analysis-services-addservprinc-admins>`_
i.e. add specific credentials (Client ID, Client Secret, Tenant ID) to the Airflow connection.
2. Use managed identity by setting ``managed_identity_client_id``, ``workload_identity_tenant_id`` (under the hook, it uses DefaultAzureCredential_ with these arguments)
or fall back on DefaultAzureCredential_.

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

All hooks and operators related to Microsoft Azure Analysis Services use ``azure_analysis_services_default`` by default.

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

Region Endpoint (host)
The region-specific endpoint for the Azure Analysis Services server,
e.g. ``eastus.asazure.windows.net``.

Client ID (login)
The ``client_id`` of the service principal used for authentication.
Required for *client secret* authentication. Can be left out to fall back on DefaultAzureCredential_.

Client Secret (password)
The ``client_secret`` of the service principal used for authentication.
Required for *client secret* authentication. Can be left out to fall back on DefaultAzureCredential_.

Tenant ID
The Azure tenant ID. Required when using client secret authentication.
Use extra param ``tenantId`` to pass in the tenant ID.

Managed Identity Client ID (optional)
The client ID of a user-assigned managed identity. If provided with ``workload_identity_tenant_id``,
they are passed to DefaultAzureCredential_.

Workload Identity Tenant ID (optional)
ID of the application's Microsoft Entra tenant. If provided with ``managed_identity_client_id``,
they are passed to DefaultAzureCredential_.

When specifying the connection in an environment variable, use URI syntax.
All components of the URI should be URL-encoded.

Examples
--------

.. code-block:: bash

export AIRFLOW_CONN_AZURE_ANALYSIS_SERVICES_DEFAULT='azure-analysis-services://clientid:clientsecret@eastus.asazure.windows.net?tenantId=tenant+id'


.. _DefaultAzureCredential: https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#defaultazurecredential

.. spelling:word-list::
Entra
asazure
1 change: 1 addition & 0 deletions providers/microsoft/azure/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ PIP package Version required
``azure-mgmt-containerregistry`` ``>=8.0.0``
``azure-mgmt-compute`` ``>=33.0.0``
``azure-mgmt-containerinstance`` ``>=10.1.0``
``requests`` ``>=2.27.0``
``msgraph-core`` ``>=1.3.3``
``msgraphfs`` ``>=0.3.0``
``microsoft-kiota-http`` ``>=1.9.4,<2.0.0``
Expand Down
89 changes: 89 additions & 0 deletions providers/microsoft/azure/docs/operators/analysis_services.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
.. 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.

Azure Analysis Services Operators
==================================
Azure Analysis Services is a fully managed platform as a service (PaaS) that provides
enterprise-grade data models in the cloud.

.. _howto/operator:AzureAnalysisServicesRefreshOperator:

AzureAnalysisServicesRefreshOperator
--------------------------------------
Use the :class:`~airflow.providers.microsoft.azure.operators.analysis_services.AzureAnalysisServicesRefreshOperator`
to trigger a model refresh on an Azure Analysis Services database.

By default, the operator waits for the refresh to complete before finishing.

The ``refresh_type`` parameter controls what processing is performed:

.. list-table::
:header-rows: 1

* - Value
- Description
* - ``full``
- Refreshes data and recalculates all dependencies (default)
* - ``clearValues``
- Clears calculated values without re-ingesting data
* - ``calculate``
- Recalculates all dependents without refreshing data
* - ``dataOnly``
- Refreshes data only, skips recalculation
* - ``automatic``
- Azure determines what needs refreshing based on metadata state
* - ``defragment``
- Defragments the database without changing data

.. exampleinclude:: /../tests/system/microsoft/azure/example_azure_analysis_services.py
:language: python
:dedent: 4
:start-after: [START howto_operator_azure_analysis_services_refresh]
:end-before: [END howto_operator_azure_analysis_services_refresh]

To run in deferrable mode and free up worker slots while polling on the Airflow Triggerer:

.. exampleinclude:: /../tests/system/microsoft/azure/example_azure_analysis_services.py
:language: python
:dedent: 4
:start-after: [START howto_operator_azure_analysis_services_refresh_deferrable]
:end-before: [END howto_operator_azure_analysis_services_refresh_deferrable]

.. _howto/operator:AzureAnalysisServicesSensor:

AzureAnalysisServicesSensor
-----------------------------
Use the :class:`~airflow.providers.microsoft.azure.sensors.analysis_services.AzureAnalysisServicesSensor`
to poll an existing Azure Analysis Services model refresh until it reaches a terminal state.

This is useful when you trigger a refresh with ``wait_for_termination=False`` and want to monitor
its status from a separate downstream task. The ``refresh_id`` pushed to XCom by the operator can
be passed directly to the sensor.

For connection setup, see :ref:`howto/connection:azure_analysis_services`.

Reference
---------

For further information, please refer to the Microsoft documentation:

* `Azure Analysis Services Documentation <https://learn.microsoft.com/en-us/azure/analysis-services/>`__
* `Azure Analysis Services REST API <https://learn.microsoft.com/en-us/rest/api/analysisservices/>`__

.. spelling:word-list::
asazure
Defragments
33 changes: 33 additions & 0 deletions providers/microsoft/azure/provider.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ integrations:
how-to-guide:
- /docs/apache-airflow-providers-microsoft-azure/operators/powerbi.rst
tags: [azure]
- integration-name: Microsoft Azure Analysis Services
external-doc-url: https://learn.microsoft.com/en-us/azure/analysis-services/
how-to-guide:
- /docs/apache-airflow-providers-microsoft-azure/operators/analysis_services.rst
tags: [azure]

operators:
- integration-name: Microsoft Azure Compute
Expand Down Expand Up @@ -236,6 +241,9 @@ operators:
- integration-name: Microsoft Power BI
python-modules:
- airflow.providers.microsoft.azure.operators.powerbi
- integration-name: Microsoft Azure Analysis Services
python-modules:
- airflow.providers.microsoft.azure.operators.analysis_services

sensors:
- integration-name: Microsoft Azure Compute
Expand All @@ -253,6 +261,9 @@ sensors:
- integration-name: Microsoft Graph API
python-modules:
- airflow.providers.microsoft.azure.sensors.msgraph
- integration-name: Microsoft Azure Analysis Services
python-modules:
- airflow.providers.microsoft.azure.sensors.analysis_services

filesystems:
- airflow.providers.microsoft.azure.fs.adls
Expand Down Expand Up @@ -306,6 +317,9 @@ hooks:
- integration-name: Microsoft Power BI
python-modules:
- airflow.providers.microsoft.azure.hooks.powerbi
- integration-name: Microsoft Azure Analysis Services
python-modules:
- airflow.providers.microsoft.azure.hooks.analysis_services

triggers:
- integration-name: Microsoft Azure Compute
Expand All @@ -329,6 +343,9 @@ triggers:
- integration-name: Microsoft Azure Synapse
python-modules:
- airflow.providers.microsoft.azure.triggers.synapse
- integration-name: Microsoft Azure Analysis Services
python-modules:
- airflow.providers.microsoft.azure.triggers.analysis_services

queues:
- airflow.providers.microsoft.azure.queues.asb.AzureServiceBusMessageQueueProvider
Expand Down Expand Up @@ -910,6 +927,22 @@ connection-types:
label: Tenant ID
schema:
type: ["string", "null"]
- hook-class-name: airflow.providers.microsoft.azure.hooks.analysis_services.AzureAnalysisServicesHook
hook-name: "Azure Analysis Services"
connection-type: azure_analysis_services
ui-field-behaviour:
hidden-fields: ["schema", "port", "extra"]
relabeling:
host: Region Endpoint
login: Client ID
password: Client Secret
placeholders:
host: eastus.asazure.windows.net
conn-fields:
tenantId:
label: Tenant ID
schema:
type: ["string", "null"]

secrets-backends:
- airflow.providers.microsoft.azure.secrets.key_vault.AzureKeyVaultBackend
Expand Down
1 change: 1 addition & 0 deletions providers/microsoft/azure/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ dependencies = [
"azure-mgmt-containerregistry>=8.0.0",
"azure-mgmt-compute>=33.0.0",
"azure-mgmt-containerinstance>=10.1.0",
"requests>=2.27.0",
"msgraph-core>=1.3.3",
"msgraphfs>=0.3.0",
"microsoft-kiota-http>=1.9.4,<2.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,14 @@ def get_provider_info():
"how-to-guide": ["/docs/apache-airflow-providers-microsoft-azure/operators/powerbi.rst"],
"tags": ["azure"],
},
{
"integration-name": "Microsoft Azure Analysis Services",
"external-doc-url": "https://learn.microsoft.com/en-us/azure/analysis-services/",
"how-to-guide": [
"/docs/apache-airflow-providers-microsoft-azure/operators/analysis_services.rst"
],
"tags": ["azure"],
},
],
"operators": [
{
Expand Down Expand Up @@ -190,6 +198,10 @@ def get_provider_info():
"integration-name": "Microsoft Power BI",
"python-modules": ["airflow.providers.microsoft.azure.operators.powerbi"],
},
{
"integration-name": "Microsoft Azure Analysis Services",
"python-modules": ["airflow.providers.microsoft.azure.operators.analysis_services"],
},
],
"sensors": [
{
Expand All @@ -212,6 +224,10 @@ def get_provider_info():
"integration-name": "Microsoft Graph API",
"python-modules": ["airflow.providers.microsoft.azure.sensors.msgraph"],
},
{
"integration-name": "Microsoft Azure Analysis Services",
"python-modules": ["airflow.providers.microsoft.azure.sensors.analysis_services"],
},
],
"filesystems": [
"airflow.providers.microsoft.azure.fs.adls",
Expand Down Expand Up @@ -282,6 +298,10 @@ def get_provider_info():
"integration-name": "Microsoft Power BI",
"python-modules": ["airflow.providers.microsoft.azure.hooks.powerbi"],
},
{
"integration-name": "Microsoft Azure Analysis Services",
"python-modules": ["airflow.providers.microsoft.azure.hooks.analysis_services"],
},
],
"triggers": [
{
Expand Down Expand Up @@ -312,6 +332,10 @@ def get_provider_info():
"integration-name": "Microsoft Azure Synapse",
"python-modules": ["airflow.providers.microsoft.azure.triggers.synapse"],
},
{
"integration-name": "Microsoft Azure Analysis Services",
"python-modules": ["airflow.providers.microsoft.azure.triggers.analysis_services"],
},
],
"queues": ["airflow.providers.microsoft.azure.queues.asb.AzureServiceBusMessageQueueProvider"],
"transfers": [
Expand Down Expand Up @@ -880,6 +904,21 @@ def get_provider_info():
},
"conn-fields": {"tenant_id": {"label": "Tenant ID", "schema": {"type": ["string", "null"]}}},
},
{
"hook-class-name": "airflow.providers.microsoft.azure.hooks.analysis_services.AzureAnalysisServicesHook",
"hook-name": "Azure Analysis Services",
"connection-type": "azure_analysis_services",
"ui-field-behaviour": {
"hidden-fields": ["schema", "port", "extra"],
"relabeling": {
"host": "Region Endpoint",
"login": "Client ID",
"password": "Client Secret",
},
"placeholders": {"host": "eastus.asazure.windows.net"},
},
"conn-fields": {"tenantId": {"label": "Tenant ID", "schema": {"type": ["string", "null"]}}},
},
],
"secrets-backends": ["airflow.providers.microsoft.azure.secrets.key_vault.AzureKeyVaultBackend"],
"logging": ["airflow.providers.microsoft.azure.log.wasb_task_handler.WasbTaskHandler"],
Expand Down
Loading
Loading