# Error while creating elasticsearch Azure repository for snapshot and restore

**URL:** <https://discuss.elastic.co/t/error-while-creating-elasticsearch-azure-repository-for-snapshot-and-restore/61248>\
**Category:** Elasticsearch\
**Created:** [September 22, 2016, 11:59am UTC](https://discuss.elastic.co/t/error-while-creating-elasticsearch-azure-repository-for-snapshot-and-restore/61248 "2016-09-22T11:59:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r.ganeshbabu](https://avatars.discourse-cdn.com/v4/letter/r/4da419/32.png) [@r.ganeshbabu](https://discuss.elastic.co/u/r.ganeshbabu)\
**Post date:** [September 22, 2016, 11:59am UTC](https://discuss.elastic.co/t/error-while-creating-elasticsearch-azure-repository-for-snapshot-and-restore/61248/1 "2016-09-22T11:59:04Z")

</div>

Hi All,

I want to take snapshot and restore using azure repository in Linux, I have configured these below setting in yml,

```
cloud:
    azure:
        storage:
            my_account:
                account: https://devesrepo.blob.core.windows.net/
                key: KEY

```

with the above setting, service is started, but i m getting below error when creating repository in Elasticsearch 2.4.0,

```
PUT _snapshot/my_backup
{
    "type": "azure"
}

```

**Error msg:-**

```
{
   "error": {
      "root_cause": [
         {
            "type": "repository_exception",
            "reason": "[elasticsearch-snapshots] Can not find an azure client for account [null]"
         }
      ],
      "type": "repository_exception",
      "reason": "[elasticsearch-snapshots] Can not find an azure client for account [null]"
   },
   "status": 500
}

```

When I looked into the ES logs I could see **cloud storage account not getting created at the start of elasticsearch**

```
2016-09-22 07:30:23,221][INFO][http] [mue2rhegrdd002_RD_NDX_MASTER] publish_address {10.247.0.4:9200}, bound_addresses {10.247.0.4:9200}
[2016-09-22 07:30:23,221][INFO][node] [mue2rhegrdd002_RD_NDX_MASTER] started
[2016-09-22 07:30:23,258][INFO][cluster.service] [mue2rhegrdd002_RD_NDX_MASTER] new_master {mue2rhegrdd002_RD_NDX_MASTER}{-mRr-uLKQkyEJwfqLLI_2Q}{10.247.0.4}{10.247.0.4:9300}{data=false, max_local_storage_nodes=1, master=true}, added {{mue2rhegrdd001_RD_NDX_DATA}{O-JSVOlMQXCuwb5nf5XheQ}{10.247.0.5}{10.247.0.5:9260}{max_local_storage_nodes=1, master=false},{mue2rhegrdd001_RD_NDX_MASTER}{DMAPO7O6QEuXmcsP6aGuAQ}{10.247.0.5}{10.247.0.5:9300}{data=false, max_local_storage_nodes=1, master=true},}, reason: zen-disco-join(elected_as_master, [1] joins received)
[2016-09-22 07:30:24,576][ERROR][cloud.azure.storage] [mue2rhegrdd002_RD_NDX_MASTER] can not create azure storage client: Primary and secondary location URIs in a StorageUri must point to the same resource.
[2016-09-22 07:30:24,589][INFO][watcher] [mue2rhegrdd002_RD_NDX_MASTER] starting watch service...
[2016-09-22 07:30:24,590][INFO][watcher] [mue2rhegrdd002_RD_NDX_MASTER] watch service has started
[2016-09-22 07:30:24,631][INFO][license.plugin.core] [mue2rhegrdd002_RD_NDX_MASTER] license [cf8a2152-4f41-4739-8459-4137cac8105b] - valid
[2016-09-22 07:30:25,489][INFO][gateway] [mue2rhegrdd002_RD_NDX_MASTER] recovered [20] indices into cluster_state
[2016-09-22 07:30:26,021][INFO][http] [mue2rhegrdd002_RD_NDX_DATA] publish_address {10.247.0.4:9240}, bound_addresses {10.247.0.4:9240}
[2016-09-22 07:30:26,021][INFO][node] [mue2rhegrdd002_RD_NDX_DATA] started
[2016-09-22 07:30:26,622][INFO][cluster.service] [mue2rhegrdd002_RD_NDX_MASTER] added {{mue2rhegrdd002_RD_NDX_DATA}{eE1n1iLMQom6VEgYfBwJ9g}{10.247.0.4}{10.247.0.4:9260}{max_local_storage_nodes=1, master=false},}, reason: zen-disco-join(join from node[{mue2rhegrdd002_RD_NDX_DATA}{eE1n1iLMQom6VEgYfBwJ9g}{10.247.0.4}{10.247.0.4:9260}{max_local_storage_nodes=1, master=false}])
[2016-09-22 07:30:26,678][INFO][cluster.service] [mue2rhegrdd002_RD_NDX_DATA] detected_master {mue2rhegrdd002_RD_NDX_MASTER}{-mRr-uLKQkyEJwfqLLI_2Q}{10.247.0.4}{10.247.0.4:9300}{data=false, max_local_storage_nodes=1, master=true}, added {{mue2rhegrdd001_RD_NDX_DATA}{O-JSVOlMQXCuwb5nf5XheQ}{10.247.0.5}{10.247.0.5:9260}{max_local_storage_nodes=1, master=false},{mue2rhegrdd001_RD_NDX_MASTER}{DMAPO7O6QEuXmcsP6aGuAQ}{10.247.0.5}{10.247.0.5:9300}{data=false, max_local_storage_nodes=1, master=true},{mue2rhegrdd002_RD_NDX_MASTER}{-mRr-uLKQkyEJwfqLLI_2Q}{10.247.0.4}{10.247.0.4:9300}{data=false, max_local_storage_nodes=1, master=true},}, reason: zen-disco-receive(from master [{mue2rhegrdd002_RD_NDX_MASTER}{-mRr-uLKQkyEJwfqLLI_2Q}{10.247.0.4}{10.247.0.4:9300}{data=false, max_local_storage_nodes=1, master=true}])
[2016-09-22 07:30:26,711][ERROR][cloud.azure.storage] [mue2rhegrdd002_RD_NDX_DATA] can not create azure storage client: Primary and secondary location URIs in a StorageUri must point to the same resource.
[2016-09-22 07:30:26,764][INFO][license.plugin.core] [mue2rhegrdd002_RD_NDX_DATA] license [cf8a2152-4f41-4739-8459-4137cac8105b] - valid

```

Please let us know your suggestions to resolve this.

Thanks,  
Ganeshbabu R

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [September 28, 2016, 11:09am UTC](https://discuss.elastic.co/t/error-while-creating-elasticsearch-azure-repository-for-snapshot-and-restore/61248/2 "2016-09-28T11:09:54Z")

</div>

I answered on the [Github issue](https://github.com/elastic/elasticsearch/issues/20633).

The problem is that we are currently swallowing the original exception.

For the record the problem here is that the right configuration should be:

```auto
cloud:
  azure:
    storage:
      my_account:
        account: devesrepo
        key: KEY

```

---

<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:** [July 5, 2017, 10:16pm UTC](https://discuss.elastic.co/t/error-while-creating-elasticsearch-azure-repository-for-snapshot-and-restore/61248/3 "2017-07-05T22:16:42Z")

</div>


