Skip to content

Commit

Permalink
Fix Get and Preview calls for local extensions (#14841)
Browse files Browse the repository at this point in the history
The PR corrects the issue where `Get` and `Preview` operations were
incorrectly calling `Delete` and `CreateOrUpdate`.
###### Microsoft Reviewers: [Open in
CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/Azure/bicep/pull/14841)
  • Loading branch information
shenglol committed Aug 15, 2024
1 parent 4139b6c commit 98ed923
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ private async Task<HttpResponseMessage> CallExtension(
case "get":
{
var resourceReference = await GetResourceReferenceAsync(await content.ReadAsStreamAsync(cancellationToken), cancellationToken);
var extensionResponse = await provider.Delete(resourceReference, cancellationToken);
var extensionResponse = await provider.Get(resourceReference, cancellationToken);

return await GetHttpResponseMessageAsync(extensionResponse, cancellationToken);
}
case "preview":
{
var resourceSpecification = await GetResourceSpecificationAsync(await content.ReadAsStreamAsync(cancellationToken), cancellationToken);
var extensionResponse = await provider.CreateOrUpdate(resourceSpecification, cancellationToken);
var extensionResponse = await provider.Preview(resourceSpecification, cancellationToken);

return await GetHttpResponseMessageAsync(extensionResponse, cancellationToken);
}
Expand Down

0 comments on commit 98ed923

Please sign in to comment.