# How to set different tenant\_id for source and destination in CloudQuery

**URL:** <https://community.cloudquery.io/t/how-to-set-different-tenant-id-for-source-and-destination-in-cloudquery/453>\
**Category:** CloudQuery Plugins\
**Created:** [January 12, 2024, 9:28am UTC](https://community.cloudquery.io/t/how-to-set-different-tenant-id-for-source-and-destination-in-cloudquery/453 "2024-01-12T09:28:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![obliging-kangaroo](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@obliging-kangaroo](https://community.cloudquery.io/u/obliging-kangaroo)\
**Post date:** [January 12, 2024, 9:28am UTC](https://community.cloudquery.io/t/how-to-set-different-tenant-id-for-source-and-destination-in-cloudquery/453/1 "2024-01-12T09:28:51Z")

</div>

Hello team,

I am trying to retrieve data from Azure in one tenant and write it into a blob storage in another tenant. I have created a multiple tenant application so I can use the same app for both source and destination. However, the `tenant_id` needs to be different between the source and the destination.

Any idea how I can set a different `tenant_id` between the source and destination? In the documentation, I can specify only one environment variable (`AZURE_TENANT_ID`), which will be used for both source and destination. Is there a way to specify in the configuration a different one for the destination?

Thank you for your help 🙂

---

<div class="post-metadata">

**Author:** ![herman](https://sea1.discourse-cdn.com/flex001/user_avatar/community.cloudquery.io/herman/32/27_2.png) [@herman](https://community.cloudquery.io/u/herman)\
**Post date:** [January 12, 2024, 10:21am UTC](https://community.cloudquery.io/t/how-to-set-different-tenant-id-for-source-and-destination-in-cloudquery/453/2 "2024-01-12T10:21:08Z")

</div>

Hi @obliging-kangaroo 👋

This reminded me of an old issue that was similar: [#3551 on GitHub](https://github.com/cloudquery/cloudquery/issues/3551). At the time, it was closed as won’t fix.

However, it seems like in that request, the problem was using multiple tenants on the source side, whereas you’re asking about different tenants between source and destination.

What you’re asking is technically possible via a workaround, but it’s a little bit tricky/annoying 🙂

What I think you can do is run the destination plugin as a standalone gRPC server, then update your config to connect to it via gRPC. If you do this, you’d have the ability to provide a different `TENANT_ID` to the destination than to the source.

If this doesn’t make sense let me know, I’d be happy to expand a bit more.

Actually, let me just say one more thing.

To download the destination plugin and run it as a gRPC server you can:

1. Run `cloudquery install`, then
2. Run something like:

```auto
.cq/plugins/destination/cloudquery/azblob/v{VERSION}/plugin serve

```

It will then print the address, usually `127.0.0.1:7777`, which you’ll need to set as the `path` in your destination config. You should also change the `registry` value to `grpc`.

The thing that makes it annoying, though, is that you’ll then need to stop the destination plugin server yourself, because the CloudQuery CLI won’t have ownership over the process.

---

<div class="post-metadata">

**Author:** ![obliging-kangaroo](https://avatars.discourse-cdn.com/v4/letter/o/a183cd/32.png) [@obliging-kangaroo](https://community.cloudquery.io/u/obliging-kangaroo)\
**Post date:** [January 12, 2024, 4:17pm UTC](https://community.cloudquery.io/t/how-to-set-different-tenant-id-for-source-and-destination-in-cloudquery/453/3 "2024-01-12T16:17:34Z")

</div>

Hello @herman, thank you for your quick reply! I think we are going to fix it by copying the files into a local directory in the server and then do an `az copy` to our blob storage. That seems to me as the easiest solution, without adding too much complexity.
