Running A0Deploy import in Azure pipelines causes causes error

I was doing azure pipelines deployment.
The command is working when I’m just using my VSCode.
But when I run it on the Azure pipelines I encounter this errror.

a0deploy import -i output/dev/export/tenant.yaml -c config/2_qa.json

2021-10-27T05:26:51.997Z - error: Problem running command import
2021-10-27T05:26:51.998Z - error: {“error”:“access_denied”,“error_description”:“Unauthorized”}

Can you help me solve this?

Hi @msuguitan,

An unauthorized error can mean the client (application) has not been authorized to access the resource server (API).

Make sure you have followed the steps here:

Also check that the data in your config file is entered correctly. It’s possible to get this error if you are sending incorrect credentials.

You can also look at your logs in the Auth0 dashboard to see if there is additional information.

1 Like

Hi Dan,

Followed the procedure here. I double checked on the credentials.
It seems that when I set the client secret as plain text it is working.
But when I set the client secret as an environment variable secret the error occurs.
Any idea about this?
Client Secret should be set as environment variable and secret as best practice based on the guide.

That suggests to me there is a problem when you are importing the secret, or with how you are storing it as an env variable. You can try to print a string using the same methods and see what is different.

1 Like