79650864

Date: 2025-06-03 08:22:31
Score: 1
Natty:
Report link

This can be a approach to write to a google sheet from Azure Data Factory.

First, securely store your Google API credentials in Azure Key Vault. Go to the Key Vault in the Azure portal, open the Secrets section, and add googleclientid, googleclientsecret, and googlerefreshtoken as individual secrets. These will later be retrieved by ADF to authenticate with the Google Sheets API.

Next, grant ADF access to these secrets. In Key Vault, go to Access Configuration, ensure Access policies are enabled, and add a new access policy. Assign the "Get" permission for secrets to ADF’s managed identity.

In Azure Data Factory, create a pipeline and add Web Activity for each secret to get the secrets for you.

enter image description here

Then add a Web activity named GetAccessToken. This activity sends a POST request to https://oauth2.googleapis.com/token. In the request body, use dynamic content to insert the secrets from previous activity, and set grant_type to refresh_token to retrieve a fresh access token.

enter image description here

Create a pipeline variable access_token and add Set Variable activity to get the output value @activity('GetAccessTokens').output.access_token

enter image description here

At last add a web activity, which write to sheet using POST method and

add headers as Authorization : Bearer @{variables('access_token')}.

enter image description here

Here is how the pipeline is designed:

enter image description here

Note: I will be not able to show a workable output as I do not have required secrets/ids for google APIs.

You can follow this document for more details

connector-google-sheets?tabs=data-factory

Reasons:
  • Blacklisted phrase (1): this document
  • Probably link only (1):
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Pritam