For a project I'm working on, I need to define an entire Azure APIM in Bicep.
Now I want to define the request/response definitions for the developer portal, see the attached screenhot.
I've tried looking through the Azure documentation but found nothing to define these using Bicep. I have also tried exporting the APIM to ARM JSON, converting it to Bicep using az bicep decompile --file template.json, and reverse-engineering the definitions but the contents of the field Schema aren't included in the export output.
Does anyone know how to define the definitions in Bicep?
First define an schema sub-resource as defined here: https://learn.microsoft.com/en-us/azure/templates/microsoft.apimanagement/service/apis/schemas then use the schema’s resourceID in operations’ schemaId property.
Related
What is the use of the highlighted part in the Azure ARM Templates' JSON structure? Where does the resource use it?
Resource manager ignores the metadata at the time of deployment. This is just for you to share the more information about the template and its resources with other developers.
From this link:
You can add a metadata object almost anywhere in your template.
Resource Manager ignores the object, but your JSON editor may warn you
that the property isn't valid. In the object, define the properties
you need.
A caveat here is when you define metadata with description property for your template parameters. When you deploy the template through Azure Portal, the description is shown as a tool tip for that parameter.
I have already installed my azure environment with a VM, a storage account and a data base server, and it works fine, but now i want to export the ARM template in order to automate the whole proccess to my customers. The problem is that when exporting this message shows up:
error
So the question is how do i export an ARM template correctly from Azure with all my resources without having to do much fixing my final template?
that is expected. some resource types cannot be exported. you'd have to take a look at the api definition and use that to export those (say at resources.azure.com)
Simple: use bicep. Azure Resource Manager's transpiler (it's a sweeter syntax that solves your needs)
In Bicep the directive you're looking for in your Azure Resource Manager "ARM" template is keyword "existing"
https://github.com/Azure/bicep/blob/main/docs/tutorial/05-loops-conditions-existing.md
keyword "existing" lets you reference a resource without a complete definition.
Otherwise you need to provide the entire ARM definition for the object.
Export failures per resource type occur when a given resource types schema is not available. We are looking into how we can autogenerate schemas for Azure resource providers and onboarding them to this new process, improving the overall success of the Export Template API.
I'm deploying an Azure Functions App using an ARM template and want to disable ftp/ftps access.
The setting is easy to find in the portal:
How do I find the property or app setting for this so I can configure it in the json ARM template?
I've already tried
Reviewing Microsoft documentation
Running PowerShell commands Get-AzureRmResource and Get-AzureRmWebApp to explore the returned site objects
Searching for the property in the Azure Resource Explorer
Guessing the property name and testing deployments--trial and error
I would expect the setting to exist along with similar settings in the siteConfig:
The property you are looking for is ftpsState. Here are the possible values:
AllAllowed (that's the default)
FtpsOnly
Disabled
I have a set of resources and want to deploy them using Template Deployment feature in Azure portal. In my parameters file, I have few references to parameters in Key Vault as mentioned here. When deploying the template in Azure portal (clicking on Deploy a custom template) and supplying these values, the portal still asks for these parameters explicitly which I definitely cannot provide in plain text.
When using the same resources.json and parameters.json file in powershell, it works fine.Is the feature of KeyVault references currently not supported in Template Deployment done through portal ?
Yes, this is the case, but you can workaround that by wrapping you template with another template and that template will "get" the reference and pass it to the actual template.
reference: https://github.com/4c74356b41/bbbb-is-the-word/blob/master/_arm/parent.json#L151
I am trying my hands on over Azure Resource manager templates.
So for making any new resource I am trying to find out which all parameters are required and if they are mandatory or optional. But couldn't get any documentation for same.
I am looking for documentation which is somewhat similar to AWS. To get better in sites about the resources.
Thanks in advance!!
EDIT
I am not looking for parameters in general which are passed to the template. What I want is the resources parameters. The parameters which are given under the properties tag of every resource
Example-
In the below resource "virtualNetworks" there are resource parameters like addressSpace, subnets.
virtualNetworks
This should help you.
It is the schema for deployment templates. Within it, there are schemas for every type of resource that can be put into an arm template. For example, if we look at the schema for Virtual Machines, it contains all the available properties, profiles, extensions, what is required or not, etc.
However, it shouldn't be necessary for you to really look at this and learn it. When you are creating your arm template in visual studio, intellisense should kick in and show you whether what you are putting in the template is valid or not. For example, here I am editing the properties of a public IP, and it shows me what the available properties to add are.
you are right, there is a lack of documentation for resources and required parameters.
My advice is:
Check the Azure-Quickstart Templates, more than enough examples: Quickstart Templates
Since some days you can export ARM Templates from the Azure Portal. So create your resource in portal and export the Templates & Parameters: Microsoft Blog
Check the resource Explorer: Resource Explorer