Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Support Logic App Standard #415

Merged
merged 26 commits into from
Nov 21, 2023

Conversation

pim-simons
Copy link
Contributor

Add support for Logic App Standard in our Logic Apps scripts.

Closes #413

@pim-simons pim-simons added feature-request All issues related to feature requests by customers area:logic-apps All issues related to Azure Logic Apps labels Oct 20, 2023
@netlify
Copy link

netlify bot commented Oct 20, 2023

Deploy Preview for arcus-scripting canceled.

Name Link
🔨 Latest commit f5f1ec2
🔍 Latest deploy log https://app.netlify.com/sites/arcus-scripting/deploys/655c620c1bdb4b00081ef3e1

@pim-simons pim-simons marked this pull request as ready for review November 16, 2023 11:57
@pim-simons
Copy link
Contributor Author

I couldn't find a way to implement the prefix stuff we discussed here, since this works really a lot different in Logic App Standard. Might be worth a look later on as an enhancement though.

I split up the documentation pages to Logic App - Consumption and Logic App - Standard as I feel this makes the docs much clearer.

@stijnmoreels
Copy link
Member

I couldn't find a way to implement the prefix stuff we discussed here, since this works really a lot different in Logic App Standard. Might be worth a look later on as an enhancement though.

I split up the documentation pages to Logic App - Consumption and Logic App - Standard as I feel this makes the docs much clearer.

Yes, okay, a big thx for investigating in this and good thinking in splitting this up.
Should we add some redirects to the https://github.com/arcus-azure/arcus.scripting/blob/main/netlify.toml for that best?

@pim-simons
Copy link
Contributor Author

I couldn't find a way to implement the prefix stuff we discussed here, since this works really a lot different in Logic App Standard. Might be worth a look later on as an enhancement though.
I split up the documentation pages to Logic App - Consumption and Logic App - Standard as I feel this makes the docs much clearer.

Yes, okay, a big thx for investigating in this and good thinking in splitting this up. Should we add some redirects to the main/netlify.toml for that best?

I honestly don't really have any knowledge on that toml file, not really sure what it does 😇
I notice that Logic App isn't in the toml file currently?

@stijnmoreels
Copy link
Member

I honestly don't really have any knowledge on that toml file, not really sure what it does 😇 I notice that Logic App isn't in the toml file currently?

That's right. I would believe that we need to add some [redirects] at the end that redirects the previous logic apps version to the standard or consumption now (whatever you find more appropriate and/or recommended to use).

I think these two should be added:

[[redirects]]
  from = "/:version/features/powershell/azure-logic-apps"
  to = "/:version/features/powershell/azure-logic-apps-standard"

[[redirects]]
  from = "/features/powershell/azure-logic-apps"
  to = "/features/powershell/azure-logic-apps-standard"

But I also think that we should only add them when we have a new version of the documentation released, not when they are still in /preview. So I would suggest to create a task for the next version so that we take this up when we release the next version.

@pim-simons
Copy link
Contributor Author

Ah, now I see it. This parameter is also responsible if the implementation is using consumption/standard, right?
Just a thought: this is a bit implicit, it might be a good idea to include Standard/Consumption in the function names? If yes: then we should make sure that we write an deprecated error when the 'old' ones, without the type, are still used.

Yes the WorkflowName parameter determines if the script executes the Consumption or Standard functionality since a workflow only exists in the Logic App Standard. It is a bit implicit, but I did not want to change the names of the scripts as that would break current implementations.

@pim-simons
Copy link
Contributor Author

Yes, my concern is that this was only used for the tests, and that it could potentially be vulnerable. I'm wondering why we need it, though, as the Get-AzCachedAccessToken function already returns the same information? And once it is set, it is not used for assertion, too.

Just tried again and without the $Global:subscriptionId = '123456' the test fails with:

Cannot bind argument to parameter 'SubscriptionId' because it is an empty string.

So I honestly don't really know how else to solve this?

@stijnmoreels
Copy link
Member

Yes the WorkflowName parameter determines if the script executes the Consumption or Standard functionality since a workflow only exists in the Logic App Standard. It is a bit implicit, but I did not want to change the names of the scripts as that would break current implementations.

Yes, that's why I suggested to maybe log a warning for the current module functions and create additional ones with Consumption/Standard? Can be in a follow-up PR.

@stijnmoreels
Copy link
Member

Just tried again and without the $Global:subscriptionId = '123456' the test fails with:

Cannot bind argument to parameter 'SubscriptionId' because it is an empty string.

So I honestly don't really know how else to solve this?

If I read this correctly, we retrieve the $token from the Get-AzCachedAccessToken and pass that value to the next function. Why there would be a 'global' variable accessible outside the script, I don't understand directly?
https://github.com/arcus-azure/arcus.scripting/pull/415/files#diff-da181b2ee5931f86b51b900f462579712ed7a306125dfccf1a2f9ebe14e730baR25

@pim-simons
Copy link
Contributor Author

Integration tests fail due to #416, will look into that asap.

@pim-simons
Copy link
Contributor Author

Yes the WorkflowName parameter determines if the script executes the Consumption or Standard functionality since a workflow only exists in the Logic App Standard. It is a bit implicit, but I did not want to change the names of the scripts as that would break current implementations.

Yes, that's why I suggested to maybe log a warning for the current module functions and create additional ones with Consumption/Standard? Can be in a follow-up PR.

Lets do that in a follow up indeed, than we have a bit more time to look at this 👍🏻

@pim-simons
Copy link
Contributor Author

If I read this correctly, we retrieve the $token from the Get-AzCachedAccessToken and pass that value to the next function. Why there would be a 'global' variable accessible outside the script, I don't understand directly?

I don't really know the background of this script.

What I think happens is that because we Mock the Get-AzCachedAccessToken the global variables are not set.
That is why the $Global:subscriptionId = '123456' is needed.
Does that make sense?

@pim-simons
Copy link
Contributor Author

If I read this correctly, we retrieve the $token from the Get-AzCachedAccessToken and pass that value to the next function. Why there would be a 'global' variable accessible outside the script, I don't understand directly?

I don't really know the background of this script.

What I think happens is that because we Mock the Get-AzCachedAccessToken the global variables are not set. That is why the $Global:subscriptionId = '123456' is needed. Does that make sense?

As discussed, I removed the global variables from the scripts where they were not already present.

Copy link
Member

@stijnmoreels stijnmoreels left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have refactored the script to something smaller, it will be easier to see if we have handled all cases. Thx for the work!

Created these follow-up issues:
#418
#419

Feel free to correct my mistakes in describing them 😉 .

@pim-simons pim-simons merged commit 4624a4e into arcus-azure:main Nov 21, 2023
48 checks passed
@pim-simons pim-simons deleted the feature/logic-app-standard branch November 21, 2023 08:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:logic-apps All issues related to Azure Logic Apps feature-request All issues related to feature requests by customers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

logic app standard support for Azure Logic Apps script
2 participants