Azure - Run bicep from registry via ARM REST api - azure

I'm looking into publishing bicep templates to a Bicep registry (ACR), and then deploying them via the ARM REST api. However the REST create deployment api only allows me to specify a templateSpec - I don't see any way to reference an ACR url. Is this possible, or do I need to use template specs for this?
For context, I need to create an automated service that can deploy resources when a particular event happens, e.g. add new customer -> spin up Azure resources xyz. Having my service use the REST api seems reasonable, and I'd prefer to use the bicep registry over template specs.

Currently Content in the Bicep module registry can only be deployed from another Bicep file. Template specs can be deployed directly from the API, Azure PowerShell, Azure CLI, and the Azure portal. You can even use UiFormDefinition to customize the portal deployment experience.
You can refer to this documentation for more information.

Related

Get Azure Databricks URL using Terrafrom

In Dev environment, I deploy Azure DataBricks using Terrafrom and can get the URL using workspace_url https://www.terraform.io/docs/providers/azurerm/r/databricks_workspace.html. But in production, I have to deploy the entire infrastructure through terraform and only Azure Databricks through ARM (this is the company's policy). ut when I use data.azurerm_databricks_workspace.example, for example, I get an error that there is no way to use azurerm_databricks_workspace in data. Tell me how can I get workspace_url and use it in Terrafrom. Thanks.
When going through sources of Databricks Labs Terraform provider, you can find reference to workspace properties endpoint, which would have workspaceUrl in properties field. So if you call https://management.azure.com/subscriptions/<uui>/resourceGroups/<resource-group-name>/providers/Microsoft.Databricks/workspaces/<workspace-name> with management AAD JWT token, you should be able to retrieve workspace URL.
I'm not sure if it's exposed to ARM Templates, though Azure CLI does expose it.

How to create an Azure WebJob using terraform?

I am looking for an example on how to create an Azure Webjob inside an Azure Webapp in Azure but I was no able to find anything online. Does anyone know how to create one?
When Terraform definitions do not exist for Azure resources, you can utilize azurerm_template_deployment to deploy ARM templates.
For your case, looks like the WebJob ARM template can be deployed by azurerm_template_deployment.

azure webhook creation using terraform

I have created an Azure automation account and deploy a runbook using terraform. I want to publish a runbook through webhook. But in terraform, there is no such a module found for webhook.
Is there any way to create a webhook using terraform? I search on many URLs but I didn't find any useful option.
As far as I know, there is no built-in terraform block to create a webhook. As a workaround, you can create it via ARM template or create Webhook using Rest API. Read Programmatically Creating Azure Automation Runbook Webhooks Targeting Hybrid Worker Groups for more details.
You can also use azurerm_template_deployment to manage the deployment of the ARM Template with terraform. Read this blog for more reference.

Creating Azure Bot Service using ARM template

I have tried creating with the Azure Bot Service and using the default ARM template generated in Azure, but it is just creating the resource.
Can I create an ARM template which will also configure Azure Bot Service with the following?
Language to be used for development (C# or NodeJS).
Associate the Microsoft App ID and App Password.
Template to be used, such as Basic, Dialog, LUIS or Proactive bot.
LUIS Integration.
It would help to create a new environment in Azure easily through templates.
Also I can use the template in DevOps VSTS release step, so that I can automate the deployment process.
Currently there are no officially supported prebuilt ARM Templates available.
Reference Github. But what can be done is, deploy the resources manually from the azure portal and navigate to resourceGroup Homepage -> Automation Script and grab the template from there and modify it as needed.

Azure Resource Group template for Cloud Service and Notification Hub

I'm trying to create Azure Resource Group template for an application consisting of: Cloud Service (with single WebRole), Notification Hub, Azure Storage and Azure SQL.
I started in VS2013 by creating AzureResourceGroup project and using the JSON Outline i can add storage and SQL resources. But Cloud Service and Notification Hub is missing in Add Resource dialog. What is the schema for them? What is the best way to add them to the template?
Edit: I found schema for NotificatonHubs here and was able to add template for it. Still don't know how to define the Cloud Service.
Cloud Services are in a "private preview" on ARM so we won't have snippets in VS until it goes public. I think that you have to be whitelisted as part of the preview to deploy at the moment... (i.e. the deployment will fail if you're not whitelisted)

Resources