Azure script not working after upgrading Octopus

Hi,
I am using Octopus in kubernetes. I have created a docker image what is based on the octopusdeploy image, there I have added az cli and other packages.
Previously I used octopusdeploy:2021.2 image. And everything works as expected.

After upgrading Octopus to 2022.2. I am unable to use azure script. I have tried Use Azure tools pre-installed on the worker and Use Azure tools bundled with Octopus both options. And no luck.

I get the following error:

March 17th 2023 00:25:16Error
Error detail: {"error":"invalid_tenant","error_description":"AADSTS90002: Tenant '\"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\"' not found. Check to make sure you have the correct tenant ID and are signing into the correct cloud. Check with your subscription administrator, this may happen if there are no active subscriptions for the tenant.\r\nTrace ID: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\r\nCorrelation ID: xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx\r\nTimestamp: 2023-03-16 18:25:16Z","error_codes":[90002],"timestamp":"2023-03-16 18:25:16Z","trace_id":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx","correlation_id":"xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx","error_uri":"https://login.microsoftonline.com/error?code=90002"} 
March 17th 2023 00:25:17Error
ERROR: The subscription of 'xxxxxx-xxxx-xxxx-xxxx-xxxxxxxx' doesn't exist in cloud 'AzureCloud'.```

Do you have any clue?

Hi @fagun,

Thanks for reaching out and providing this initial information, and sorry to hear you are having trouble with your Azure scripts since updating Octopus Deploy, but I would be happy to help take a closer look.

As an initial step, would you be able to upload the complete, raw task log for this deployment for me to review? Here is a secure link where you can upload this, so you don’t have to post it to the public forum.

Looking forward to hearing back from you,

Britton

Hi Britton,

Thanks for the quick response. Here I have uploaded the raw task logs.

Please have a look.

Thanks

Hi @fagun,

Just stepping in for Britton while he’s offline, confirming we’ve received the logs ok!

I’ve seen a very similar issue in the past where it turned out that Powershell 7.3.0 was the cause of the invalid_tenant error.

From the logs provided, it looks like you are using 7.3.2. Could you please test if reverting to 7.2.7 resolves the issue?

It looks like the issue has been resolved for 2022.3 and 2022.4 builds but looks like the issue just hasn’t been closed yet.

Looking forward to hearing how you get on!

Best Regards,

Hi @finnian.dempsey
After upgrading to 2022.3, it seems working. Thanks you so much.

I think you could add the known bug fixes to the release notes. I would be beneficial.

1 Like

Hey @fagun,

Just jumping in for Finnian who has gone for the weekend as part of our Australian based team, I will let him know that fixed the issue for you he will be pleased!

As for adding it to the release notes, that will go in our comparison page once the GitHub issue is fixed and resolved, our release notes are auto-generated based on those GitHub issues but they are only added once they have been fixed and we are unable to put them in release notes until they are fixed due to the way the code flow works.

If you have any further questions let us know as we are always happy to help!

Kind Regards,
Clare

1 Like