-
Notifications
You must be signed in to change notification settings - Fork 341
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
56
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,776
−0
Open
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
7fc0490
Add Azure Logic Apps Standard extension
ronaldbosma f1c9711
Fix usage value in extension
ronaldbosma 9ed27d4
Update readme for azure.logicappsstandard extension
ronaldbosma 41c4a00
Fix README formatting and add troubleshooting section for Logic Apps …
ronaldbosma 6a63e34
Remove version from azure.logicappsstandard root.go
ronaldbosma 5224832
Update change log for azure.logicappsstandard
ronaldbosma f9c0516
Add workflow to lint azure.logicappsstandard extension
ronaldbosma 2fe531b
Add release pipeline for azure.logicappsstandard extension
ronaldbosma 2c5af2b
Revert "Remove version from azure.logicappsstandard root.go"
ronaldbosma ea346aa
Use t.Context() instead of context.Background() in logicappsstandard …
ronaldbosma 50e5356
Cleanup dependencies for azure.logicappsstandard extension
ronaldbosma 86ced4d
Fix typo in azure.logicappsstandard changelog
ronaldbosma fc6795d
Update cli/azd/extensions/azure.logicappsstandard/main.go
ronaldbosma 0fbb90d
Remove 'packaging' from LogicAppsStandardFrameworkServiceProvider name
ronaldbosma 6ddc20b
Fix linting issues
ronaldbosma 7af0944
Refactor test setup by introducing createFakeDotnetStub for cross-pla…
ronaldbosma 5d37560
Clarify comment on packaging to specify host-specific ignore file usage
ronaldbosma e106b62
Remove use of fmt.Printf from LogicAppsStandardFrameworkServiceProvid…
ronaldbosma a607c93
Add CI scripts
ronaldbosma 217e768
Add golangci-lint config file for azure.logicappsstandard
ronaldbosma b277927
Fix and suppress linting rules for tests in azure.logicappsstandard
ronaldbosma 421f6b0
Introduce version.go file for azure.logicappsstandard
ronaldbosma 6af82fa
Update ci scripts for logicappsstandard based on ai.finetune extension
ronaldbosma 567827f
Update build scripts to target azure.logicappsstandard/internal/version
ronaldbosma c48bfd6
Make azurelogicappsstandard module consistent with other extensions
ronaldbosma 5d05fb0
Add pell checker config file to azure.logicappsstandard
ronaldbosma e0a7d65
Fix azurelogicappsstandard imports because . was removed
ronaldbosma 0e13447
Add azurelogicappsstandard to words for azure.logicappsstandard
ronaldbosma 9e15590
Implement path resolution validation for custom code projects in Logi…
ronaldbosma 53b7cbd
Add nil checks and error handling for custom code project properties
ronaldbosma 0440a8b
Add documentation for NewRootCommand and NewLogicAppsStandardFramewor…
ronaldbosma c48e05a
Fix path to version module in build scripts
ronaldbosma 3d7250e
Improve comment about what's packaged
ronaldbosma 4655438
Add designtime as word to cspell config azure.logicappsstandard
ronaldbosma 28c6794
Use lowercase for service name and folder in azure.logicappsstandard …
ronaldbosma 134207f
Add logicapp as word to cspell config azure.logicappsstandard extension
ronaldbosma 1336aff
Require host to be 'function' when using language 'logicappsstandard'…
ronaldbosma 146ba48
Update to azd v1.25.1 in azure.logicappsstandard extension
ronaldbosma 4a53563
Add trailing new line to azure.logicapsstandard changelog
ronaldbosma ff0fb8f
Merge branch 'main' into add-logicappsstandard-extension
ronaldbosma bafd039
Always require restore and build for logicappstandard services.
ronaldbosma c6d7be1
Add explicit test to check that initialize succeeds without comstCode…
ronaldbosma 86a8ec3
Update dependencies of azure.logicappsstandard extension
ronaldbosma a05f6e9
Return error for logicappsstandard service when custom code project i…
ronaldbosma 75cbaa2
Change version to 0.1.0
ronaldbosma 966e7b6
Update release-ext-azure-logicappsstandard.yml to match release-ext-m…
ronaldbosma 1227f4a
Have azure.logicapsstandard required azd 1.28.0 or higher
ronaldbosma 54f9296
Merge branch 'main' into add-logicappsstandard-extension
ronaldbosma 2b90327
Remove pipeline triggers on root go.mod and fix path to release-azd-e…
ronaldbosma 07bfd8f
Update azd dependency to 1.28.1 for azure.logicapsstandard extension
ronaldbosma 78f5ef0
fix: enhance error handling in runDotNet function to include command …
ronaldbosma d47a7a4
Fix comment on runDotNet function in azure.logicappsstandard extensio…
ronaldbosma 487d8a6
Merge branch 'main' into add-logicappsstandard-extension
ronaldbosma 8d663d6
Fix createFakeDotnetStub for azure.logicappsstandard tests so it work…
ronaldbosma 9db773a
Add quotes to the createFakeDotnetStub stub so it works even if temp …
ronaldbosma 82e97bb
Add missing trailing newline files of 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
Some comments aren't visible on the classic Files Changed page.
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.1.0 | ||
|
|
||
| - 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.