-
Notifications
You must be signed in to change notification settings - Fork 4k
Anapandey/bicep export #28014
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
base: main
Are you sure you want to change the base?
Anapandey/bicep export #28014
Conversation
Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for exporting resource group templates as Bicep files by introducing an OutputFormat
parameter in the cmdlet, updating file-saving logic to handle different extensions, and adding tests for the new behavior.
- Introduce
OutputFormat
inExportAzureResourceGroupCmdlet
and pass it to export parameters - Extend
FileUtility.SaveTemplateFile
with anextension
argument to choose “.json” or “.bicep” - Add PowerShell and C# tests for Bicep export
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/Resources/Resources.Test/ScenarioTests/ResourceGroupTests.ps1 | Added Test-ExportResourceGroupBicep Pester scenario |
src/Resources/Resources.Test/ScenarioTests/ResourceGroupTests.cs | Added [Fact] TestExportResourceGroupBicep |
src/Resources/ResourceManager/Utilities/FileUtility.cs | Extended SaveTemplateFile signature with extension |
src/Resources/ResourceManager/Implementation/ResourceGroups/ExportAzureResourceGroupCmdlet.cs | Added OutputFormat param and computed extension logic |
src/Resources/ResourceManager/Entities/ResourceGroup/ExportTemplateParameters.cs | Introduced OutputFormat property for SDK parameters |
Comments suppressed due to low confidence (2)
src/Resources/ResourceManager/Utilities/FileUtility.cs:39
- The XML doc comments above this method no longer match the signature. Please add a
<param name="extension">
entry explaining the new argument.
public static string SaveTemplateFile(string templateName, string contents, string outputPath, bool overwrite, Func<string, string, bool> shouldContinue, string extension = ".json") // Added extension parameter with default
src/Resources/ResourceManager/Entities/ResourceGroup/ExportTemplateParameters.cs:39
- Consider using the
ExportTemplateOutputFormat
enum here instead of a plain string for stronger typing and to prevent invalid values at compile time.
public string OutputFormat { get; set; }
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of issues in this PR.
- New test case was added but the test recording file is missing.
- New parameters were added but the docs has no update.
- ChangeLog.md has no update.
Hi @anamikapan, please update the PR title to describe the purpose of the change and add the test recording file. |
This PR was labeled "needs-revision" because it has unresolved review comments or CI failures. |
Description
Powershell changes for bicep export feature
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
[* ] Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.