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

Error Thrown in Aspire Azure Devops Deploy (but Locally Works) #5778

Open
1 task done
Mike-E-angelo opened this issue Sep 19, 2024 · 0 comments
Open
1 task done

Error Thrown in Aspire Azure Devops Deploy (but Locally Works) #5778

Mike-E-angelo opened this issue Sep 19, 2024 · 0 comments
Labels
area-deployment untriaged New issue has not been triaged

Comments

@Mike-E-angelo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

This is in reference to this discussion:
#5507

As I am getting the sense this is a bug and not a discussion I am formally making it a report here instead.

Expected Behavior

Successful Azure DevOps deployment with Aspire SLN, no exceptions. 😊

Steps To Reproduce

trigger:
  - deploy/testing

pool:
  vmImage: windows-latest

steps:
  - checkout: self
    fetchDepth: 0
    clean: false
    submodules: true
  # setup-azd@0 needs to be manually installed in your organization
  # if you can't install it, you can use the below bash script to install azd
  # and remove this step
  - task: setup-azd@0
    displayName: Install azd
  - task: UseDotNet@2
    displayName: Install .NET SDK
    inputs:
      packageType: 'sdk' # 'runtime' | 'sdk'. Package to install. Default: sdk.
    #useGlobalJson: false # boolean. Optional. Use when packageType = sdk. Use global json. Default: false.
    #workingDirectory: # string. Optional. Use when useGlobalJson = true. Working Directory.
      version: '8.0.401'
  - task: DotNetCoreCLI@2
    displayName: 'dotnet workload'
    inputs:
      command: custom
      custom: 'workload '
      arguments: 'restore'
  # azd delegate auth to az to use service connection with AzureCLI@2
  - pwsh: |
      azd config set auth.useAzCliAuth "true"
    displayName: Configure AZD to Use AZ CLI Authentication.
  - bash: |
      # Extract the solution name from the .sln file
      SOLUTION_NAME=$(ls *.sln | sed 's/\.sln$//')
      echo "Solution Name: $SOLUTION_NAME"
      echo "##vso[task.setvariable variable=SOLUTION_NAME]$SOLUTION_NAME"
    displayName: Extract Solution Name
  - task: AzureCLI@2
    displayName: Provision Infrastructure
    inputs:
      azureSubscription: azconnection
      scriptType: pwsh
      scriptLocation: inlineScript
      keepAzSessionActive: true
      inlineScript: |
        azd provision --no-prompt
        azd env refresh --no-prompt
      workingDirectory: $(SOLUTION_NAME).AppHost
    env:
      AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
      AZURE_ENV_NAME: $(AZURE_ENV_NAME)
      AZURE_LOCATION: $(AZURE_LOCATION)
      AZD_INITIAL_ENVIRONMENT_CONFIG: $(AZD_INITIAL_ENVIRONMENT_CONFIG)

  - task: AzureCLI@2
    displayName: Deploy Application
    inputs:
      azureSubscription: azconnection
      scriptType: pwsh
      scriptLocation: inlineScript
      keepAzSessionActive: true
      inlineScript: |
        azd deploy --no-prompt --all
      workingDirectory: $(SOLUTION_NAME).AppHost
    env:
      AZURE_SUBSCRIPTION_ID: $(AZURE_SUBSCRIPTION_ID)
      AZURE_ENV_NAME: $(AZURE_ENV_NAME)
      AZURE_LOCATION: $(AZURE_LOCATION)

Exceptions (if any)

{"config":{"ExposedPorts":{"8080/tcp":{}},"Labels":{"org.opencontainers.image.created":"2024-09-14T09:38:35.3953670Z","org.opencontainers.artifact.created":"2024-09-14T09:38:35.3953670Z","org.opencontainers.image.authors":"<Project>.Web.Administration","org.opencontainers.image.version":"0.0.0-g88fabebe88","org.opencontainers.image.base.name":"mcr.microsoft.com/dotnet/aspnet:8.0","net.dot.runtime.majorminor":"8.0","net.dot.sdk.version":"8.0.401","org.opencontainers.image.base.digest":"sha256:cdec73c10b10bfb28c3c9bcc583c9bf8a84a95234853977f4fdecefbf91a0ee0"},"Env":["PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin","APP_UID=1654","ASPNETCORE_HTTP_PORTS=8080","DOTNET_RUNNING_IN_CONTAINER=true","DOTNET_VERSION=8.0.8","ASPNET_VERSION=8.0.8"],"WorkingDir":"/app","Entrypoint":["dotnet","<Project>.Web.Administration.dll"],"User":"1654"},"created":"2024-09-14T09:38:51.1396739Z","rootfs":{"type":"layers","diff_ids":["sha256:8e2ab394fabf557b00041a8f080b10b4e91c7027b7c174f095332c7ebb6501cb","sha256:c5584e992acccf9b806c7856dee6fc3e56d3f1ad5bc6b18670ed823970ca2f15","sha256:a762b3e4b25a47aa8ab9122dfe72c2df4823d5b9e36ccf492f521a51a9903385","sha256:cd861b0495bf9abbdb0dbfdfaa6a3a0295c6cdad014e9b2c19b6e7865d370cfa","sha256:f65dd6626428b05a483660e6ba573e994fd5dbbf9903b9628e5b0a384d5f285c","sha256:34ae416b2123ded236b0cd0d13fb0bdb59e457d795b8cab5701edb9e673a6d0c","sha256:41ce924adad68d860dc4c94f941dd5f4c094b7adda8f5ad6188567977364efdb"]},"architecture":"amd64","os":"linux","history":[{"created":"2024-09-04T22:30:47.4798092Z","created_by":"/bin/sh -c #(nop) ADD file:d13afefcc2b0b02b598a3ac2598fe2187db41de1e17820e5b600a955b1429d59 in / "},{"created":"2024-09-04T22:30:47.7729287Z","created_by":"/bin/sh -c #(nop)  CMD [\u0022bash\u0022]","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:34.0586463Z","created_by":"ENV APP_UID=1654 ASPNETCORE_HTTP_PORTS=8080 DOTNET_RUNNING_IN_CONTAINER=true","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:34.0586463Z","created_by":"RUN /bin/sh -c apt-get update     \u0026\u0026 apt-get install -y --no-install-recommends         ca-certificates                 libc6         libgcc-s1         libicu72         libssl3         libstdc\u002B\u002B6         tzdata         zlib1g     \u0026\u0026 rm -rf /var/lib/apt/lists/* # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:35.4158930Z","created_by":"RUN /bin/sh -c groupadd         --gid=$APP_UID         app     \u0026\u0026 useradd -l         --uid=$APP_UID         --gid=$APP_UID         --create-home         app # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:42.0586250Z","created_by":"ENV DOTNET_VERSION=8.0.8","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:42.0586250Z","created_by":"COPY /dotnet /usr/share/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:43.0188024Z","created_by":"RUN /bin/sh -c ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet # buildkit"},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:48.6564553Z","created_by":"ENV ASPNET_VERSION=8.0.8","empty_layer":true},{"comment":"buildkit.dockerfile.v0","created":"2024-09-10T13:49:48.6564553Z","created_by":"COPY /shared/Microsoft.AspNetCore.App /usr/share/dotnet/shared/Microsoft.AspNetCore.App # buildkit"},{"author":".NET SDK","created":"2024-09-14T09:38:51.1396488Z","created_by":".NET SDK Container Tooling, version 8.0.401-servicing.24408.18\u002B41b13414c4a35aac269719f7281cf74c9c9aae31"}]}
'
Ensure project 'C:\agent\_work\2\s\<Project>.Web.Administration\<Project>.Web.Administration.csproj' is enabled for container support and try again. To enable SDK container support, set the 'EnableSdkContainerSupport' property to true in your project file
##[error]Script failed with exit code: 1

.NET Version info

.NET SDK:
 Version:           8.0.401
 Commit:            811edcc344
 Workload version:  8.0.400-manifests.57f7c351
 MSBuild version:   17.11.4+37eb419ad

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19045
 OS Platform: Windows
 RID:         win-x64
 Base Path:   C:\Program Files\dotnet\sdk\8.0.401\

.NET workloads installed:
Configured to use loose manifests when installing new manifests.
 [aspire]
   Installation Source: SDK 8.0.400
   Manifest Version:    8.2.0/8.0.100
   Manifest Path:       C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.aspire\8.2.0\WorkloadManifest.json
   Install Type:              Msi


Host:
  Version:      8.0.8
  Architecture: x64
  Commit:       08338fcaa5

.NET SDKs installed:
  7.0.410 [C:\Program Files\dotnet\sdk]
  8.0.108 [C:\Program Files\dotnet\sdk]
  8.0.401 [C:\Program Files\dotnet\sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.AspNetCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.NETCore.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
  Microsoft.WindowsDesktop.App 7.0.20 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
  Microsoft.WindowsDesktop.App 8.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Other architectures found:
  None

Environment variables:
  Not set

global.json file:
  Not found

Learn more:
  https://aka.ms/dotnet/info

Download .NET:
  https://aka.ms/dotnet/download

Anything else?

Thank you for all your efforts out there. 🙏 Outside of these few minor issues Aspire is aspirin'. 😀👍

@davidfowl davidfowl added bug dependencies Pull requests that update a dependency file area-deployment and removed dependencies Pull requests that update a dependency file labels Sep 19, 2024
@joperezr joperezr added the untriaged New issue has not been triaged label Oct 15, 2024
@davidfowl davidfowl removed the bug label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-deployment untriaged New issue has not been triaged
Projects
None yet
Development

No branches or pull requests

3 participants