Azure / azure-dev

A developer CLI that reduces the time it takes for you to get started on Azure. The Azure Developer CLI (azd) provides a set of developer-friendly commands that map to key stages in your workflow - code, build, deploy, monitor, repeat.
https://aka.ms/azd
MIT License
388 stars 177 forks source link

[Issue] Pack and push NuGet project to Artifacts in Azure Pipelines #901

Open marnixcox opened 1 year ago

marnixcox commented 1 year ago

Output from azd version azd version 0.3.0-beta.1 (commit c5344160ed49bfda75281fba28b5e9ac7b96670e)

Output from az version

{
  "azure-cli": "2.40.0",
  "azure-cli-core": "2.40.0",
  "azure-cli-telemetry": "1.0.8",
  "extensions": {
    "application-insights": "0.1.7",
    "arcdata": "1.4.5",
    "init": "0.1.0",
    "managementpartner": "0.1.3"
  }
}

Describe the bug Please advise how to publish a (C#) project as a NuGet package to DevOps Artifacts using azd cli.

https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/artifacts-overview?view=azure-devops&tabs=nuget

To Reproduce Should the azd cli yaml host enum be extented by something like azdoartifacts?

  "host": {
                        "type": "string",
                        "title": "Type of Azure resource used for service implementation",
                        "description": "If omitted, App Service will be assumed.",
                        "enum": [
                            "",
                            "appservice",
                            "containerapp",
                            "function",
                            "staticwebapp"
                        ]
                    }

Expected behavior Project should be build, packaged and pushed by doing the following steps:

steps:
- task: DotNetCoreCLI@2
  displayName: 'dotnet pack'
  inputs:
    command: pack
    packagesToPack: Someproject.csproj

- task: DotNetCoreCLI@2
  displayName: 'dotnet push'
  inputs:
    command: push
    publishVstsFeed: 'feed id'
  continueOnError: true

Environment Information on your environment:

rajeshkamal5050 commented 1 year ago

@marnixcox shouln't this be already be achievable via azdo directly? Does Azd limit that?

@danieljurek @vhvb1989 can you also take a look from Azd side if we limit azdo features?

vhvb1989 commented 1 year ago

Please advise how to publish a (C#) project as a NuGet package to DevOps Artifacts using azd cli.

azd can create the cloud resources to host a C# application and set up an Azure DevOps pipeline for continuous integration. If you need to do more things with the same pipeline, you can update the pipeline manually.

Can you describe with more details what is the project you are creating with azd @marnixcox ?

marnixcox commented 1 year ago

@vhvb1989 This project is more or less related to #411 A generic library to be used from other projects. I expected that all pipeline steps would be generated by azd and I/we only needed to use the main little azd yaml file. But I'll try to add them manually.

vhvb1989 commented 1 year ago

A generic library to be used from other projects

what do you mean by other projects ? Does it mean projects that you are deploying to Azure when running azd up ?

marnixcox commented 1 year ago

Yes, projects/templates that include a c# Functions component which have a reference to a hosted nuget package/library. But my initial question was how to deploy this nuget package using azd with minimal effort.