<p>I'm getting an error: </p>

<blockquote>
  <p>UnauthorizedError: InvalidSignature: The token has an invalid signature</p>
</blockquote>

<p>when I'm trying to access Azure Service Bus from a nodejs docker container running inside Kubernetes cluster in Azure. </p>

<p>Interesting to note that I don't get this error when I run the code locally, or just inside the docker container on my dev laptop but as soon as I deploy container to K8 cluster I'm getting that error.</p>

<p>I verified the service-bus SAS primary key is correct inside K8 cluster secrets file.</p>

<p>Here's how error object looks like inside K8 cluster:</p>

<pre><code>UnauthorizedError: InvalidSignature: The token has an invalid signature. {"timestamp":"2019-01-08T05:43:48.918Z"}
debug: condition: com.microsoft:auth-failed {"timestamp":"2019-01-08T05:43:48.920Z"}
debug: info: undefined {"timestamp":"2019-01-08T05:43:48.920Z"}
debug: message: InvalidSignature: The token has an invalid signature. {"timestamp":"2019-01-08T05:43:48.924Z"}
debug: name: UnauthorizedError {"timestamp":"2019-01-08T05:43:48.924Z"}
debug: retryable: false {"timestamp":"2019-01-08T05:43:48.924Z"}
debug: stack: UnauthorizedError: InvalidSignature: The token has an invalid signature.
    at Object.translate (/usr/src/app/node_modules/@azure/amqp-common/dist/lib/errors.js:527:17)
    at Receiver.messageCallback (/usr/src/app/node_modules/@azure/amqp-common/dist/lib/requestResponseLink.js:109:44)
    at Receiver.emit (events.js:182:13)
    at emit (/usr/src/app/node_modules/rhea-promise/dist/lib/util/utils.js:129:24)
    at Object.emitEvent (/usr/src/app/node_modules/rhea-promise/dist/lib/util/utils.js:140:9)
    at Receiver._link.on (/usr/src/app/node_modules/rhea-promise/dist/lib/link.js:249:25)
    at Receiver.emit (events.js:182:13)
    at Receiver.link.dispatch (/usr/src/app/node_modules/rhea/lib/link.js:59:37)
    at Incoming.on_transfer (/usr/src/app/node_modules/rhea/lib/session.js:360:22)
    at Session.on_transfer (/usr/src/app/node_modules/rhea/lib/session.js:736:19) {"timestamp":"2019-01-08T05:43:48.925Z"}
debug: translated: true {"timestamp":"2019-01-08T05:43:48.925Z"}
</code></pre>

<p>I'm using <a href="https://github.com/Azure/azure-service-bus-node" rel="nofollow noreferrer">@azure/service-bus</a> as a node package to work with azure service bus.</p>

<p>Any help, suggestions or ideas highly appreciated.</p>

<p>Thank you very one.</p>

Dmitry Lukianenko
<p>in this case the issue was with the way OP passes the SAS string to the container</p>
