Azure / bicep-types-az

Bicep type definitions for ARM resources
MIT License
84 stars 27 forks source link

VS Code support for private preview resource types #395

Open MarcusFelling opened 3 years ago

MarcusFelling commented 3 years ago

I would love the ability to consume resource types that are in private preview. This would help test this experience before types move to public preview.

anthony-c-martin commented 3 years ago

It would be really nice to support this in an easy-to-use manner.

For now, here's a manual way to get this working using the current infrastructure:

  1. Clone your private copy of the specs repo with your testing branch to a local folder.
  2. Clone this repo.
  3. Follow the instructions under https://github.com/Azure/bicep-types-az#running-generation-locally, pointing the --specs-dir parameter to the path you have cloned the specs repo to, and using the --single-path option where the path specified is the relative path to the README.md you're trying to generate types for. E.g. for the compute readme at specification/compute/resource-manager/readme.md, this value would simply be compute.
  4. In your local copy of the Bicep repo, replace the following 2 references to use ProjectReference instead of PackageReference, replacing {path_to_bicep_types_repo} with the path where you cloned this repo: https://github.com/Azure/bicep/blob/ec0c24b90d4358020131ab9b9faa234bf5502359/src/Bicep.Core/Bicep.Core.csproj#L28-L29.
    <ProjectReference Include="{path_to_bicep_types_repo}/src/Bicep.Types/Bicep.Types.csproj" />
    <ProjectReference Include="{path_to_bicep_types_repo}/src/Bicep.Types.Az/Bicep.Types.Az.csproj" />
  5. Run through https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md#running-the-bicep-vscode-extension or https://github.com/Azure/bicep/blob/main/CONTRIBUTING.md#running-the-bicep-cli to build and run a local copy of the Bicep compiler, with your custom types added.