-
Notifications
You must be signed in to change notification settings - Fork 316
Add azure.logicappsstandard extension #8005
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
Open
ronaldbosma
wants to merge
38
commits into
Azure:main
Choose a base branch
from
ronaldbosma:add-logicappsstandard-extension
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,705
−0
Open
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
a79b5eb
Add Azure Logic Apps Standard extension
ronaldbosma 252f1a7
Fix usage value in extension
ronaldbosma 4a128a8
Update readme for azure.logicappsstandard extension
ronaldbosma d35ff9c
Fix README formatting and add troubleshooting section for Logic Apps …
ronaldbosma 6d0360e
Remove version from azure.logicappsstandard root.go
ronaldbosma 57efa28
Update change log for azure.logicappsstandard
ronaldbosma 978621c
Add workflow to lint azure.logicappsstandard extension
ronaldbosma 1cede8f
Add release pipeline for azure.logicappsstandard extension
ronaldbosma 75df09c
Revert "Remove version from azure.logicappsstandard root.go"
ronaldbosma 1818f47
Use t.Context() instead of context.Background() in logicappsstandard …
ronaldbosma 7ca22d7
Cleanup dependencies for azure.logicappsstandard extension
ronaldbosma b007919
Fix typo in azure.logicappsstandard changelog
ronaldbosma 13d9953
Update cli/azd/extensions/azure.logicappsstandard/main.go
ronaldbosma 2f0a19d
Remove 'packaging' from LogicAppsStandardFrameworkServiceProvider name
ronaldbosma ec0db87
Fix linting issues
ronaldbosma 00a128f
Refactor test setup by introducing createFakeDotnetStub for cross-pla…
ronaldbosma 60a2e6e
Clarify comment on packaging to specify host-specific ignore file usage
ronaldbosma b7e7f68
Remove use of fmt.Printf from LogicAppsStandardFrameworkServiceProvid…
ronaldbosma 66e5baa
Add CI scripts
ronaldbosma 0750e8e
Add golangci-lint config file for azure.logicappsstandard
ronaldbosma 84e7d70
Fix and suppress linting rules for tests in azure.logicappsstandard
ronaldbosma ba0dd99
Introduce version.go file for azure.logicappsstandard
ronaldbosma eceb966
Update ci scripts for logicappsstandard based on ai.finetune extension
ronaldbosma dc1349f
Update build scripts to target azure.logicappsstandard/internal/version
ronaldbosma d977ea8
Make azurelogicappsstandard module consistent with other extensions
ronaldbosma d8ef69f
Add pell checker config file to azure.logicappsstandard
ronaldbosma 1cfb2a0
Fix azurelogicappsstandard imports because . was removed
ronaldbosma 9f9b11e
Add azurelogicappsstandard to words for azure.logicappsstandard
ronaldbosma 4c326f5
Implement path resolution validation for custom code projects in Logi…
ronaldbosma 7fb1244
Add nil checks and error handling for custom code project properties
ronaldbosma e1a8531
Add documentation for NewRootCommand and NewLogicAppsStandardFramewor…
ronaldbosma f187549
Fix path to version module in build scripts
ronaldbosma 8ced4d7
Improve comment about what's packaged
ronaldbosma 77b36cc
Add designtime as word to cspell config azure.logicappsstandard
ronaldbosma fce7409
Use lowercase for service name and folder in azure.logicappsstandard …
ronaldbosma 99f6f7b
Add logicapp as word to cspell config azure.logicappsstandard extension
ronaldbosma eed4e03
Require host to be 'function' when using language 'logicappsstandard'…
ronaldbosma d782cb0
Update to azd v1.25.1 in azure.logicappsstandard extension
ronaldbosma 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: ext-azure-logicappsstandard-ci | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "cli/azd/extensions/azure.logicappsstandard/**" | ||
| - ".github/workflows/lint-ext-azure-logicappsstandard.yml" | ||
| branches: [main] | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| lint: | ||
| uses: ./.github/workflows/lint-go.yml | ||
| with: | ||
| working-directory: cli/azd/extensions/azure.logicappsstandard | ||
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,17 @@ | ||
| version: "2" | ||
|
|
||
| linters: | ||
| default: none | ||
| enable: | ||
| - gosec | ||
| - lll | ||
| - unused | ||
| - errorlint | ||
| settings: | ||
| lll: | ||
| line-length: 220 | ||
| tab-width: 4 | ||
|
|
||
| formatters: | ||
| enable: | ||
| - gofmt |
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,5 @@ | ||
| # Release History | ||
|
|
||
| ## 0.0.1 | ||
|
|
||
| - Initial release with support for packaging Logic App Standard projects via `language: logicappsstandard` in `azure.yaml`, and optional custom code projects using `customCodeProject` property. |
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,155 @@ | ||
| # Azure Logic Apps Standard extension | ||
|
|
||
| This azd extension makes it possible to package Logic Apps Standard projects and includes support for custom code projects. | ||
|
|
||
|
|
||
| ## Installing | ||
|
|
||
| Assuming 'azd' is in your path, run the following commands to install the extension for the first time: | ||
|
|
||
| ```shell | ||
| azd ext install azure.logicappsstandard | ||
| ``` | ||
|
|
||
| Or, if you already have the `azure.logicappsstandard` extension installed, and you want to upgrade to the latest version: | ||
|
|
||
| ```shell | ||
| azd ext upgrade azure.logicappsstandard | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| This extension introduces the `logicappsstandard` language which can package Logic Apps Standard projects. | ||
|
|
||
| For example, if your template has a Logic App Standard project with the following structure: | ||
|
|
||
| ``` | ||
| └── src | ||
| └── logicapp | ||
| ├── .vscode | ||
| ├── artifacts | ||
| ├── lib | ||
| ├── workflow1 | ||
| │ └── workflow.json | ||
| ├── workflow2 | ||
| │ └── workflow.json | ||
| ├── workflow-designtime | ||
| ├── .funcignore | ||
| ├── .gitignore | ||
| ├── host.json | ||
| └── local.settings.json | ||
| ``` | ||
|
|
||
| Use the following snippet in your `azure.yaml` file to configure the Logic App: | ||
|
|
||
| ```yaml | ||
| services: | ||
| logicapp: | ||
| project: ./src/logicapp | ||
| host: function | ||
| language: logicappsstandard | ||
| ``` | ||
|
|
||
| This will package everything under the `src/logicapp` folder in a .zip file. Because `function` is used as the host, the exclusions in `.funcignore` are respected and only the relevant files are packaged. | ||
|
|
||
| The extension also supports Logic App Standard projects with a .NET 8 or .NET Framework custom code project. For example, if your template has a Logic App Standard project with custom code project following this structure: | ||
|
|
||
| ``` | ||
| └── src | ||
| └── logicapp | ||
| ├── Functions | ||
| │ ├── MyFunctions.cs | ||
| │ ├── Functions.csproj | ||
| │ └── ... | ||
| └── Workflows | ||
| ├── workflow1 | ||
| │ └── workflow.json | ||
| ├── workflow2 | ||
| │ └── workflow.json | ||
| ├── host.json | ||
| └── ... | ||
| ``` | ||
|
|
||
| You can use the following snippet in your `azure.yaml` file to configure the Logic App: | ||
|
|
||
| ```yaml | ||
| services: | ||
| logicapp: | ||
| project: ./src/logicapp | ||
| dist: Workflows | ||
| host: function | ||
| language: logicappsstandard | ||
| customCodeProject: Functions/Functions.csproj | ||
| ``` | ||
|
|
||
| This will first build the custom code project and then package the Logic App Standard artifacts. | ||
|
|
||
| > [!NOTE] | ||
| > When using `customCodeProject`, make sure the required build toolchain is installed: .NET 8 SDK for .NET 8 projects, or .NET Framework/MSBuild tools for .NET Framework projects. | ||
|
|
||
| - The `project` property contains the root folder of the Logic App Standard project. | ||
| - The `dist` property is the relative path to the folder with the Logic App Standard files that will be packaged. | ||
| - The `customCodeProject` property is the path to the custom code project's `.csproj` file. | ||
|
|
||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Language 'logicappsstandard' is not supported | ||
|
|
||
| If you see the following error while packaging a Logic App Standard project, azd could not find an installed extension that provides the `logicappsstandard` language. Make sure to install the `azure.logicappsstandard` extension. | ||
|
|
||
| ``` | ||
| ERROR: initializing service '...', getting framework service: language 'logicappsstandard' is not supported by built-in framework services and no extensions are currently providing it | ||
| ``` | ||
|
|
||
| ## Local Development | ||
|
|
||
| ### Prerequisites | ||
|
|
||
| 1. **Install developer kit extension** (if not already installed): | ||
| ```bash | ||
| azd ext install microsoft.azd.extensions | ||
| ``` | ||
|
|
||
| > **Note**: If you encounter an error about the extension not being in the registry, verify you have the default source configured: | ||
| > ```bash | ||
| > azd ext source list | ||
| > ``` | ||
| > If missing, add it: | ||
| > ```bash | ||
| > azd ext source add -n azd -t url -l "https://aka.ms/azd/extensions/registry" | ||
| > ``` | ||
|
|
||
| ### Building and Installing | ||
|
|
||
| 1. **Navigate to the extension directory**: | ||
| ```bash | ||
| cd cli/azd/extensions/azure.logicappsstandard | ||
| ``` | ||
|
|
||
| 2. **Initial setup** (first time only): | ||
| ```bash | ||
| azd x build | ||
| azd x pack | ||
| azd x publish | ||
| ``` | ||
|
|
||
| 3. **Install the extension**: | ||
| ```bash | ||
| azd ext install azure.logicappsstandard | ||
| ``` | ||
|
|
||
| 4. **For subsequent development** (after initial setup): | ||
| ```bash | ||
| azd x watch | ||
| ``` | ||
| This automatically watches for file changes, rebuilds, and installs updates locally. | ||
|
|
||
| Or for manual builds: | ||
| ```bash | ||
| azd x build | ||
| ``` | ||
| This builds and automatically installs the updated extension. | ||
|
|
||
| > [!NOTE] | ||
| > The `pack` and `publish` steps are only required for the first time setup. For ongoing development, `azd x watch` or `azd x build` handles all updates automatically. |
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,78 @@ | ||
| # Ensure script fails on any error | ||
| $ErrorActionPreference = 'Stop' | ||
|
|
||
| # Get the directory of the script | ||
| $EXTENSION_DIR = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
|
|
||
| # Change to the script directory | ||
| Set-Location -Path $EXTENSION_DIR | ||
|
|
||
| # Create a safe version of EXTENSION_ID replacing dots with dashes | ||
| $EXTENSION_ID_SAFE = $env:EXTENSION_ID -replace '\.', '-' | ||
|
|
||
| # Define output directory | ||
| $OUTPUT_DIR = if ($env:OUTPUT_DIR) { $env:OUTPUT_DIR } else { Join-Path $EXTENSION_DIR "bin" } | ||
|
|
||
| # Create output directory if it doesn't exist | ||
| if (-not (Test-Path -Path $OUTPUT_DIR)) { | ||
| New-Item -ItemType Directory -Path $OUTPUT_DIR | Out-Null | ||
| } | ||
|
|
||
| # Get Git commit hash and build date | ||
| $COMMIT = git rev-parse HEAD | ||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "Error: Failed to get git commit hash" | ||
| exit 1 | ||
| } | ||
| $BUILD_DATE = (Get-Date -Format "yyyy-MM-ddTHH:mm:ssZ") | ||
|
|
||
| # List of OS and architecture combinations | ||
| if ($env:EXTENSION_PLATFORM) { | ||
| $PLATFORMS = @($env:EXTENSION_PLATFORM) | ||
| } | ||
| else { | ||
| $PLATFORMS = @( | ||
| "windows/amd64", | ||
| "windows/arm64", | ||
| "darwin/amd64", | ||
| "darwin/arm64", | ||
| "linux/amd64", | ||
| "linux/arm64" | ||
| ) | ||
| } | ||
|
|
||
| $VERSION_PATH = "azurelogicappsstandard/internal/version" | ||
|
|
||
| # Loop through platforms and build | ||
| foreach ($PLATFORM in $PLATFORMS) { | ||
| $OS, $ARCH = $PLATFORM -split '/' | ||
|
|
||
| $OUTPUT_NAME = Join-Path $OUTPUT_DIR "$EXTENSION_ID_SAFE-$OS-$ARCH" | ||
|
|
||
| if ($OS -eq "windows") { | ||
| $OUTPUT_NAME += ".exe" | ||
| } | ||
|
|
||
| Write-Host "Building for $OS/$ARCH..." | ||
|
|
||
| # Delete the output file if it already exists | ||
| if (Test-Path -Path $OUTPUT_NAME) { | ||
| Remove-Item -Path $OUTPUT_NAME -Force | ||
| } | ||
|
|
||
| # Set environment variables for Go build | ||
| $env:GOOS = $OS | ||
| $env:GOARCH = $ARCH | ||
|
|
||
| go build ` | ||
| -ldflags="-X '$VERSION_PATH.Version=$env:EXTENSION_VERSION' -X '$VERSION_PATH.Commit=$COMMIT' -X '$VERSION_PATH.BuildDate=$BUILD_DATE'" ` | ||
| -o $OUTPUT_NAME | ||
|
|
||
| if ($LASTEXITCODE -ne 0) { | ||
| Write-Host "An error occurred while building for $OS/$ARCH" | ||
| exit 1 | ||
| } | ||
| } | ||
|
|
||
| Write-Host "Build completed successfully!" | ||
| Write-Host "Binaries are located in the $OUTPUT_DIR directory." |
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,66 @@ | ||
| #!/bin/bash | ||
|
|
||
| # Get the directory of the script | ||
| EXTENSION_DIR="$(cd "$(dirname "$0")" && pwd)" | ||
|
|
||
| # Change to the script directory | ||
| cd "$EXTENSION_DIR" || exit | ||
|
|
||
| # Create a safe version of EXTENSION_ID replacing dots with dashes | ||
| EXTENSION_ID_SAFE="${EXTENSION_ID//./-}" | ||
|
|
||
| # Define output directory | ||
| OUTPUT_DIR="${OUTPUT_DIR:-$EXTENSION_DIR/bin}" | ||
|
|
||
| # Create output and target directories if they don't exist | ||
| mkdir -p "$OUTPUT_DIR" | ||
|
|
||
| # Get Git commit hash and build date | ||
| COMMIT=$(git rev-parse HEAD) | ||
| BUILD_DATE=$(date -u +%Y-%m-%dT%H:%M:%SZ) | ||
|
|
||
| # List of OS and architecture combinations | ||
| if [ -n "$EXTENSION_PLATFORM" ]; then | ||
| PLATFORMS=("$EXTENSION_PLATFORM") | ||
| else | ||
| PLATFORMS=( | ||
| "windows/amd64" | ||
| "windows/arm64" | ||
| "darwin/amd64" | ||
| "darwin/arm64" | ||
| "linux/amd64" | ||
| "linux/arm64" | ||
| ) | ||
| fi | ||
|
|
||
| VERSION_PATH="azurelogicappsstandard/internal/version" | ||
|
|
||
| # Loop through platforms and build | ||
| for PLATFORM in "${PLATFORMS[@]}"; do | ||
| OS=$(echo "$PLATFORM" | cut -d'/' -f1) | ||
| ARCH=$(echo "$PLATFORM" | cut -d'/' -f2) | ||
|
|
||
| OUTPUT_NAME="$OUTPUT_DIR/$EXTENSION_ID_SAFE-$OS-$ARCH" | ||
|
|
||
| if [ "$OS" = "windows" ]; then | ||
| OUTPUT_NAME+='.exe' | ||
| fi | ||
|
|
||
| echo "Building for $OS/$ARCH..." | ||
|
|
||
| # Delete the output file if it already exists | ||
| [ -f "$OUTPUT_NAME" ] && rm -f "$OUTPUT_NAME" | ||
|
|
||
| # Set environment variables for Go build | ||
| GOOS=$OS GOARCH=$ARCH go build \ | ||
| -ldflags="-X '$VERSION_PATH.Version=$EXTENSION_VERSION' -X '$VERSION_PATH.Commit=$COMMIT' -X '$VERSION_PATH.BuildDate=$BUILD_DATE'" \ | ||
| -o "$OUTPUT_NAME" | ||
|
ronaldbosma marked this conversation as resolved.
|
||
|
|
||
| if [ $? -ne 0 ]; then | ||
| echo "An error occurred while building for $OS/$ARCH" | ||
| exit 1 | ||
| fi | ||
| done | ||
|
|
||
| echo "Build completed successfully!" | ||
| echo "Binaries are located in the $OUTPUT_DIR directory." | ||
Oops, something went wrong.
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.