Skip to content

Bicep type definitions for ARM resources

License

Notifications You must be signed in to change notification settings

Azure/bicep-types-az

Repository files navigation

Build codecov Build Status

bicep-types-az

Bicep type definitions for ARM resources

Browsing available types

See /generated/index.md for a searchable list of all the available types. You can view individual type definitions by clicking on api versions.

Re-generating types from swagger

  1. Under GitHub Actions, run the "Update Types" workflow on the main branch. Usually you'll want to leave the git ref input as "master" for this workflow.
  2. After ~2hrs, this action will generate a PR in this repo from a branch named autogenerate.
  3. To workaround this issue, close the PR and open it to trigger Merge Validation to run.
  4. Merge the PR. Type differences can be reviewed by looking at the Markdown files in /generated.

Running generation locally

Initial setup

  1. Clone this repo
  2. Check out submodules:
    git submodule update --init --recursive
  3. Build the bicep-types dependency:
    pushd bicep-types/src/bicep-types
    npm ci
    npm run build
    popd
  4. Ensure you have a copy of the azure-rest-api-specs repo checked out locally.
  5. Build the autorest extension code:
    cd src/autorest.bicep
    npm ci
    npm run build
  6. Change to the generator directory, and install dependencies:
    cd ../../src/generator
    npm ci

Running

  1. To run generation across the entire specs repo:
    npm run generate -- --specs-dir {path to azure-rest-api-specs}
  2. To run generation for a single path in the specs repo (e.g. 'compute'):
    npm run generate -- --specs-dir {path to azure-rest-api-specs} --single-path compute
  3. To see other available generation parameters, including debugging options:
    npm run generate -- --help

Debugging in VSCode

  1. Ensure you have cloned the azure-rest-api-specs repo into the same directory that you have cloned this repo - e.g. so you have the following folder structure:
    .
    ./bicep-types-az
    ./azure-rest-api-specs
    
  2. Use the Generate Single VSCode action, and specify a 'base path' from the specifications folder in the azure-rest-api-specs repo - e.g. compute or automation. You should now be able to step through the src/generator and src/autorest.bicep extension code with the VSCode debugger.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.