Azure / azure-resource-manager-schemas

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
MIT License
610 stars 517 forks source link

Warning about apiVersion (not yet added in 2019-04-01/deploymentTemplate.json) #1785

Open leo-buneev opened 3 years ago

leo-buneev commented 3 years ago

Hi, I've tried to edit ARM template generated from Azure portal (with vscode-azurearmtools vscode extension), and there was a bunch of missing apiVersion warnings (For full schema validation, consider updating the value to one of the following ...).

Seems like 2019-04-01/deploymentTemplate.json needs an update for those.

"Microsoft.DocumentDB/databaseAccounts": 2021-05-15 "microsoft.insights/components": 2020-02-02 "microsoft.insights/components/ProactiveDetectionConfigs": 2018-05-01-preview "Microsoft.Storage/storageAccounts": 2021-04-01

nielsvdc commented 3 years ago

I can also acknowledge this for: "Microsoft.AAD/domainServices": 2021-05-01 "Microsoft.Network/virtualNetworks": 2021-02-01 "Microsoft.Network/networkSecurityGroups": 2021-02-01

StephenWeatherford commented 2 years ago

@jorgecotillo Status, please? This affects everything in the Microsoft.Network namespace in https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#. Nothing exists for Microsoft.network past 2020-11-01:

% cat 2019-04-01-deploymentTemplate.json | fgrep "Microsoft.Network"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-11-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2017-03-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2017-05-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2018-04-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones_A"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones_AAAA"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones_CNAME"
...
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworkGateways"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks_subnets"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks_virtualNetworkPeerings"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworkTaps"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualRouters"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualRouters_peerings"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualWans"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnGateways"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnGateways_natRules"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnGateways_vpnConnections"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnServerConfigurations"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnSites"

Thanks!

metaxasa commented 2 years ago

@jorgecotillo is there an eta to fix this? For example, I note that "Microsoft.AAD/domainServices": 2021-05-01 still seems to be missing.

jorgecotillo commented 2 years ago

@jorgecotillo Status, please? This affects everything in the Microsoft.Network namespace in https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#. Nothing exists for Microsoft.network past 2020-11-01:

% cat 2019-04-01-deploymentTemplate.json | fgrep "Microsoft.Network"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-11-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2017-03-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2017-05-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2018-04-01/Microsoft.Network.json#/resourceDefinitions/trafficManagerProfiles"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones_A"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones_AAAA"
                                    "$ref": "https://schema.management.azure.com/schemas/2015-05-04-preview/Microsoft.Network.json#/resourceDefinitions/dnszones_CNAME"
...
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworkGateways"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks_subnets"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworks_virtualNetworkPeerings"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualNetworkTaps"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualRouters"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualRouters_peerings"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/virtualWans"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnGateways"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnGateways_natRules"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnGateways_vpnConnections"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnServerConfigurations"
                                    "$ref": "https://schema.management.azure.com/schemas/2020-11-01/Microsoft.Network.json#/resourceDefinitions/vpnSites"

Thanks!

Microsoft.Network is disabled for autogen, so they need to manually update the schemas. @stephaniezyen for awareness, we need to contact NRP and get an ETA of the update.

Here's the list of RPs disabled:

https://github.com/Azure/azure-resource-manager-schemas/blob/main/generator/autogenlist.ts

jorgecotillo commented 2 years ago

@jorgecotillo is there an eta to fix this? For example, I note that "Microsoft.AAD/domainServices": 2021-05-01 still seems to be missing.

Same case as the one from Stephen, Microsoft.AAD is disabled for schema autogeneration so they need to manually update their schemas. @stephaniezyen for awareness.

See here for the list of RPs with schema autogen disabled:

https://github.com/Azure/azure-resource-manager-schemas/blob/main/generator/autogenlist.ts

jorgecotillo commented 2 years ago

Hi, I've tried to edit ARM template generated from Azure portal (with vscode-azurearmtools vscode extension), and there was a bunch of missing apiVersion warnings (For full schema validation, consider updating the value to one of the following ...).

Seems like 2019-04-01/deploymentTemplate.json needs an update for those.

"Microsoft.DocumentDB/databaseAccounts": 2021-05-15 "microsoft.insights/components": 2020-02-02 "microsoft.insights/components/ProactiveDetectionConfigs": 2018-05-01-preview "Microsoft.Storage/storageAccounts": 2021-04-01

@StephenWeatherford does the extension need a schema update? These RPs are onboarded into autogeneration which means they are not located directly under 2019-04-01/deploymentTemplate.json, instead these autogenerated schemas are referenced here:

https://github.com/Azure/azure-resource-manager-schemas/blob/fb30570ffa0d01844ddaa9633e1767849ed72b89/schemas/2019-04-01/deploymentTemplate.json#L1898

And I can see these RPs referenced in autogeneratedResources.json:

https://raw.githubusercontent.com/Azure/azure-resource-manager-schemas/main/schemas/common/autogeneratedResources.json

chunliu commented 2 years ago

When can we expect a fix on this?

StephenWeatherford commented 2 years ago

I'll be releasing a new version in the next week or so, we'll see if that fixes it.

StephenWeatherford commented 2 years ago

Should release next week.

image image image image
StephenWeatherford commented 2 years ago

https://github.com/microsoft/vscode-azurearmtools/pull/1482

StephenWeatherford commented 2 years ago

Okay, not everything is fixed.

WORKING: "Microsoft.DocumentDB/databaseAccounts" "microsoft.insights/components" "microsoft.insights/components/ProactiveDetectionConfigs" "Microsoft.Storage/storageAccounts"

@jorgecotillo Here are some that are still missing:

Microsoft.AAD/domainServices: Missing 2021-05-01 Microsoft.Network/virtualNetworks: latest is 2020-11-01, missing 2021-02-01, 2021-03-01, 2021-05-01 Microsoft.Network/networkSecurityGroups: latest in schemas is 2020-11-01, missing 2021-02-01, 2021-03-01, 2021-05-01

jorgecotillo commented 2 years ago

Yes, is known, @stephaniezyen is working with the respective teams to get them committed to manually update their schemas.

chunliu commented 2 years ago

@jorgecotillo The 2021-08-01 and 2021-12-01-preview of Microsoft.ApiManagement.json seems missing from the autogeneratedResources.json. I can find the versions in their corresponding source folders, but not in the https://schema.management.azure.com/schemas/common/autogeneratedResources.json. Can you please check?

StephenWeatherford commented 2 years ago

These fixes (and related) were released in ARM Tools for VS Code 0.15.7 on 5/11 (https://github.com/microsoft/vscode-azurearmtools/releases/tag/v0.15.7): "Microsoft.DocumentDB/databaseAccounts" "microsoft.insights/components" "microsoft.insights/components/ProactiveDetectionConfigs" "Microsoft.Storage/storageAccounts"

StephenWeatherford commented 1 year ago

@jorgecotillo This still ain't fixed.