-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[Breadth Coverage] logic apps #1423
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
Merged
Merged
Changes from all commits
Commits
Show all changes
42 commits
Select commit
Hold shift + click to select a range
57d3896
WIP: Add autogen code and customy changes for workflow and integratio…
bquantump eef64c8
WIP: Impliment integration account update properly
bquantump 1824ffe
WIP: Update autogen, get test working
bquantump 96ec237
WIP: Update workflow and intergration account names to name, remove u…
bquantump ec74b58
WIP: update help file to match how commands actually should be used
bquantump d8b93e9
Merge branch 'master' into master
bquantump 8c9eb5e
Update test cases to make them more robust. Remove test print statement
bquantump a65912c
Merge branch 'master' into master
bquantump dc7c9b5
Update integration account show test with proper checks
bquantump 7539b43
Merge branch 'master' of https://github.com/bquantump/azure-cli-exten…
bquantump ea4fa96
Update test jsons to match paths of other extensions
bquantump 784634a
Remove some overlooked useless code, update try catch
bquantump 6d4bc1e
Remove elif since raises are called now
bquantump 83aeabc
Remove subscription specfic stuff from workflow.json
bquantump 7dfe858
WIP: New code gen and custom code to handle opaque logic objects and …
bquantump 325ffc3
Cusomize variouse commands and tests
bquantump 8185c5a
remove debug statements
bquantump a9259fe
update recording
bquantump 414165d
Fix up help file
bquantump b5121f6
Merge branch 'master' into master
bquantump 0dd4e11
Fix commands based on comments from PR 1428
bquantump 68fd993
Merge branch 'master' of https://github.com/bquantump/azure-cli-exten…
bquantump 6abf027
Update comments to match dicussion with service team
bquantump 3ff3a91
Regen with logic service team swagger changes
bquantump 8e1b9b6
Add new yaml recording
bquantump 4603792
fix flake 8 linter
bquantump 746c558
More flake 8 fixes
bquantump 292ee02
Fix flake 8 in init
bquantump aa55b10
Fix help files
bquantump fb0ed48
Slight change in help file for create integration account
bquantump 98adc7f
Fix some help for workflow
bquantump 00be4f2
Add codeowner
bquantump 2c3bafe
add msft to codeowner
bquantump 8a2c089
Add github alias
bquantump 5633d6f
Merge branch 'master' into master
7547ee2
Fix PR comments
bquantump 0b684fe
Update setup.py to read README.md
bquantump a4e8b5d
Merge https://github.com/Azure/azure-cli-extensions
bquantump dd767e6
Fix bug based on comments
bquantump bf6df85
Merge branch 'master' of https://github.com/bquantump/azure-cli-exten…
bquantump 343044d
Custom change to support integration-account-sku correctly
bquantump 2d97a78
Flake8
bquantump File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| .. :changelog: | ||
|
|
||
| Release History | ||
| =============== | ||
|
|
||
| 0.1.0 | ||
| ++++++ | ||
| * Initial release. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| # Azure CLI Logic Apps Extension # | ||
| This package is for the 'logic app' extension, i.e. 'az logic'. | ||
| More info on what is [Logic](https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-overview). | ||
|
|
||
| ### How to use ### | ||
| Install this extension using the below CLI command | ||
| ``` | ||
| az extension add --name logic | ||
| ``` | ||
|
|
||
| ### Getting Help | ||
|
|
||
| To see examples of commands and parameters details got commands or command groups, one should run the command of interest with a -h | ||
|
|
||
| Examples: | ||
| ``` | ||
| az logic workflow create -h | ||
|
|
||
| az logic integration-account -h | ||
|
|
||
| az logic worflow update -h | ||
| ``` | ||
|
|
||
|
|
||
| ##### Creating a Logic App | ||
|
|
||
| For creating a logic app, one must provide a logic app definition. | ||
| A definition is a JSON description of a logic app workflow. It is recommended that the logic app designer be used to create this definition, as these definitions can be very complex depending on a workflow. The designed tool works with VS Code, Visual Studio, and Azure Portal: https://docs.microsoft.com/en-us/azure/logic-apps/. | ||
|
|
||
| Access Controls: For a great reference on this see: (https://msftplayground.com/2020/02/managing-access-control-for-logic-apps/) | ||
| An example of how an access control would look is: | ||
|
|
||
| ```json | ||
| "accessControl": { "triggers": | ||
| { "allowedCallerIpAddresses": | ||
| [{ "addressRange": "10.0.0.0/24" }]}, | ||
| "actions": { "allowedCallerIpAddresses": | ||
| [{ "addressRange": "10.0.0.0/24" }]} | ||
| } | ||
| ``` | ||
| ##### Creating an Integration Account | ||
|
|
||
| Integration accounts are a way for Azure Logic Apps to utilize services outside of Azure to integrate into your logic app workflows. See (https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-enterprise-integration-create-integration-account) for more information. | ||
|
|
||
| Integration Service enviroments go hand in hand with a integration account. It is enviroment that connects to your azure vnet for seamless flow of data and logic apps services to on premise enviroments and services. See (https://azure.microsoft.com/en-us/blog/announcing-azure-integration-service-environment-for-logic-apps/) for more information | ||
|
|
||
|
|
||
| #### Import an Integration Account | ||
|
|
||
| You can import an integration account from a JSON file. Run az workflow integration-account import -h to see the parameters. | ||
|
|
||
| An example JSON for import could look like: | ||
|
|
||
| ```json | ||
| {"properties": { | ||
| "state": "Enabled" | ||
| }, | ||
| "sku": { | ||
| "name": "Standard" | ||
| }, | ||
| "location": "centralus" | ||
| } | ||
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| from azure.cli.core import AzCommandsLoader | ||
| from azext_logic.generated._help import helps # pylint: disable=unused-import | ||
|
|
||
|
|
||
| class LogicManagementClientCommandsLoader(AzCommandsLoader): | ||
|
|
||
| def __init__(self, cli_ctx=None): | ||
| from azure.cli.core.commands import CliCommandType | ||
| from azext_logic.generated._client_factory import cf_logic | ||
| logic_custom = CliCommandType( | ||
| operations_tmpl='azext_logic.custom#{}', | ||
| client_factory=cf_logic) | ||
| super(LogicManagementClientCommandsLoader, self).__init__(cli_ctx=cli_ctx, | ||
| custom_command_type=logic_custom) | ||
|
|
||
| def load_command_table(self, args): | ||
| from azext_logic.generated.commands import load_command_table | ||
| load_command_table(self, args) | ||
| try: | ||
| from azext_logic.manual.commands import load_command_table as load_command_table_manual | ||
| load_command_table_manual(self, args) | ||
| except ImportError: | ||
| pass | ||
| return self.command_table | ||
|
|
||
| def load_arguments(self, command): | ||
| from azext_logic.generated._params import load_arguments | ||
| load_arguments(self, command) | ||
| try: | ||
| from azext_logic.manual._params import load_arguments as load_arguments_manual | ||
| load_arguments_manual(self, command) | ||
| except ImportError: | ||
| pass | ||
|
|
||
|
|
||
| COMMAND_LOADER_CLS = LogicManagementClientCommandsLoader |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=wildcard-import | ||
| # pylint: disable=unused-wildcard-import | ||
|
|
||
| from .generated.action import * # noqa: F403 | ||
| try: | ||
| from .manual.action import * # noqa: F403 | ||
| except ImportError: | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| { | ||
| "azext.isExperimental": true, | ||
| "azext.minCliCoreVersion": "2.3.1" | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=wildcard-import | ||
| # pylint: disable=unused-wildcard-import | ||
|
|
||
| from .generated.commands import * # noqa: F403 | ||
| try: | ||
| from .manual.commands import * # noqa: F403 | ||
| except ImportError: | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=wildcard-import | ||
| # pylint: disable=unused-wildcard-import | ||
|
|
||
| from .generated.custom import * # noqa: F403 | ||
| try: | ||
| from .manual.custom import * # noqa: F403 | ||
| except ImportError: | ||
| pass |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| # coding=utf-8 | ||
| # -------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for | ||
| # license information. | ||
| # | ||
| # Code generated by Microsoft (R) AutoRest Code Generator. | ||
| # Changes may cause incorrect behavior and will be lost if the code is | ||
| # regenerated. | ||
| # -------------------------------------------------------------------------- | ||
|
|
||
| __path__ = __import__('pkgutil').extend_path(__path__, __name__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
|
|
||
| def cf_logic(cli_ctx, *_): | ||
| from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
| from ..vendored_sdks.logic import LogicManagementClient | ||
| return get_mgmt_service_client(cli_ctx, LogicManagementClient) | ||
|
|
||
|
|
||
| def cf_workflow(cli_ctx, *_): | ||
| return cf_logic(cli_ctx).workflow | ||
|
|
||
|
|
||
| def cf_integration_account(cli_ctx, *_): | ||
| return cf_logic(cli_ctx).integration_account |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,122 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
| # pylint: disable=line-too-long | ||
| # pylint: disable=too-many-lines | ||
|
|
||
| from knack.help_files import helps | ||
|
|
||
|
|
||
| helps['logic workflow'] = """ | ||
| type: group | ||
| short-summary: logic workflow | ||
| """ | ||
|
|
||
| helps['logic workflow list'] = """ | ||
| type: command | ||
| short-summary: Gets a list of workflows by subscription. | ||
| examples: | ||
| - name: List all workflows in a resource group | ||
| text: |- | ||
| az logic workflow list --resource-group "test_resource_group" | ||
| - name: List all workflows in a subscription | ||
| text: |- | ||
| az logic workflow list | ||
| """ | ||
|
|
||
| helps['logic workflow show'] = """ | ||
| type: command | ||
| short-summary: Gets a workflow. | ||
| examples: | ||
| - name: Get a workflow | ||
| text: |- | ||
| az logic workflow show --resource-group "test_resource_group" --name "test_workflow" | ||
| """ | ||
|
|
||
| helps['logic workflow create'] = """ | ||
| type: command | ||
| short-summary: Creates or updates a workflow using a JSON file for the defintion. | ||
| examples: | ||
| - name: Create or update a workflow | ||
| text: |- | ||
| az logic workflow create --resource-group "test_resource_group" --location "centralus" --name "test_workflow" --definition "workflow.json" | ||
bquantump marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| helps['logic workflow update'] = """ | ||
| type: command | ||
| short-summary: Updates a workflow. | ||
| examples: | ||
| - name: Patch a workflow | ||
| text: |- | ||
| az logic workflow update --resource-group "test_resource_group" --definition workflow.json --name "test_workflow" | ||
| """ | ||
|
|
||
| helps['logic workflow delete'] = """ | ||
| type: command | ||
| short-summary: Deletes a workflow. | ||
| examples: | ||
| - name: Delete a workflow | ||
| text: |- | ||
| az logic workflow delete --resource-group "test_resource_group" --name "test_workflow" | ||
| """ | ||
|
|
||
| helps['logic integration-account'] = """ | ||
| type: group | ||
| short-summary: logic integration-account | ||
| """ | ||
|
|
||
| helps['logic integration-account list'] = """ | ||
| type: command | ||
| short-summary: Gets a list of integration accounts by subscription. | ||
| examples: | ||
| - name: List integration accounts by resource group name | ||
| text: |- | ||
| az logic integration-account list --resource-group "test_resource_group" | ||
| """ | ||
|
|
||
| helps['logic integration-account show'] = """ | ||
| type: command | ||
| short-summary: Gets an integration account. | ||
| examples: | ||
| - name: Get integration account by name | ||
| text: |- | ||
| az logic integration-account show --name "test_integration_account" --resource-group "test_resource_group" | ||
| """ | ||
|
|
||
| helps['logic integration-account create'] = """ | ||
| type: command | ||
| short-summary: Creates or updates an integration account. | ||
| examples: | ||
| - name: Create or update an integration account | ||
| text: |- | ||
| az logic integration-account create --location "centralus" --sku name=Standard --name "test_integration_account" --resource-group "test_resource_group" | ||
bquantump marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| helps['logic integration-account update'] = """ | ||
| type: command | ||
| short-summary: Updates an integration account. | ||
| examples: | ||
| - name: Patch an integration account | ||
| text: |- | ||
| az logic integration-account update --sku name=Basic --tag atag=123 --name "test_integration_account" --resource-group "test_resource_group" | ||
| """ | ||
|
|
||
|
|
||
| helps['logic integration-account import'] = """ | ||
| type: command | ||
| short-summary: Import an integration account from a JSON file. | ||
| examples: | ||
| - name: Import an integration account. | ||
| text: |- | ||
| az logic integration-account import --name "test_integration_account" --resource-group "test_resource_group" --input-path "integration.json" | ||
bquantump marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| """ | ||
|
|
||
| helps['logic integration-account delete'] = """ | ||
| type: command | ||
| short-summary: Deletes an integration account. | ||
| examples: | ||
| - name: Delete an integration account | ||
| text: |- | ||
| az logic integration-account delete --name "test_integration_account" --resource-group "test_resource_group" | ||
| """ | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.