# Unable to pass Azure snapshot repository Setting "client" in java API

**URL:** <https://discuss.elastic.co/t/unable-to-pass-azure-snapshot-repository-setting-client-in-java-api/313558>\
**Category:** Elasticsearch\
**Tags:** snapshot-and-restore\
**Created:** [September 2, 2022, 2:10pm UTC](https://discuss.elastic.co/t/unable-to-pass-azure-snapshot-repository-setting-client-in-java-api/313558 "2022-09-02T14:10:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![irene\_ghafari](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/irene_ghafari/32/110401_2.png) [@irene\_ghafari](https://discuss.elastic.co/u/irene_ghafari)\
**Post date:** [September 2, 2022, 2:10pm UTC](https://discuss.elastic.co/t/unable-to-pass-azure-snapshot-repository-setting-client-in-java-api/313558/1 "2022-09-02T14:10:45Z")

</div>

Hello 🙂

I want to register an Azure repository for Elasticsearch snapshot restoration, from a client other than default. It mentions [in the documentation](https://www.elastic.co/guide/en/elasticsearch/plugins/7.17/repository-azure-client-settings.html) that I should set the client in repository settings. and it works like this indeed

PUT \_snapshot/my\_old\_repo { "type": "azure", "settings": { "client": "old" } }

But I am not able to do it via the Java Api. I get the error : `Unknown field 'client' for type 'co.elastic.clients.elasticsearch.snapshot.RepositorySettings$Builder'`

Could you please let me know if there is a way to do it in Java?  
Although I have used the underlying `org.elasticsearch.client.RestClient` to send a `PUT` request. But I prefer to use the `co.elastic.clients.elasticsearch.ElasticsearchClient`

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 30, 2022, 2:11pm UTC](https://discuss.elastic.co/t/unable-to-pass-azure-snapshot-repository-setting-client-in-java-api/313558/2 "2022-09-30T14:11:33Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
