Run Azure Powershell script account

Hello,

I have created an Azure Powershell step template. I have added a paramater called ‘ServiceAccount’ that is a type ‘Azure Account’. I have bound the Account under the step tab to the paramater ServiceAccount, however when i try to run it there are no accounts to choose from. If i unbind the account in the step tamplate I can select an account, however I need to run the script across multiple account (dev/production).

Is this a bug?

Thanks

Scott

Hi Scott,

Thanks for getting in touch! I’m unable to determine precisely what’s causing this issue, or if it’s a bug (though it seems to work as expected in my testing, but I may be misinterpreting something). Would you be willing to elaborate a bit further and send some screenshots showing the step template and Azure Account variable configurations? This will help me better understand your scenario and give it a test as you have it setup. :slight_smile:

I look forward to hearing back and getting to the bottom of this one!

Best regards,

Kenny

Hi Kenny,

Thanks for looking.

This is the step template. As you can see all the accounts are there when I select an account under the step

However this will only one against one account. I need to use this for dev and production so I need to pass it in as a parameter:

It is now bound to the ServiceAccount parameter which is a type of AzureAccount. However when I use it in the process or test it I get:

Nothing to select.

Thanks

Scott

Hi Scott,

Many thanks for following up and expanding on your setup. Do you have Azure Account variables set up in your project (either as project variables or variables in a set)? These variables will populate the dropdown when viewing it as part of the project’s deployment process, whereas all Azure Accounts in Octopus will be shown when viewing the dropdown as part of the custom step template in the library (as these are global).

We have some additional information about these variables in the following documentation page.

I hope that helps! Let me know if you have any further questions or concerns going forward.

Best regards,

Kenny

Hi Kenny,

Yes that populates it. Thanks for your help

Scott

HI Kenny,

I have just tried setting this up and now I am getting this:

There is a variable called AzureAccount:

And the step is set up like this:

Thanks

Scott

Hi Kenny,

Any update on this? Can you confirm if it’s a bug or not please?

Thanks

Scott

Hi Scott,

Thanks for following up, and my sincere apologies about the delay in getting back to you. I unfortunately didn’t see your messages come through and only saw as a result of the GitHub issue you linked this thread in.

I’ve been able to reproduce this behavior, and sure enough it’s a bug as it seems to be searching for the variable name instead of the Azure Account name when attempting to deploy. I’ve raised this issue at the following link for you to track.

I was able to work around this by renaming my variable to match the Azure Account ID exactly and then updating the binding in the step template to match this variable name change. You can get the Azure Account ID in the URL when viewing the account in the web portal. The ID is after the /accounts/ in the URL as I’ve highlighted below.

We’ve had recent reports of a bug that is very similar (and maybe has the exact same root cause). I can’t confirm at this stage if it’s an exact match, but it may only require upgrading to 2019.7.0 once it’s shipped as that will include the fix to that bug. You can reference that issue here.

I’m going to attempt to reproduce this once again when 2019.7.0 is available and I’ll let you know the outcome.

I’m very sorry again for the lack of communication on my part, and I’ve bookmarked this thread to ensure it won’t happen again.

Best regards,

Kenny

HI Kenneth,

No problems. The main thing is the bug has been identified and will get fixed as its causing me some headaches at the moment!

Thanks for your help

Scott

1 Like

Hi Kenny,

Just to let you know I have just upgraded to 2019.7.0 and the issue is still happening. Do you think this will be fixed as a priority? I cant use the work around below as I need to choose the service
account based on environment.

Thanks

Scott

: Kenneth Bates via Octopus Deploy support@octopus.com

Hi Scott,

I’m very sorry for the delay in getting back to you on this one. I got your email and just wanted to message here as well in case you see it sooner. Both issues (5674 and 5620) have been given priority and fixes for both of them should be completed in the next couple of days. I’ll message you directly here as soon as we ship a version that includes the bug fixes.

Best regards,

Kenny

Hi Kenny,

Any update? I can see they haven’t been assigned a milestone yet.

Thanks

Scott

Hi Scott,

Thanks for following up. I’m sorry about the lack of an update here. Unfortunately this issue hasn’t been fixed yet but we’re still treating it with priority and it’s being worked on this week. I’ll reach out to you directly once we ship the fix for it. My sincere apologies about the wait on this one.

Best regards,

Kenny

Hi Kenny,

Any update on this again please?

Thanks

Scott

Hi Scott,

Thanks for following up, and I’m sorry that this has taken longer than we anticipated.The current status of issue #5674 is that there’s currently a PR to fix this that has been approved and passed, so it looks like it’s quite close to being shipped. The issue will be updated with a milestone once it’s been merged. My apologies again about the delay here, and please don’t hesitate to reach out if you have any questions or concerns moving forward.

Best regards,

Kenny

Hey Scott,

Just a quick update to let you know this bug has been fixed in 2019.7.10 which has been shipped. Thank you for your patience on this one!

Best regards,

Kenny

Hi Kenny,

I can confirm the fix is working. I have installed 7.10 and it now accepts the azure account as a variable. Thanks for the escalations, you have saved me multiple manual steps for a release!

Thanks

Scott

1 Like

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