Skip to content
This repository was archived by the owner on Feb 23, 2024. It is now read-only.

Commit a384bb8

Browse files
authored
Package Creator and Extractor as a dotnet CLI tool. (#383)
* Package Creator and Extractor as a dotnet CLI tool. * Added documentation for the dotnet CLI tool.
1 parent b739b0f commit a384bb8

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/APIM_ARMTemplate/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,17 @@ Below are the steps to run the Creator from the source code:
285285

286286
You can also run it directly from the [releases](https://github.com/Azure/azure-api-management-devops-resource-kit/releases).
287287

288+
Additionaly, the Creator can also be made available as a global [dotnet CLI tool](https://docs.microsoft.com/en-us/dotnet/core/tools/global-tools) in your Azure DevOps artifacts or private NuGet repository. Build the Creator, and run the following commands to package the Creator as a dotnet tool:
289+
290+
```
291+
dotnet pack -c Release
292+
dotnet tool install -g --add-source .\bin\Release apimtemplate
293+
```
294+
295+
The Creator tool is now available anywhere on the command-line:
296+
297+
```apim-templates create --configFile CONFIG_YAML_FILE_LOCATION ```
298+
288299
# Extractor
289300

290301
This utility generates [Resource Manager templates](https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-group-authoring-templates) by extracting existing configurations of one or more APIs in an API Management instance.
@@ -485,3 +496,9 @@ dotnet run extract
485496

486497

487498
You can also run it directly from the [releases](https://github.com/Azure/azure-api-management-devops-resource-kit/releases).
499+
500+
Likewise, if you [package the Extractor as a dotnet CLI tool](#creator2), you can run it from anywhere on the command-line:
501+
502+
```
503+
apim-templates extract
504+
```

src/APIM_ARMTemplate/apimtemplate/apimtemplate.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
<TargetFramework>netcoreapp2.1</TargetFramework>
66
<ProjectGuid>{B5183465-2BC1-4206-9C9F-5AC9615AC941}</ProjectGuid>
77
<LangVersion>preview</LangVersion>
8+
<PackAsTool>true</PackAsTool>
9+
<ToolCommandName>apim-templates</ToolCommandName>
810
</PropertyGroup>
911

1012
<ItemGroup>

0 commit comments

Comments
 (0)