Schemas used to author and validate Resource Manager Templates. These schemas power the intellisense and syntax completion in our ARM Tools VSCode extension, as well as the Export Template API
Перейти к файлу
dependabot[bot] ed2cc69568
Bump express from 4.21.1 to 4.21.2 in /tools (#3281)
Bumps [express](https://github.com/expressjs/express) from 4.21.1 to 4.21.2.
- [Release notes](https://github.com/expressjs/express/releases)
- [Changelog](https://github.com/expressjs/express/blob/4.21.2/History.md)
- [Commits](https://github.com/expressjs/express/compare/4.21.1...4.21.2)

---
updated-dependencies:
- dependency-name: express
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-08 22:18:42 +00:00
.github Update generate-schemas.yml 2024-10-29 16:27:12 -04:00
.sdkauto Update generateScript.sh 2024-07-25 09:43:24 -04:00
.vscode Refactor to simplify & remove unused code 2024-03-31 23:11:19 -04:00
bicep-types-az@a1f912858b Pick up changes from https://github.com/Azure/bicep-types-az/pull/2359 2024-11-19 16:56:49 -05:00
generator Bump @types/node from 22.9.3 to 22.10.1 in /generator (#3277) 2024-12-01 23:04:30 +00:00
schemas Remove reference to Microsoft.Security/pricings 2024-11-21 10:49:45 -05:00
tools Bump express from 4.21.1 to 4.21.2 in /tools (#3281) 2024-12-08 22:18:42 +00:00
.gitignore Add linter validation 2021-10-30 11:11:02 +00:00
.gitmodules Introduce AutorestV2 for generation 2024-04-10 12:09:26 -04:00
CredScanSuppressions.json
LICENSE
README.md Correct readme typo 2024-04-25 15:33:29 -04:00
SECURITY.md Microsoft mandatory file 2022-05-18 22:05:57 +00:00
rp-label-to-contact.md Added contacts to readme 2021-03-08 19:04:16 -08:00
swagger_to_sdk_config.json Rename master -> main 2021-08-04 13:35:16 +00:00

README.md

azure-resource-manager-schemas

[!WARNING]

The schemas in this repository are designed for best-effort validation, and should NOT be relied upon for accuracy or programmatic consumption. If you have a current (or potential new) dependency that you would like to discuss alternatives for, please raise an issue.

This is the repo for template deployment schemas hosted under https://schema.management.azure.com/schemas. Please see below for information on contributing and publishing updated schemas.

Updating Schemas

[!NOTE] We only publish template schemas for resource providers that are publicly available. This means that there should be no restrictions (private preview, internal-only allowlisting) on who can call your APIs. As a general rule, if there is not an API definition in the Public API Specs Repo, we will not consider a PR.

Schemas are generated and updated automatically, and should not require any action from RP teams.

Generating Locally

If you want to preview or troubleshoot generation locally, you can use the generator in this repo to generate a schema from a swagger spec checked into the azure-rest-api-specs repo.

Instructions

  1. Clone azure-rest-api-specs.
  2. Fork this repo, and clone it locally.
  3. Update submodules and build dependencies:
    git submodule update --init --recursive
    npm --prefix bicep-types-az/bicep-types/src/bicep-types ci
    npm --prefix bicep-types-az/bicep-types/src/bicep-types run build
    npm --prefix bicep-types-az/src/autorest.bicep ci
    npm --prefix bicep-types-az/src/autorest.bicep run build
    
  4. Run the following commands, replacing ../azure-rest-api-specs with your relative path to the swagger repo, and myprovider/resource-manager with the base path (discovered with npm --prefix generator run list-basepaths)
    npm --prefix generator ci
    npm --prefix generator run generate-single -- --specs-dir ../azure-rest-api-specs --base-path myprovider/resource-manager
    

Runing Unit Tests

Use the following commands to execute the test suite locally:

npm --prefix tools ci
npm --prefix tools test

Manual testing with a local schema server

This repo contains a command to run a schema web server which will host files directly from your local repo. This can be useful if you want to validate schemas against a particular tool - for example if you want to verify VSCode autocompletion and syntax highlighting. By default this will listen on port 3000, but this can be modified by editing tools/server.ts. To start an instance you can use the following commands:

npm --prefix tools ci
npm --prefix tools run serve

Once this is running, you can create a basic template with the following structure (replacing the sections between < and > as appropriate for your scenario):

{
  "$schema": "http://<hostname>:<port>/schemas/2019-04-01/deploymentTemplate.json",
  "resources": [
    {
      "type": "<providerNamespace>/<resourceType>",
      "apiVersion": "<apiVersion>",
      "properties": {
      }
    }
  ]
}

NOTE Many client tools will cache responses from schema servers, so you may need to clear this cache if you are testing modifications, or alternatively, change the port between retries.

RP Schemas Repo Issues Bot Notifications

To get quickly notified on GitHub issues for your RP's schema, please update the rp-label-to-contact.md by submitting a PR with the desired GitHub handle(s) and label for your RP.


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.