I have requirement to update a ADF linked service configuration by API(or any other way through code, except using UI). I need to add 'init scripts' in the job cluster configuration of a linked service.
I got some Microsoft documentation on this, but it is only for creating a linked service, not for editing it.
Please let me know if you have any leads on this.
You can update ADF linked Service configuration by API.
Sample Request
PUT https://management.azure.com/subscriptions/12345678-1234-1234-1234-12345678abc/resourceGroups/exampleResourceGroup/providers/Microsoft.DataFactory/factories/exampleFactoryName/linkedservices/exampleLinkedService?api-version=2018-06-01
Request body
{
"properties": {
"type": "AzureStorage",
"typeProperties": {
"connectionString": {
"type": "SecureString",
"value": "DefaultEndpointsProtocol=https;AccountName=examplestorageaccount;AccountKey=<storage key>"
}
},
"description": "Example description"
}
}
In this link Sample Request and Request body are given.
For example, If you want to update AzureBlobStorage LinkedService, You can update configurations given here
We use a PowerShell module azure.datafactory.tools for deployments of ADF components.
It can replace a Linked Service with a new definition. Furthermore, you can test the deployed Linked Service with the module.
Related
I have followed this MS documentation, to create the following github "Managed App" sample. I have proven it works, because I can successfully execute the following steps:
Open my subscription (the one containing the managed app
definition).
Select "Resources".
Select "StorageApp" (which is my
custom name of my managed app). The managed app custom "StorageApp" blade opens.
Select "Deploy".
However, according to additional MS documentation, I should also be able to find my managed application by selecting "create new resource" and then choosing from the "Service Catalog Managed Application" interface. When I attempt to do that, and select "Create"...I am given the following message:
You don't have any service catalog definitions available yet. To add a service catalog definition, please see service catalog getting started.
That message is incorrect. The aforementioned custom "StorageApp" is indeed working (as stated above) - and thus should be part of my service catalog definition. Why am I unable to see it? Having followed the documentation, I am "Owner" of the resource group to which my managed app definition belongs...I would think that this entitles me to see it appear in the service catalog.
Is there some kind of Azure Service Catalog "registration" step for Managed Apps that the documentation isn't mentioning? Or perhaps I have a type of subscription that does not allow use of the Service Catalog, which the documentation didn't explain?
The link provided by the error message outlines five essential steps that must be completed. Those steps are as follows and, by using the aforementioned github Managed App sample that Microsoft supplied, I have completed all of them:
Create ARM template which defines the resources.
Define user interface elements for Azure portal.
Create zip package containing both of the above.
Decide which user, group, or app needs access to the resource group in the user's subscription. [See caveat below]
Create managed application definition.
The only step where I could imagine something being wrong, is step 4. The "resource group in the user's subscription" is a vague statement. Presumably there is no "resource group in the user's subscription" until AFTER the managed app is deployed. Nevertheless, per instructions, there is only one defined resource group to apply this rule to. Namely, the resource group into which the Managed App Definition itself was created. I am the "Owner" of that resource group, so assuredly that is sufficient permission to see it listed.
What am I doing wrong?
For the sake of reference, when I successfully create my managed app definition from the Azure Cloud Shell, this is the output that is provided:
{
"artifacts": [
{
"name": "ApplicationResourceTemplate",
"type": "Template",
"uri": "https://prdsapplianceprodbl01.blob.core.windows.net/applicationdefinitions/8B3AF_DCC89FF251A04A29A2B22A03A34D8474_2FB5E19B164254D69C0312247435EFA170C8BF604673BD8F38FB35C648EDF21D/717c7a71e1c74c4da0727b53b6593e14/applicationResourceTemplate.json"
},
{
"name": "CreateUiDefinition",
"type": "Custom",
"uri": "https://management.azure.com/subscriptions/dcc89ff2-51a0-4a29-a2b2-2a03a34d8474/resourceGroups/msdocs-managed-rg/providers/Microsoft.Solutions/applicationDefinitions/StorageApp/applicationArtifacts/CreateUiDefinition?api-version=2017-09-01"
},
{
"name": "MainTemplateParameters",
"type": "Custom",
"uri": "https://management.azure.com/subscriptions/dcc89ff2-51a0-4a29-a2b2-2a03a34d8474/resourceGroups/msdocs-managed-rg/providers/Microsoft.Solutions/applicationDefinitions/StorageApp/applicationArtifacts/MainTemplateParameters?api-version=2017-09-01"
}
],
"authorizations": [
{
"principalId": "b306aac2-af03-4763-88b5-5eb0bd2c0840",
"roleDefinitionId": "8e3af657-a8ff-443c-a75c-2fe8c4bcb635"
}
],
"createUiDefinition": null,
"description": "Managed Azure Storage Account",
"displayName": "Managed Storage Account",
"id": "/subscriptions/dcc89ff2-51a0-4a29-a2b2-2a03a34d8474/resourceGroups/msdocs-managed-rg/providers/Microsoft.Solutions/applicationDefinitions/StorageApp",
"identity": null,
"isEnabled": "True",
"location": "eastus",
"lockLevel": "ReadOnly",
"mainTemplate": null,
"managedBy": null,
"name": "StorageApp",
"packageFileUri": null,
"resourceGroup": "msdocs-managed-rg",
"sku": null,
"tags": null,
"type": "Microsoft.Solutions/applicationDefinitions"
}
I was trying to create a yml pipeline with Pipeline - Create Azure DevOps REST API and it was throwing an exception 'No pool was specified' even though I have mentioned pool in the yml file. More details of this issue is available here.
Please find below, the request body used for creating pipeline.
{
"folder": "",
"name": "pipeline-by-api",
"configuration": {
"type": "yaml",
"path": "/azure-pipelines.yml",
"repository": {
"id": "00000000-0000-0000-0000-000000000000",
"name": "repo-by-api",
"type": "azureReposGit"
}
}
Then I identified a second REST API, Definitions - Create and using this I was able to successfully create a pipeline. Please find below the request body used for creating build definition.
{
"process":{
"yamlFilename": "azure-pipelines.yml"
},
"queue":{
"pool":{
"name": "Azure Pipelines"
}
},
"repository": {
"id": "00000000-0000-0000-0000-000000000000",
"type": "TfsGit",
"name": "repo-by-api",
"defaultBranch": "refs/heads/master"
},
"name": "pipeline-by-api",
"path": "\\API-Test",
"type": "build",
"queueStatus": "enabled"
}
I would like to understand what's the difference between the two. I have tried Definitions - Create as Pipelines - Create was not working for me. But is this a correct way of creating pipeline?
Definitions - Create is an older endpoint. It was availabe before YAML pipeline becomes first class citizens. Pipelines - Create is a new endpoint suited for YAML pipelines. Both can be used to create pipeline and if you change API version to 4.1 you will see that Pipelines is not available.
If I have to guess, they find a reason to create a new endpoint for handling yaml pipelines, probably to avoid some breaking changes, but this is only a guess.
I am using Azure function hosted in premium plan. I want to enable runtime scale monitoring using ARM template.
Screenshot is attached for setting.
Please suggest how can I enable this setting via ARM.
If you click on the "Learn More" link in your screenshot it will take you to a doc that describes how to do it via CLI. That command is setting a property in web config named functionsRuntimeScaleMonitoringEnabled to true. So in your template you would do the same. How depends a bit on how your template is setting config -- it could be on the webApp itself or on a child resource of type Microsoft.Web/sites/config.
{
"type": "Microsoft.Web/sites/config",
"apiVersion": "2019-08-01",
"name": "foo",
"location": "...",
"properties": {
"...": "...",
"functionsRuntimeScaleMonitoringEnabled": true
}
}
Note that ARM is declarative so you can't use that example literally as it will wipe all of your other settings. You need to fill in the ... accordingly.
That help?
I've created the ARM template for Azure API Management deployment. In order to enable its REST API I need to select the Enable API Management REST API checkbox in Azure Portal as explained here. I'd like to activate this option within the ARM template but I'm unable to find which resource to add/modify in my template to achieve it.
This one https://learn.microsoft.com/en-us/rest/api/apimanagement/2019-01-01/tenantaccess/update. In general whatever Azure portal does it does through same public API used by templates. So usually you can open browser dev console and see what call is being made behind the scenes.
If anyone is still looking for an answer, the below template does the job of enabling Management REST API in Azure APIM
{
"type": "Microsoft.ApiManagement/service/tenant",
"apiVersion": "2020-06-01-preview",
"name": "[concat(parameters('ApimServiceName'), '/access')]",
"dependsOn": [
"[resourceId('Microsoft.ApiManagement/service', parameters('ApimServiceName'))]"
],
"properties": {
"enabled": true
}
}
I have generated template from existing Azure API management resource, modified it a bit, and tried to deploy using Azure CLI. But I'm getting the following error:
Deployment failed. Correlation ID: 7561a68f-54d1-4370-bf6a-175fd93a4b99. {
"error": {
"code": "MethodNotAllowed",
"message": "System group membership cannot be changed",
"details": null
}
}
But all the APIs are getting created and working fine. Can anyone help me solve the error. This is the command I tried to deploy in my ubuntu machine:
az group deployment create -g XXXX --template-file azuredeploy.json --parameters #param.json
Service Group Template:
{
"type": "Microsoft.ApiManagement/service/groups",
"apiVersion": "2018-06-01-preview",
"name": "[concat(parameters('service_name'), '/administrators')]",
"dependsOn": [
"[resourceId('Microsoft.ApiManagement/service', parameters('service_name'))]"
],
"properties": {
"displayName": "Administrators",
"description": "Administrators is a built-in group. Its membership is managed by the system. Microsoft Azure subscription administrators fall into this group.",
"type": "system"
}
}
You have several options if you want to copy an API Management instance to a new instance. Using the template is not listed here.
Use the backup and restore function in API Management. For more information, see How to implement disaster recovery by using service backup and restore in Azure API Management.
Create your own backup and restore feature by using the API Management REST API. Use the REST API to save and restore the entities from the service instance that you want.
Download the service configuration by using Git, and then upload it to a new instance. For more information, see How to save and configure your API Management service configuration by using Git.
Update:
I have Confirmed with Microsoft engineer that ARM template deployment for APIM failed is an known issue and is planning to fix it.(5/7/2019)