From 1c28afd2df73799caf07e7aefc97d72e805de824 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Thu, 19 Feb 2026 15:38:19 -0800 Subject: [PATCH 1/8] chore: kiota is now downloaded from nuget rather than built locally during pipeline --- .azure-pipelines/generation-pipeline.yml | 6 ------ .../build-and-publish-kiota.yml | 17 +++-------------- .../generation-templates/download-kiota.yml | 5 ----- .../language-generation-kiota.yml | 2 +- .../set-up-for-generation-kiota.yml | 5 ++++- 5 files changed, 8 insertions(+), 27 deletions(-) delete mode 100644 .azure-pipelines/generation-templates/download-kiota.yml diff --git a/.azure-pipelines/generation-pipeline.yml b/.azure-pipelines/generation-pipeline.yml index 39280ede9..cf9d1baa6 100644 --- a/.azure-pipelines/generation-pipeline.yml +++ b/.azure-pipelines/generation-pipeline.yml @@ -97,10 +97,6 @@ resources: type: github endpoint: microsoftgraph (22) name: microsoftgraph/microsoft-graph-docs - - repository: kiota - type: github - endpoint: microsoftkiota - name: microsoft/kiota - repository: Agents-M365Copilot type: github endpoint: microsoftkiota @@ -175,8 +171,6 @@ extends: parameters: sdl: sourceRepositoriesToScan: - include: - - repository: kiota exclude: - repository: msgraph-sdk-dotnet - repository: msgraph-beta-sdk-dotnet diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 1a5a996a1..90a52a2b5 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -1,18 +1,7 @@ steps: - template: /.azure-pipelines/generation-templates/use-dotnet-sdk.yml@self parameters: - version: "10.x" #kiota uses a net10 target + version: "10.x" -- checkout: kiota - displayName: checkout kiota - fetchDepth: 1 - -- pwsh: dotnet build $(Build.SourcesDirectory)/src/kiota/kiota.csproj --configuration $(buildConfiguration) - displayName: 'Build Kiota' - -- task: CopyFiles@2 - inputs: - sourceFolder: '$(Build.SourcesDirectory)/src/kiota/bin/$(BuildConfiguration)/net10.0' - contents: '**/*' - targetFolder: '$(Build.ArtifactStagingDirectory)' - displayName: Copy Kiota executable \ No newline at end of file +- bash: dotnet tool install Microsoft.OpenApi.Kiota --tool-path $(Build.ArtifactStagingDirectory) + displayName: 'Install latest Kiota from NuGet' diff --git a/.azure-pipelines/generation-templates/download-kiota.yml b/.azure-pipelines/generation-templates/download-kiota.yml deleted file mode 100644 index 3ec33e096..000000000 --- a/.azure-pipelines/generation-templates/download-kiota.yml +++ /dev/null @@ -1,5 +0,0 @@ -# This Yaml Document has been converted by ESAI Yaml Pipeline Conversion Tool. -# Please make sure to check all the converted content, it is your team's responsibility to make sure that the pipeline is still valid and functions as expected. -# The 'DownloadBuildArtifacts@0' tasks have been converted to inputs within the `templateContext` section of each job. -steps: -- bash: chmod +x $(Build.SourcesDirectory)/kiota/kiota \ No newline at end of file diff --git a/.azure-pipelines/generation-templates/language-generation-kiota.yml b/.azure-pipelines/generation-templates/language-generation-kiota.yml index aedeb6c82..847fda7b0 100644 --- a/.azure-pipelines/generation-templates/language-generation-kiota.yml +++ b/.azure-pipelines/generation-templates/language-generation-kiota.yml @@ -96,7 +96,7 @@ steps: Write-Warning "Kiota directory not found: $(kiotaDirectory)" } displayName: 'List files in Kiota directory' -- pwsh: '& "$(kiotaDirectory)/kiota.exe" generate --openapi "$(Build.SourcesDirectory)/msgraph-metadata/${{ parameters.cleanMetadataFolder }}/openapi.yaml" --language "${{ parameters.language }}" -o "$(kiotaDirectory)/output" -n "${{ parameters.targetNamespace }}" -c "${{ parameters.targetClassName }}" ${{ parameters.customArguments }} ${{ parameters.pathExclusionArguments }}' +- pwsh: '& "$(kiotaDirectory)/kiota" generate --openapi "$(Build.SourcesDirectory)/msgraph-metadata/${{ parameters.cleanMetadataFolder }}/openapi.yaml" --language "${{ parameters.language }}" -o "$(kiotaDirectory)/output" -n "${{ parameters.targetNamespace }}" -c "${{ parameters.targetClassName }}" ${{ parameters.customArguments }} ${{ parameters.pathExclusionArguments }}' displayName: 'Run Kiota for ${{ parameters.language }} ${{ parameters.version }}' env: KIOTA_GENERATION:EXPORTPUBLICAPI: ${{ parameters.exportDom }} diff --git a/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml b/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml index 980cad008..91682461c 100644 --- a/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml +++ b/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml @@ -6,7 +6,10 @@ steps: - template: /.azure-pipelines/generation-templates/set-user-config.yml@self - template: /.azure-pipelines/generation-templates/use-dotnet-sdk.yml@self parameters: - version: "10.x" #kiota uses a net10 target + version: "10.x" + +- bash: chmod +x $(kiotaDirectory)/kiota + displayName: 'Make Kiota executable' # checkout metadata repo if capture and clean step is skipped - checkout: msgraph-metadata From 3eef546c9ebbb3862f8e4360447cc7feb65bf13b Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 20 Feb 2026 00:29:27 -0800 Subject: [PATCH 2/8] download binaries from github releases --- .../generation-templates/build-and-publish-kiota.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 90a52a2b5..3a34ede19 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -1,7 +1,7 @@ steps: -- template: /.azure-pipelines/generation-templates/use-dotnet-sdk.yml@self - parameters: - version: "10.x" - -- bash: dotnet tool install Microsoft.OpenApi.Kiota --tool-path $(Build.ArtifactStagingDirectory) - displayName: 'Install latest Kiota from NuGet' +- bash: | + LATEST_TAG=$(curl -sL -o /dev/null -w "%{url_effective}" "https://github.com/microsoft/kiota/releases/latest" | rev | cut -d'/' -f1 | rev) + echo "Downloading Kiota $LATEST_TAG" + curl -L "https://github.com/microsoft/kiota/releases/download/${LATEST_TAG}/linux-x64.zip" -o kiota.zip + unzip kiota.zip -d $(Build.ArtifactStagingDirectory) + displayName: 'Download latest Kiota from GitHub' From 009eca402008aaad8caa1b29e3b28a688888bbec Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 20 Feb 2026 12:22:46 -0800 Subject: [PATCH 3/8] get kiota binary download link --- .../build-and-publish-kiota.yml | 13 ++++++++++--- submodules/vipr | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 3a34ede19..6b3dfde7d 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -1,7 +1,14 @@ steps: - bash: | - LATEST_TAG=$(curl -sL -o /dev/null -w "%{url_effective}" "https://github.com/microsoft/kiota/releases/latest" | rev | cut -d'/' -f1 | rev) + RELEASE_JSON=$(curl -s "https://api.github.com/repos/microsoft/kiota/releases/latest") + LATEST_TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name') + ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("linux-x64")) | .browser_download_url') echo "Downloading Kiota $LATEST_TAG" - curl -L "https://github.com/microsoft/kiota/releases/download/${LATEST_TAG}/linux-x64.zip" -o kiota.zip - unzip kiota.zip -d $(Build.ArtifactStagingDirectory) + echo "Asset URL: $ASSET_URL" + curl -L "$ASSET_URL" -o kiota_download + if [[ "$ASSET_URL" == *.zip ]]; then + unzip kiota_download -d $(Build.ArtifactStagingDirectory) + else + tar -xzf kiota_download -C $(Build.ArtifactStagingDirectory) + fi displayName: 'Download latest Kiota from GitHub' diff --git a/submodules/vipr b/submodules/vipr index 0921e5504..c5c220440 160000 --- a/submodules/vipr +++ b/submodules/vipr @@ -1 +1 @@ -Subproject commit 0921e550479b18d11ccccc4f21ce4c72c8170b9b +Subproject commit c5c2204400b27503a3b9fb75a36b5a3cf9ed90f0 From 3fa9fcedb4d81ec601ec4785b45e4626f533d8b0 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 20 Feb 2026 14:43:49 -0800 Subject: [PATCH 4/8] extract kiota to correct directory --- .../generation-templates/build-and-publish-kiota.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 6b3dfde7d..562744cb1 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -6,9 +6,15 @@ steps: echo "Downloading Kiota $LATEST_TAG" echo "Asset URL: $ASSET_URL" curl -L "$ASSET_URL" -o kiota_download + mkdir -p /tmp/kiota_extract if [[ "$ASSET_URL" == *.zip ]]; then - unzip kiota_download -d $(Build.ArtifactStagingDirectory) + unzip kiota_download -d /tmp/kiota_extract else - tar -xzf kiota_download -C $(Build.ArtifactStagingDirectory) + tar -xzf kiota_download -C /tmp/kiota_extract fi + echo "=== Extracted contents ===" + find /tmp/kiota_extract -type f + KIOTA_BIN=$(find /tmp/kiota_extract -name kiota -type f | head -1) + echo "Found Kiota binary at: $KIOTA_BIN" + cp "$KIOTA_BIN" $(Build.ArtifactStagingDirectory)/kiota displayName: 'Download latest Kiota from GitHub' From 77326825b9c1d862076473105c712042a902d57a Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 20 Feb 2026 15:20:10 -0800 Subject: [PATCH 5/8] swith to pwsh --- .../build-and-publish-kiota.yml | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 562744cb1..50e447b75 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -1,20 +1,24 @@ steps: -- bash: | - RELEASE_JSON=$(curl -s "https://api.github.com/repos/microsoft/kiota/releases/latest") - LATEST_TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name') - ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("linux-x64")) | .browser_download_url') - echo "Downloading Kiota $LATEST_TAG" - echo "Asset URL: $ASSET_URL" - curl -L "$ASSET_URL" -o kiota_download - mkdir -p /tmp/kiota_extract - if [[ "$ASSET_URL" == *.zip ]]; then - unzip kiota_download -d /tmp/kiota_extract - else - tar -xzf kiota_download -C /tmp/kiota_extract - fi - echo "=== Extracted contents ===" - find /tmp/kiota_extract -type f - KIOTA_BIN=$(find /tmp/kiota_extract -name kiota -type f | head -1) - echo "Found Kiota binary at: $KIOTA_BIN" - cp "$KIOTA_BIN" $(Build.ArtifactStagingDirectory)/kiota +- pwsh: | + $releaseJson = Invoke-RestMethod "https://api.github.com/repos/microsoft/kiota/releases/latest" + $latestTag = $releaseJson.tag_name + $platform = if ($IsLinux) { "linux-x64" } elseif ($IsMacOS) { "osx-x64" } else { "win-x64" } + $asset = $releaseJson.assets | Where-Object { $_.name -match $platform } | Select-Object -First 1 + Write-Host "Downloading Kiota $latestTag" + Write-Host "Asset URL: $($asset.browser_download_url)" + $tmpDir = [System.IO.Path]::GetTempPath() + $downloadPath = Join-Path $tmpDir "kiota_download" + $extractPath = Join-Path $tmpDir "kiota_extract" + New-Item -ItemType Directory -Force -Path $extractPath | Out-Null + Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $downloadPath + if ($asset.name -match "\.zip$") { + Expand-Archive -Path $downloadPath -DestinationPath $extractPath -Force + } else { + tar -xzf $downloadPath -C $extractPath + } + $kiotaBin = Get-ChildItem -Path $extractPath -Filter "kiota" -Recurse -File | Select-Object -First 1 + Write-Host "Found Kiota binary at: $($kiotaBin.FullName)" + $stagingDir = "$(Build.ArtifactStagingDirectory)" + New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null + Copy-Item -Path $kiotaBin.FullName -Destination (Join-Path $stagingDir "kiota") displayName: 'Download latest Kiota from GitHub' From 8b3417c4323721811c80a5aba680a503c1a276e3 Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 20 Feb 2026 15:55:18 -0800 Subject: [PATCH 6/8] revert to bash, ensure correct extraction path --- .../generation-templates/build-and-publish-kiota.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index 50e447b75..fa510b580 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -16,9 +16,11 @@ steps: } else { tar -xzf $downloadPath -C $extractPath } - $kiotaBin = Get-ChildItem -Path $extractPath -Filter "kiota" -Recurse -File | Select-Object -First 1 + # Match 'kiota' or 'kiota.exe' via BaseName + $kiotaBin = Get-ChildItem -Path $extractPath -Recurse -File | Where-Object { $_.BaseName -eq "kiota" } | Select-Object -First 1 Write-Host "Found Kiota binary at: $($kiotaBin.FullName)" $stagingDir = "$(Build.ArtifactStagingDirectory)" New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null + # Always copy as 'kiota' (no extension) so downstream steps are platform-agnostic Copy-Item -Path $kiotaBin.FullName -Destination (Join-Path $stagingDir "kiota") displayName: 'Download latest Kiota from GitHub' From 49c19f689056f5af6267c2acc109bf800f1c641f Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Fri, 20 Feb 2026 15:55:37 -0800 Subject: [PATCH 7/8] revert to bash --- .../build-and-publish-kiota.yml | 41 ++++++++----------- 1 file changed, 17 insertions(+), 24 deletions(-) diff --git a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml index fa510b580..8790df160 100644 --- a/.azure-pipelines/generation-templates/build-and-publish-kiota.yml +++ b/.azure-pipelines/generation-templates/build-and-publish-kiota.yml @@ -1,26 +1,19 @@ steps: -- pwsh: | - $releaseJson = Invoke-RestMethod "https://api.github.com/repos/microsoft/kiota/releases/latest" - $latestTag = $releaseJson.tag_name - $platform = if ($IsLinux) { "linux-x64" } elseif ($IsMacOS) { "osx-x64" } else { "win-x64" } - $asset = $releaseJson.assets | Where-Object { $_.name -match $platform } | Select-Object -First 1 - Write-Host "Downloading Kiota $latestTag" - Write-Host "Asset URL: $($asset.browser_download_url)" - $tmpDir = [System.IO.Path]::GetTempPath() - $downloadPath = Join-Path $tmpDir "kiota_download" - $extractPath = Join-Path $tmpDir "kiota_extract" - New-Item -ItemType Directory -Force -Path $extractPath | Out-Null - Invoke-WebRequest -Uri $asset.browser_download_url -OutFile $downloadPath - if ($asset.name -match "\.zip$") { - Expand-Archive -Path $downloadPath -DestinationPath $extractPath -Force - } else { - tar -xzf $downloadPath -C $extractPath - } - # Match 'kiota' or 'kiota.exe' via BaseName - $kiotaBin = Get-ChildItem -Path $extractPath -Recurse -File | Where-Object { $_.BaseName -eq "kiota" } | Select-Object -First 1 - Write-Host "Found Kiota binary at: $($kiotaBin.FullName)" - $stagingDir = "$(Build.ArtifactStagingDirectory)" - New-Item -ItemType Directory -Force -Path $stagingDir | Out-Null - # Always copy as 'kiota' (no extension) so downstream steps are platform-agnostic - Copy-Item -Path $kiotaBin.FullName -Destination (Join-Path $stagingDir "kiota") +- bash: | + RELEASE_JSON=$(curl -s "https://api.github.com/repos/microsoft/kiota/releases/latest") + LATEST_TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name') + ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '.assets[] | select(.name | test("linux-x64")) | .browser_download_url') + echo "Downloading Kiota $LATEST_TAG" + echo "Asset URL: $ASSET_URL" + curl -L "$ASSET_URL" -o kiota_download + mkdir -p /tmp/kiota_extract + if [[ "$ASSET_URL" == *.zip ]]; then + unzip kiota_download -d /tmp/kiota_extract + else + tar -xzf kiota_download -C /tmp/kiota_extract + fi + KIOTA_BIN=$(find /tmp/kiota_extract -name kiota -type f | head -1) + echo "Found Kiota binary at: $KIOTA_BIN" + mkdir -p "$(Build.ArtifactStagingDirectory)" + cp "$KIOTA_BIN" "$(Build.ArtifactStagingDirectory)/kiota" displayName: 'Download latest Kiota from GitHub' From 7e8aaa5547644bf4fe4c7a6c4cd900b3bc1ea42b Mon Sep 17 00:00:00 2001 From: ramsessanchez <63934382+ramsessanchez@users.noreply.github.com> Date: Mon, 23 Feb 2026 16:38:51 -0800 Subject: [PATCH 8/8] make kiota exe path resillient --- .../language-generation-kiota.yml | 2 +- .../set-up-for-generation-kiota.yml | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.azure-pipelines/generation-templates/language-generation-kiota.yml b/.azure-pipelines/generation-templates/language-generation-kiota.yml index 847fda7b0..3c122c707 100644 --- a/.azure-pipelines/generation-templates/language-generation-kiota.yml +++ b/.azure-pipelines/generation-templates/language-generation-kiota.yml @@ -96,7 +96,7 @@ steps: Write-Warning "Kiota directory not found: $(kiotaDirectory)" } displayName: 'List files in Kiota directory' -- pwsh: '& "$(kiotaDirectory)/kiota" generate --openapi "$(Build.SourcesDirectory)/msgraph-metadata/${{ parameters.cleanMetadataFolder }}/openapi.yaml" --language "${{ parameters.language }}" -o "$(kiotaDirectory)/output" -n "${{ parameters.targetNamespace }}" -c "${{ parameters.targetClassName }}" ${{ parameters.customArguments }} ${{ parameters.pathExclusionArguments }}' +- pwsh: '& "$(kiotaExecutable)" generate --openapi "$(Build.SourcesDirectory)/msgraph-metadata/${{ parameters.cleanMetadataFolder }}/openapi.yaml" --language "${{ parameters.language }}" -o "$(kiotaDirectory)/output" -n "${{ parameters.targetNamespace }}" -c "${{ parameters.targetClassName }}" ${{ parameters.customArguments }} ${{ parameters.pathExclusionArguments }}' displayName: 'Run Kiota for ${{ parameters.language }} ${{ parameters.version }}' env: KIOTA_GENERATION:EXPORTPUBLICAPI: ${{ parameters.exportDom }} diff --git a/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml b/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml index 91682461c..525ed1edd 100644 --- a/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml +++ b/.azure-pipelines/generation-templates/set-up-for-generation-kiota.yml @@ -8,7 +8,17 @@ steps: parameters: version: "10.x" -- bash: chmod +x $(kiotaDirectory)/kiota +- bash: | + KIOTA_BIN=$(find "$(kiotaDirectory)" -name "kiota" -type f | head -1) + if [ -z "$KIOTA_BIN" ]; then + echo "ERROR: kiota binary not found under $(kiotaDirectory)" + echo "Directory contents:" + ls -laR "$(kiotaDirectory)" || echo "Directory does not exist" + exit 1 + fi + chmod +x "$KIOTA_BIN" + echo "Kiota binary ready at: $KIOTA_BIN" + echo "##vso[task.setvariable variable=kiotaExecutable]$KIOTA_BIN" displayName: 'Make Kiota executable' # checkout metadata repo if capture and clean step is skipped