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

[DO NOT MERGE] Support deploying Azure resources described with the Bicep language #14104

Merged
merged 6 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ protected void BuildAndUseBicepTemplate()
{
if (BicepUtility.IsBicepFile(TemplateFile))
{
TemplateFile = BicepUtility.BuildFile(this.ExecuteScript<Object>, TemplateFile);
TemplateFile = BicepUtility.BuildFile(this.ExecuteScript<Object>, this.ResolvePath(TemplateFile));
}

if (BicepUtility.IsBicepFile(TemplateUri))
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions src/Resources/ResourceManager/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -497,4 +497,7 @@ You can help us improve the accuracy of the result by opening an issue here: htt
<data name="BicepNotFound" xml:space="preserve">
<value>Cannot find Bicep. Please add Bicep to your PATH or visit https://github.com/Azure/bicep/releases to install Bicep.</value>
</data>
<data name="InvalidBicepFilePathOrUri" xml:space="preserve">
<value>Invalid Bicep file path or uri.</value>
BethanyZhou marked this conversation as resolved.
Show resolved Hide resolved
</data>
</root>
4 changes: 4 additions & 0 deletions src/Resources/ResourceManager/Utilities/BicepUtility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ public static string BuildFile<T>(ScriptExecutor<T> executeScript, string bicepT
{
File.Copy(bicepTemplateFilePath, tempPath, true);
}
else
{
throw new AzPSArgumentException(Properties.Resources.InvalidBicepFilePathOrUri, bicepTemplateFilePath);
BethanyZhou marked this conversation as resolved.
Show resolved Hide resolved
}
executeScript($"bicep build '{tempPath}'");
return tempPath.Replace(".bicep", ".json");
}
Expand Down