Create-azurewebapptarget

We deploy an azure web app and then create its webapp target in octopus. this was working fine and neither were any changes made to our azure account in octopus. it has suddenly started giving this error. please help.

Error running AzureWebAppCreateTargetServiceMessageHandler for create-azurewebapptarget: create-azurewebapptarget is invalid. Account xxxx is not available for this tenant.

Octopus.Server.Orchestration.ServerTasks.Deploy.ActionDispatch.ServiceMessageHandlers.ServiceMessageHandlerHelpers.ActionNotValid(String actionName, IEnumerable`1 errorMessages) in C:\buildAgent\work\7881e50627116cb\source\Octopus.Server\Orchestration\ServerTasks\Deploy\ActionDispatch\ServiceMessageHandlers\ServiceMessageHandlerHelpers.cs:line 22

Hi @vinayak.tillu,

Thanks for reaching out. Sorry to hear about the issue with your azure account. I believe this issue is already being worked on, let me reach out to the engineers and see what the timeline for a fix to get pushed to cloud is. As our engineers are in Australia, it may not be until later tonight or tomorrow morning that we get a response.

Please feel free to reach out in the meantime with any other questions or concerns.

Thanks,
Jeremy

Hi Jeremy
We were having this issue since July 14th. Has it been that long. Can you please provide details about the i created deployment targets manually using this account and it worked.
Thank you for your response.
Regards
Vinayak

Hi Jeremy

Thank you for your response.

We are having this problem since July 14th. Has it really been there for so long. I manually created deployment target using the same Azure account and it worked.

Please provide more details on the issue being worked on .

Thank you

Regards

Vinayak Tillu

Hi Vinayak,

There was a regression and they are still working on the issue as far as I’m aware, but I can get more information to you after I hear from engineering later tonight.

Can you please elaborate on the manually creating deployment targets portion?

Another potential workaround you could test:
If you create a second Azure account and set it to untenanted with the same credentials and switch to that account in the steps giving you the error, it should go away.

Please let me know if that workaround works for you.

Thanks,
Jeremy

Thank you Jeremy.

Current account is set to Include in both tenanted and untenanted deployments

Should i set it to Exclude from tenanted deployments and remove all the associated tenants ?

Manually creating deployment target was just to let you know that its working with the account and that the powershell method new-azurewebapptarget is failing when executed through script.

Hi Vinayak,

This workaround is assuming that you are facing the same issue as our other users, where you are trying to deploy untenanted but getting a tenant error.

I wouldn’t modify your existing account unless that’s easier for you. Creating a second identical Azure account with existing settings to be used as a workaround until the fix is in place may be easier. That’s up to you which you prefer. I would definitely create a new one just as a test to make sure it’s also working for you before you do any modifications.

The workaround is to create a new azure account (with the same credentials as the old one) in Octopus, then set this one as untenanted, as shown in the screenshot here:

Now use this new Octopus Azure Account and switch the account in the step to this new one and see if you hit the same error.

So you would have these accounts within your Octopus:
Azure Account A
Azure Account A Untenanted

Please let me know if the workaround works for you.

Thanks,
Jeremy

This is the error we are receiving when we used the new account . Its not working

Hi @vinayak.tillu,

Sorry I misunderstood what you were deploying to. I thought you were deploying to untenanted targets. Until the fix is in place you will need an Azure account set to Tenanted only with the required tenants attached, and an Azure account set to exclude from tenants, and use those tow accounts respectively for if you are deploying to tenants or not.

Can you try Modifying/creating an account to have tenanted only with the required tenants and try that instead?

Thanks,
Jeremy

So the project uses the variable Tenant.Azure.Account … so i set this tenanted account in the Tenants section for each tenant in variables ?

Also will i need to create a new release for these values to apply ? Or can i re-run the existing release and it will pick up the new azure account value ?

Hi @vinayak.tillu,

You would go to this section within the azure account:

Change it to Include only in tenanted deployments, then select the appropriate tenants+tags that you will be deploying to in the new field(Associated Tenants). This should allow you to use your azure account in tenanted deployments. You will use this one when deploying to tenants (by changing the variable Tenant.Azure.Account within that project to be this account,) and the other account we set up earlier when deploying to targets that aren’t tenants.

You will need to create a new release as the variables (and by extension, the azure account), will be frozen in time of the snapshot that was created when you created the release.

Sorry, this is a little bit confusing for a workaround. Please let me know if that didn’t make sense.

If you can get it implemented please let me know if the workaround gets you unstuck.

Thanks,
Jeremy

Do i also need to specify the account here ? I already specified all the tenants when i created the new azure account .

Hi @vinayak.tillu,

If the variable is within the project itself I don’t think you should need to, but if you want to specify different accounts on a per tenant basis for some reason, you could do it here.

Please let me know if it works.

Thanks,
Jeremy

the variable is within the project but reads from {#tenant.azure.account} and this is set in tenant variables

is it possible for us to connect over a quick 5-min teams / skype / {whatever else you prefer} call and i can show you the setup ?

Hi @vinayak.tillu ,

Lets say your Project was originally configured to use AzureAccountA. You should just need to go to the variables where AzureAccountA was referenced to be used within the project and change it to AzureAccountC(tenanted only azure account). This is assuming your project does not have both Tenanted and Untenanted deployments. If it does, you will need to set the azure account within that tenant variable.

If that doesn’t answer your question please let me know and we can try to set up a quick call.

Thanks,
Jeremy

Hi All,

I just wanted to update this thread with the resolution as it was resolved in private messages.

This issue was due to a bug introduced in 2020.3.1. The issue is resolved in 2020.3.2.

The issue also exists in versions of 2020.2 and is fixed in 2020.2.17, shown here: https://github.com/OctopusDeploy/Issues/issues/6492

1 Like

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