Azure / Azure/azure-powershell

Publish-AzBlueprint fails to publish a new version of a published blueprint

Open
#9,511 5 comments 0 reactions 1 assignee Claimed by @filizt View on GitHub
Blueprint Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
2d 17h
Merged PRs (30d)
51

Description

## Description
As Publish-AzBlueprint only has one parameter set which accepts PSBlueprint object, passing in a PSPublishedBlueprint fails to publish a new version of the already published blueprint.

We can achieve this with REST API, it probably makes sense to have it in Publish-AzBlueprint cmdlet as well.

## Steps to reproduce

```powershell
$blueprint = Get-AzBlueprint -ManagementGroupId $mgId -Name $blueprintName -LatestPublished
Publish-AzBlueprint -Blueprint $blueprint -Version $blueprintVersion
```

## Environment data

```
Name Value
---- -----
PSVersion 5.1.18362.145
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.18362.145
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
```

## Module versions
```powershell
ModuleType Version Name
---------- ------- ----
Script 0.2.0 Az.Blueprint
```

## Debug output

```

```

## Error output
```
/home/vsts/work/1/s/pipelines/releaseBlueprint.ps1 : Cannot bind parameter 'Blueprint'. Cannot convert the "Microsoft.Azure.Commands.Blueprint.Models.PSPublishedBlueprint" value of type "Microsoft.Azure.Commands.Blueprint.Models.PSPublishedBlueprint" to type "Microsoft.Azure.Commands.Blueprint.Models.PSBlueprint".
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.