From 4ce0cbd8c73dfafef6d44fc4a9cace0cd45439b0 Mon Sep 17 00:00:00 2001 From: Yarden Siboni Date: Sat, 12 Feb 2022 20:58:07 +0200 Subject: [PATCH 1/8] docs: Provide Azure Data Explorer Scaler (#1488) Signed-off-by: Yarden Siboni --- .../docs/2.7/scalers/azure-data-explorer.md | 214 ++++++++++++++++++ 1 file changed, 214 insertions(+) create mode 100644 content/docs/2.7/scalers/azure-data-explorer.md diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md new file mode 100644 index 000000000..3d6773aee --- /dev/null +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -0,0 +1,214 @@ ++++ +title = "Azure Data Explorer" +layout = "scaler" +availability = "v2.7+" +maintainer = "Community" +description = "Scale applications based on Azure Data Explorer query result." +go_file = "azure_data_explorer_scaler" ++++ + +### Trigger Specification + +This specification describes the `azure-data-explorer` trigger that scales based on an Azure Data Explorer query result. + +```yaml +triggers: +- type: azure-data-explorer + metadata: + podIdentity: "azure" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well + clientId: "AAD_APP_CLIENT_ID" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well + clientSecret: "AAD_APP_SECRET" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well + tenantId: "AAD_APP_TENANT_ID" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well + databaseName: "DATA_EXPLORER_DATABASE_NAME" + endpoint: "https://..kusto.windows.net" + query: | + StormEvents + | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | top 1 by StormCount desc + threshold: "1000" + metricName: "DATA_EXPLORER_METRIC_NAME" # Optional + # Alternatively, you can use existing environment variables to read aad app creds from: + clientIdFromEnv: AAD_APP_CLIENT_ID_ENV_VAR_NAME # Optional. You can use this instead of `clientId` parameter. + clientSecretFromEnv: AAD_APP_SECRET_ENV_VAR_NAME # Optional. You can use this instead of `clientSecret` parameter. + tenantIdFromEnv: AAD_APP_TENANT_ID_ENV_VAR_NAME # Optional. You can use this instead of `tenantId` parameter. +``` + +This scaler is backed by Azure Data Explorer Goland SDK. Please see [this](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/golang/kusto-golang-client-library) page +for further details. + +**Parameter list:** +Provide either podIdentity or aad app creds (clientId, clientSecret and tenantId). +- `clientId` - Id of the application from your Azure AD Application/service principal. Follow [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) link to create your service principal. +- `clientSecret` - Password from your Azure AD Application/service principal. +- `tenantId` - Id of the Azure Active Directory tenant. Follow [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) link to +retrieve your tenant id. +- `podIdentity` - [Azure Active Directory pod-managed identity](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity) can be used. Only "azure" is supported. +- `databaseName` - The name of the Data Explorer Database to query. Use the [Azure Command Line Interface](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) to run `az kusto database list` to see a list of available databases in your cluster. +- `endpoint` - The endpoint to query your Data Explorer Cluster. Follow [this](https://docs.microsoft.com/en-us/cli/azure/kusto/cluster?view=azure-cli-latest#az-kusto-cluster-show) link to get your cluster's endpoint. +- `metricName` - Name to assign to the metric. (Optional, if not set KEDA will generate a name based on the database name) +- `threshold` - Value that is used as a threshold to calculate # of pods for scale target. + +The authentication parameters could be provided using environmental variables, instead of setting them directly in metadata. Here is a list of parameters you can use to retrieve values from environment variables: + +- `tenantIdFromEnv` - An environmental variable name, that stores Azure Active Directory tenant id. Follow [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) link to retrieve your tenant id. (Optional) +- `clientIdFromEnv` - An environmental variable name, that stores Application id from your Azure AD Application/service principal. Follow [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) link to create your service principal. (Optional) +- `clientSecretFromEnv` - An environmental variable name, that stores password from your Azure AD Application/service principal. (Optional) + +### Query Guidance + +It is important to design your query to return 1 row. A good practice is to add "| limit 1" at the end of your query. + +Data types of your query result should be: real, int or long. Other data types are not supported. Later, during runtime, your data will be converted to int64. + +Be careful with setting up "pollingInterval" and long running queries. Test your query before. + +### Authentication Parameters + +You can use the `TriggerAuthentication` CRD to configure the authentication by providing a set of Azure Active Directory credentials or by using pod identity. + +**Credential based authentication:** + +- `clientId` - Application id from your Azure AD Application/service principal. Follow [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) link to create your service principal. +- `clientSecret` - Password from your Azure AD Application/service principal. +- `tenantId` - Azure Active Directory tenant id. Follow [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) link to retrieve your tenant id. + +The principal will need `DatabaseViewer` role to query metrics from the Data Explorer Cluster. Follow [this](https://docs.microsoft.com/en-us/cli/azure/kusto/database?view=azure-cli-latest#az-kusto-database-add-principal) to assign your principal with the right access permissions through az cli. + +**Pod identity based authentication:** + +[Azure Active Directory pod-managed identity](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity) can be used. +The identity that being used by pod identity will need `DatabaseViewer` role to particular database query from the Data Explorer Cluster. Follow [this](https://docs.microsoft.com/en-us/cli/azure/kusto/database?view=azure-cli-latest#az-kusto-database-add-principal) to assign your principal with the right access permissions through az cli. + +in place of credential based authentication. The following section contains an example of a `TriggerAuthentication` using pod identity. + +### Example + +The following example illustrates the use of a TriggerAuthentication to connect to Data Explorer. +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: azure-data-explorer-secret +data: + clientId: # Base64 encoded + clientSecret: # Base64 encoded + tenantId: # Base64 encoded +--- +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: azure-data-explorer-trigger-auth +spec: + secretTargetRef: + - parameter: clientId + name: azure-data-explorer-secret + key: clientId + - parameter: clientSecret + name: azure-data-explorer-secret + key: clientSecret + - parameter: tenantId + name: azure-data-explorer-secret + key: tenantId + # or Pod Identity, kind: Secret is not required in case of pod Identity + podIdentity: + provider: azure +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: azure-data-explorer-scaler +spec: + scaleTargetRef: + kind: StatefulSet # Optional: Default: Deployment, Available Options: ReplicaSet Deployment, DaemonSet, StatefulSet + name: azure-data-explorer-example + pollingInterval: 30 + cooldownPeriod: 45 + minReplicaCount: 0 + maxReplicaCount: 10 + triggers: + - type: azure-data-explorer + metadata: + databaseName: Weather + endpoint: https://..kusto.windows.net + metricName: Storm-Events + query: | + StormEvents + | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | top 1 by StormCount desc + threshold: "1000" + authenticationRef: + name: azure-data-explorer-trigger-auth +``` + +The following example illustrates the use of environment variables to connect to Application Insights. +```yaml +apiVersion: v1 +kind: Secret +metadata: + name: azure-data-explorer-secrets +type: Opaque +data: + clientId: # Base64 encoded + clientSecret: # Base64 encoded + tenantId: # Base64 encoded +--- +apiVersion: apps/v1 +kind: Deployment +metadata: + name: azure-data-explorer-example +spec: + replicas: 0 + selector: + matchLabels: + app: azure-data-explorer-example + template: + metadata: + labels: + app: azure-data-explorer-example + spec: + containers: + - name: example + image: nginx:1.16.1 + env: + - name: AAD_APP_CLIENT_ID + valueFrom: + secretKeyRef: + name: azure-data-explorer-secret + key: clientId + - name: AAD_APP_SECRET + valueFrom: + secretKeyRef: + name: azure-data-explorer-secret + key: clientSecret + - name: AAD_APP_TENANT_ID + valueFrom: + secretKeyRef: + name: azure-data-explorer-secret + key: tenantId +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: azure-data-explorer-scaler +spec: + scaleTargetRef: + name: azure-data-explorer-example + pollingInterval: 30 + cooldownPeriod: 45 + minReplicaCount: 0 + maxReplicaCount: 10 + triggers: + - type: azure-data-explorer + metadata: + clientIdFromEnv: AAD_APP_CLIENT_ID + clientSecretFromEnv: AAD_APP_SECRET + tenantIdFromEnv: AAD_APP_TENANT_ID + databaseName: Weather + endpoint: https://..kusto.windows.net + metricName: Storm-Events + query: | + StormEvents + | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | top 1 by StormCount desc + threshold: "1000" +``` From 9746fa1d1ca3f88136b7d6702925972efaa0f7f5 Mon Sep 17 00:00:00 2001 From: Yarden Siboni Date: Wed, 16 Feb 2022 19:46:43 +0200 Subject: [PATCH 2/8] pr comments Signed-off-by: Yarden Siboni --- .../docs/2.7/scalers/azure-data-explorer.md | 98 ++++++++++++------- 1 file changed, 62 insertions(+), 36 deletions(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index 3d6773aee..cd511b306 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -15,75 +15,70 @@ This specification describes the `azure-data-explorer` trigger that scales based triggers: - type: azure-data-explorer metadata: - podIdentity: "azure" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well - clientId: "AAD_APP_CLIENT_ID" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well - clientSecret: "AAD_APP_SECRET" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well - tenantId: "AAD_APP_TENANT_ID" # Provide either podIdentity or aad app creds. can use TriggerAuthentication as well + endpoint: "DATA_EXPLORER_ENDPOINT" databaseName: "DATA_EXPLORER_DATABASE_NAME" - endpoint: "https://..kusto.windows.net" query: | StormEvents | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State | top 1 by StormCount desc threshold: "1000" - metricName: "DATA_EXPLORER_METRIC_NAME" # Optional + tenantId: AAD_APP_TENANT_ID # Can use TriggerAuthentication as well + clientId: AAD_APP_CLIENT_ID # Can use TriggerAuthentication as well + clientSecret: AAD_APP_SECRET # Can use TriggerAuthentication as well # Alternatively, you can use existing environment variables to read aad app creds from: clientIdFromEnv: AAD_APP_CLIENT_ID_ENV_VAR_NAME # Optional. You can use this instead of `clientId` parameter. clientSecretFromEnv: AAD_APP_SECRET_ENV_VAR_NAME # Optional. You can use this instead of `clientSecret` parameter. tenantIdFromEnv: AAD_APP_TENANT_ID_ENV_VAR_NAME # Optional. You can use this instead of `tenantId` parameter. ``` -This scaler is backed by Azure Data Explorer Goland SDK. Please see [this](https://docs.microsoft.com/en-us/azure/data-explorer/kusto/api/golang/kusto-golang-client-library) page -for further details. - **Parameter list:** -Provide either podIdentity or aad app creds (clientId, clientSecret and tenantId). -- `clientId` - Id of the application from your Azure AD Application/service principal. Follow [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) link to create your service principal. -- `clientSecret` - Password from your Azure AD Application/service principal. -- `tenantId` - Id of the Azure Active Directory tenant. Follow [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) link to -retrieve your tenant id. -- `podIdentity` - [Azure Active Directory pod-managed identity](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity) can be used. Only "azure" is supported. -- `databaseName` - The name of the Data Explorer Database to query. Use the [Azure Command Line Interface](https://docs.microsoft.com/en-us/cli/azure/install-azure-cli) to run `az kusto database list` to see a list of available databases in your cluster. -- `endpoint` - The endpoint to query your Data Explorer Cluster. Follow [this](https://docs.microsoft.com/en-us/cli/azure/kusto/cluster?view=azure-cli-latest#az-kusto-cluster-show) link to get your cluster's endpoint. -- `metricName` - Name to assign to the metric. (Optional, if not set KEDA will generate a name based on the database name) + +- `endpoint` - The endpoint to query your Data Explorer Cluster. +- `databaseName` - The name of the Data Explorer Database to query. +- `query` - Data Explorer query. - `threshold` - Value that is used as a threshold to calculate # of pods for scale target. +- `tenantId` - Id of the Azure AD tenant. +- `clientId` - Id of the Azure AD application. +- `clientSecret` - Password of the Azure AD application. The authentication parameters could be provided using environmental variables, instead of setting them directly in metadata. Here is a list of parameters you can use to retrieve values from environment variables: -- `tenantIdFromEnv` - An environmental variable name, that stores Azure Active Directory tenant id. Follow [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) link to retrieve your tenant id. (Optional) -- `clientIdFromEnv` - An environmental variable name, that stores Application id from your Azure AD Application/service principal. Follow [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) link to create your service principal. (Optional) -- `clientSecretFromEnv` - An environmental variable name, that stores password from your Azure AD Application/service principal. (Optional) +- `tenantIdFromEnv` - An environmental variable name, that stores Azure AD tenant id. (Optional) +- `clientIdFromEnv` - An environmental variable name, that stores application id of your Azure AD Application. (Optional) +- `clientSecretFromEnv` - An environmental variable name, that stores password of the Azure AD application. (Optional) ### Query Guidance -It is important to design your query to return 1 row. A good practice is to add "| limit 1" at the end of your query. +It is important to design your query to return 1 row. A good practice is to add `| limit 1` at the end of your query. -Data types of your query result should be: real, int or long. Other data types are not supported. Later, during runtime, your data will be converted to int64. +The only supported data types for your query result are `real`, `int` or `long`. -Be careful with setting up "pollingInterval" and long running queries. Test your query before. +Be careful with defining `pollingInterval` and using long-running queries. Make sure to test your query before using it. ### Authentication Parameters You can use the `TriggerAuthentication` CRD to configure the authentication by providing a set of Azure Active Directory credentials or by using pod identity. +The AD identity that will be used requires `DatabaseViewer` role to query metrics from the Data Explorer Cluster. + +💡You can use [this guide ](https://docs.microsoft.com/en-us/cli/azure/kusto/database?view=azure-cli-latest#az-kusto-database-add-principal) to assign your principal with the right access permissions through the Azure CLI. + **Credential based authentication:** -- `clientId` - Application id from your Azure AD Application/service principal. Follow [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) link to create your service principal. -- `clientSecret` - Password from your Azure AD Application/service principal. -- `tenantId` - Azure Active Directory tenant id. Follow [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) link to retrieve your tenant id. +- `clientId` - Id of the Azure AD application. Use [this](https://docs.microsoft.com/en-us/cli/azure/ad/sp?view=azure-cli-latest) guide to create your service principal. +- `clientSecret` - Password of the Azure AD application. +- `tenantId` - Id of the Azure AD tenant. Use [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) guide to retrieve your tenant id. -The principal will need `DatabaseViewer` role to query metrics from the Data Explorer Cluster. Follow [this](https://docs.microsoft.com/en-us/cli/azure/kusto/database?view=azure-cli-latest#az-kusto-database-add-principal) to assign your principal with the right access permissions through az cli. **Pod identity based authentication:** [Azure Active Directory pod-managed identity](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity) can be used. -The identity that being used by pod identity will need `DatabaseViewer` role to particular database query from the Data Explorer Cluster. Follow [this](https://docs.microsoft.com/en-us/cli/azure/kusto/database?view=azure-cli-latest#az-kusto-database-add-principal) to assign your principal with the right access permissions through az cli. in place of credential based authentication. The following section contains an example of a `TriggerAuthentication` using pod identity. ### Example -The following example illustrates the use of a TriggerAuthentication to connect to Data Explorer. +Azure AD Application based authentication. ```yaml apiVersion: v1 kind: Secret @@ -109,7 +104,40 @@ spec: - parameter: tenantId name: azure-data-explorer-secret key: tenantId - # or Pod Identity, kind: Secret is not required in case of pod Identity +--- +apiVersion: keda.sh/v1alpha1 +kind: ScaledObject +metadata: + name: azure-data-explorer-scaler +spec: + scaleTargetRef: + kind: StatefulSet # Optional: Default: Deployment, Available Options: ReplicaSet Deployment, DaemonSet, StatefulSet + name: azure-data-explorer-example + pollingInterval: 30 + cooldownPeriod: 45 + minReplicaCount: 0 + maxReplicaCount: 10 + triggers: + - type: azure-data-explorer + metadata: + databaseName: Weather + endpoint: DATA_EXPLORER_ENDPOINT + query: | + StormEvents + | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | top 1 by StormCount desc + threshold: "1000" + authenticationRef: + name: azure-data-explorer-trigger-auth +``` + +Pod Identity based authentication. +```yaml +apiVersion: keda.sh/v1alpha1 +kind: TriggerAuthentication +metadata: + name: azure-data-explorer-trigger-auth +spec: podIdentity: provider: azure --- @@ -129,8 +157,7 @@ spec: - type: azure-data-explorer metadata: databaseName: Weather - endpoint: https://..kusto.windows.net - metricName: Storm-Events + endpoint: DATA_EXPLORER_ENDPOINT query: | StormEvents | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State @@ -140,7 +167,7 @@ spec: name: azure-data-explorer-trigger-auth ``` -The following example illustrates the use of environment variables to connect to Application Insights. +Azure AD Application based authentication through environment variables. ```yaml apiVersion: v1 kind: Secret @@ -204,8 +231,7 @@ spec: clientSecretFromEnv: AAD_APP_SECRET tenantIdFromEnv: AAD_APP_TENANT_ID databaseName: Weather - endpoint: https://..kusto.windows.net - metricName: Storm-Events + endpoint: DATA_EXPLORER_ENDPOINT query: | StormEvents | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State From 352dde47b5878351926ebce1ce1a46e585395e29 Mon Sep 17 00:00:00 2001 From: Yarden Siboni Date: Sat, 19 Feb 2022 15:11:27 +0200 Subject: [PATCH 3/8] change parameters to concrete values Signed-off-by: Yarden Siboni --- .../docs/2.7/scalers/azure-data-explorer.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index cd511b306..12c3f10bf 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -15,16 +15,16 @@ This specification describes the `azure-data-explorer` trigger that scales based triggers: - type: azure-data-explorer metadata: - endpoint: "DATA_EXPLORER_ENDPOINT" - databaseName: "DATA_EXPLORER_DATABASE_NAME" + endpoint: https://keda.eastus.kusto.windows.net + databaseName: kedadb query: | StormEvents - | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | summarize StormCount = count() by State | top 1 by StormCount desc threshold: "1000" - tenantId: AAD_APP_TENANT_ID # Can use TriggerAuthentication as well - clientId: AAD_APP_CLIENT_ID # Can use TriggerAuthentication as well - clientSecret: AAD_APP_SECRET # Can use TriggerAuthentication as well + tenantId: 045ef409-6dee-4893-a824-5612eac467b1 # Can use TriggerAuthentication as well + clientId: 4ba039f1-d69c-434e-9268-4a2bb7bba90d # Can use TriggerAuthentication as well + clientSecret: t0p-s3cret # Can use TriggerAuthentication as well # Alternatively, you can use existing environment variables to read aad app creds from: clientIdFromEnv: AAD_APP_CLIENT_ID_ENV_VAR_NAME # Optional. You can use this instead of `clientId` parameter. clientSecretFromEnv: AAD_APP_SECRET_ENV_VAR_NAME # Optional. You can use this instead of `clientSecret` parameter. @@ -121,7 +121,7 @@ spec: - type: azure-data-explorer metadata: databaseName: Weather - endpoint: DATA_EXPLORER_ENDPOINT + endpoint: https://keda.eastus.kusto.windows.net query: | StormEvents | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State @@ -157,7 +157,7 @@ spec: - type: azure-data-explorer metadata: databaseName: Weather - endpoint: DATA_EXPLORER_ENDPOINT + endpoint: https://keda.eastus.kusto.windows.net query: | StormEvents | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State @@ -231,7 +231,7 @@ spec: clientSecretFromEnv: AAD_APP_SECRET tenantIdFromEnv: AAD_APP_TENANT_ID databaseName: Weather - endpoint: DATA_EXPLORER_ENDPOINT + endpoint: https://keda.eastus.kusto.windows.net query: | StormEvents | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State From a85837351aa192f133a970ceafa118d020c37d94 Mon Sep 17 00:00:00 2001 From: Yarden Siboni Date: Sat, 19 Feb 2022 15:15:58 +0200 Subject: [PATCH 4/8] change kusto query to return only one value Signed-off-by: Yarden Siboni --- content/docs/2.7/scalers/azure-data-explorer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index 12c3f10bf..92876d3c6 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -124,7 +124,7 @@ spec: endpoint: https://keda.eastus.kusto.windows.net query: | StormEvents - | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | summarize StormCount = count() by State | top 1 by StormCount desc threshold: "1000" authenticationRef: @@ -160,7 +160,7 @@ spec: endpoint: https://keda.eastus.kusto.windows.net query: | StormEvents - | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | summarize StormCount = count() by State | top 1 by StormCount desc threshold: "1000" authenticationRef: @@ -234,7 +234,7 @@ spec: endpoint: https://keda.eastus.kusto.windows.net query: | StormEvents - | summarize StormCount = count(), TypeOfStorms = dcount(EventType) by State + | summarize StormCount = count() by State | top 1 by StormCount desc threshold: "1000" ``` From 4ae7da221b27b8343f3e9cf115681920efbc972a Mon Sep 17 00:00:00 2001 From: Yarden Siboni Date: Tue, 22 Feb 2022 17:28:21 +0200 Subject: [PATCH 5/8] modify examples Signed-off-by: Yarden Siboni --- content/docs/2.7/scalers/azure-data-explorer.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index 92876d3c6..ba53d265a 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -69,16 +69,14 @@ The AD identity that will be used requires `DatabaseViewer` role to query metric - `clientSecret` - Password of the Azure AD application. - `tenantId` - Id of the Azure AD tenant. Use [this](https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az-account-show) guide to retrieve your tenant id. - **Pod identity based authentication:** [Azure Active Directory pod-managed identity](https://docs.microsoft.com/en-us/azure/aks/use-azure-ad-pod-identity) can be used. -in place of credential based authentication. The following section contains an example of a `TriggerAuthentication` using pod identity. +### Examples -### Example +### Use TriggerAuthentication with Azure AD Application. -Azure AD Application based authentication. ```yaml apiVersion: v1 kind: Secret @@ -96,8 +94,8 @@ metadata: spec: secretTargetRef: - parameter: clientId - name: azure-data-explorer-secret - key: clientId + name: azure-data-explorer-secret # Required. Refers to the name of the secret + key: clientId - parameter: clientSecret name: azure-data-explorer-secret key: clientSecret @@ -131,7 +129,8 @@ spec: name: azure-data-explorer-trigger-auth ``` -Pod Identity based authentication. +### Use TriggerAuthentication with Azure Pod Identity. + ```yaml apiVersion: keda.sh/v1alpha1 kind: TriggerAuthentication @@ -167,7 +166,8 @@ spec: name: azure-data-explorer-trigger-auth ``` -Azure AD Application based authentication through environment variables. +### Use TriggerAuthentication with Azure AD Application through environment variables. + ```yaml apiVersion: v1 kind: Secret From aafac18e18547d1e4d8cb1a0929d37462714316c Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 23 Feb 2022 09:01:01 +0100 Subject: [PATCH 6/8] Nit Signed-off-by: Tom Kerkhove --- content/docs/2.7/scalers/azure-data-explorer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index ba53d265a..7e9c367ff 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -129,7 +129,7 @@ spec: name: azure-data-explorer-trigger-auth ``` -### Use TriggerAuthentication with Azure Pod Identity. +### Use TriggerAuthentication with Azure Pod Identity ```yaml apiVersion: keda.sh/v1alpha1 From e2c46aac75086a98f760a7f9e45cf9bd6ee35956 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 23 Feb 2022 09:01:10 +0100 Subject: [PATCH 7/8] Nit Signed-off-by: Tom Kerkhove --- content/docs/2.7/scalers/azure-data-explorer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index 7e9c367ff..983a8b180 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -166,7 +166,7 @@ spec: name: azure-data-explorer-trigger-auth ``` -### Use TriggerAuthentication with Azure AD Application through environment variables. +### Use TriggerAuthentication with Azure AD Application through environment variables ```yaml apiVersion: v1 From 7eb84b6dc0e719b7984181696b72093c54db3a62 Mon Sep 17 00:00:00 2001 From: Tom Kerkhove Date: Wed, 23 Feb 2022 09:01:18 +0100 Subject: [PATCH 8/8] Nit Signed-off-by: Tom Kerkhove --- content/docs/2.7/scalers/azure-data-explorer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/2.7/scalers/azure-data-explorer.md b/content/docs/2.7/scalers/azure-data-explorer.md index 983a8b180..65a0ce765 100644 --- a/content/docs/2.7/scalers/azure-data-explorer.md +++ b/content/docs/2.7/scalers/azure-data-explorer.md @@ -75,7 +75,7 @@ The AD identity that will be used requires `DatabaseViewer` role to query metric ### Examples -### Use TriggerAuthentication with Azure AD Application. +### Use TriggerAuthentication with Azure AD Application ```yaml apiVersion: v1