Related
How do I convert my value to an integer?
Here's added context if helpful:
My pipeline should get the column count of a blob CSV and pass that count to a ForEach activity. A switch activity is embedded in ForEach, but the pipeline is failing at ForEach with this error: 'The function 'length' expects its parameter to be an array or a string. The provided value is of type 'Integer'.
Metadata output:
{
"columnCount": 52,
"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (Central US)",
"executionDuration": 1,
"durationInQueue": {
"integrationRuntimeQueue": 0
},
"billingReference": {
"activityType": "PipelineActivity",
"billableDuration": [
{
"meterType": "AzureIR",
"duration": 0.016666666666666666,
"unit": "Hours"
}
]
}
}
ForEach input:
{
"items": "#activity('Get Metadata1').output.columnCount",
"activities": [
{
"name": "Switch1",
"type": "Switch",
"dependsOn": [],
"userProperties": [],
"typeProperties": {
"on": "#item()",
"cases": [
{
"value": "44",
"activities": [
{
"name": "Copy data1_copy1",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": false,
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "AzureSqlSink",
"writeBehavior": "insert",
"sqlWriterUseTableLock": false
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
},
"inputs": [
{
"referenceName": "ten_eighty_split_CSV",
"type": "DatasetReference",
"parameters": {
"FileName": "#pipeline().parameters.SourceFile"
}
}
],
"outputs": [
{
"referenceName": "ten_eighty_split_10_15_SQL",
"type": "DatasetReference",
"parameters": {}
}
]
}
]
},
{
"value": "52",
"activities": [
{
"name": "Copy data2_copy1",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": false,
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "AzureSqlSink",
"writeBehavior": "insert",
"sqlWriterUseTableLock": false
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
},
"inputs": [
{
"referenceName": "ten_eighty_split_CSV",
"type": "DatasetReference",
"parameters": {
"FileName": "#pipeline().parameters.SourceFile"
}
}
],
"outputs": [
{
"referenceName": "ten_eighty_split_15_20_SQL",
"type": "DatasetReference",
"parameters": {}
}
]
}
]
},
{
"value": "60",
"activities": [
{
"name": "Copy data3_copy1",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": false,
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "AzureSqlSink",
"writeBehavior": "insert",
"sqlWriterUseTableLock": false
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
},
"inputs": [
{
"referenceName": "ten_eighty_split_CSV",
"type": "DatasetReference",
"parameters": {
"FileName": "#pipeline().parameters.SourceFile"
}
}
],
"outputs": [
{
"referenceName": "ten_eighty_split_25_30_SQL",
"type": "DatasetReference",
"parameters": {}
}
]
}
]
},
{
"value": "68",
"activities": [
{
"name": "Copy data4_copy1",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": false,
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "AzureSqlSink",
"writeBehavior": "insert",
"sqlWriterUseTableLock": false
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
},
"inputs": [
{
"referenceName": "ten_eighty_split_CSV",
"type": "DatasetReference",
"parameters": {
"FileName": "#pipeline().parameters.SourceFile"
}
}
],
"outputs": [
{
"referenceName": "ten_eighty_split_30_35_SQL",
"type": "DatasetReference",
"parameters": {}
}
]
}
]
}
]
}
}
]
}
ForEach output:
{}
Not sure how to satisfy this error. Thanks!
Failure type: User configuration issue
Details: The function 'length' expects its parameter to be an array or a string. The provided value is of type 'Integer'.
Since you use an integer value (columnCount) as an input to for-each activity, you are getting this error. If you have array of values and you want to iterate the activity based on each value of array, you can use for-each activity. In this case, you can use the switch case activity directly after get metadata activity. In Switch activity, expression is given within braces {...} .
Expression:
#{activity('Get Metadata1').output.columnCount}
I tried this in my environment and got the same error when I give the expression without braces {..}. When {} are added, it worked. Below are the steps.
Get MetaData activity is taken and column count is taken as an argument.
Output of MetaData activity:
{
"columnCount": 2,
"effectiveIntegrationRuntime": "AutoResolveIntegrationRuntime (West US)",
"executionDuration": 1,
"durationInQueue": {
"integrationRuntimeQueue": 0
},
"billingReference": {
"activityType": "PipelineActivity",
"billableDuration": [
{
"meterType": "AzureIR",
"duration": 0.016666666666666666,
"unit": "Hours"
}
]
}
}
Then Switch activity is taken and expression and case are given.
Expression: #{activity('Get Metadata1').output.columnCount}
When pipeline is debugged, it got executed successfully without error.
Here is how I'm initializing the Checkout Process in Node.js.
let email = req.body.email
let product_id = req.body.product_id
let YOUR_DOMAIN = 'http://localhost:8000'
const session = await stripe.checkout.sessions.create({
line_items: [{
price: product_id,
adjustable_quantity: {
enabled: true,
minimum: 1,
maximum: 5,
},
quantity: 1,
}],
customer_email: email,
mode: 'payment',
success_url: `${YOUR_DOMAIN}/payment-success`,
cancel_url: `${YOUR_DOMAIN}/payment-failure`,
});
Here are the events I have subscribed to in Webhooks
payment_intent.succeeded
checkout.session.completed
Object Received in Payment Intent Succeeded
{
"id": "evt_1KEqIxI5cib7rtVMoKMkak96",
"object": "event",
"api_version": "2020-03-02",
"created": 1641453754,
"data": {
"object": {
"id": "pi_1KEqIeI5cib7rtVMcz8zsXys",
"object": "payment_intent",
"amount": 59700,
"amount_capturable": 0,
"amount_received": 59700,
"application": null,
"application_fee_amount": null,
"automatic_payment_methods": null,
"canceled_at": null,
"cancellation_reason": null,
"capture_method": "automatic",
"charges": {
"object": "list",
"data": [{
"id": "ch_1KEqIvI5cib7rtVMYUVn5gfQ",
"object": "charge",
"amount": 59700,
"amount_captured": 59700,
"amount_refunded": 0,
"application": null,
"application_fee": null,
"application_fee_amount": null,
"balance_transaction": "txn_1KEqIwI5cib7rtVMGfJlEahg",
"billing_details": {
"address": {
"city": "NY",
"country": "US",
"line1": "sada",
"line2": "asd",
"postal_code": "10001",
"state": "NY"
},
"email": "test#gmail.com",
"name": "John Doe",
"phone": null
},
"calculated_statement_descriptor": "VIDEOFORM",
"captured": true,
"created": 1641453753,
"currency": "usd",
"customer": "cus_KufeYc1hifvZGA",
"description": null,
"destination": null,
"dispute": null,
"disputed": false,
"failure_code": null,
"failure_message": null,
"fraud_details": {},
"invoice": null,
"livemode": false,
"metadata": {},
"on_behalf_of": null,
"order": null,
"outcome": {
"network_status": "approved_by_network",
"reason": null,
"risk_level": "normal",
"risk_score": 25,
"seller_message": "Payment complete.",
"type": "authorized"
},
"paid": true,
"payment_intent": "pi_1KEqIeI5cib7rtVMcz8zsXys",
"payment_method": "pm_1KEqIuI5cib7rtVMYPWlLV8S",
"payment_method_details": {
"card": {
"brand": "visa",
"checks": {
"address_line1_check": "pass",
"address_postal_code_check": "pass",
"cvc_check": "pass"
},
"country": "US",
"exp_month": 1,
"exp_year": 2023,
"fingerprint": "QaiTi5PATFO8ZoC3",
"funding": "credit",
"installments": null,
"last4": "4242",
"mandate": null,
"network": "visa",
"three_d_secure": null,
"wallet": null
},
"type": "card"
},
"receipt_email": null,
"receipt_number": null,
"receipt_url": "https://pay.stripe.com/receipts/acct_1GhUSuI5cib7rtVM/ch_1KEqIvI5cib7rtVMYUVn5gfQ/rcpt_KufeysPW3LD8Yu47q14iYOIIlcGth9h",
"refunded": false,
"refunds": {
"object": "list",
"data": [],
"has_more": false,
"total_count": 0,
"url": "/v1/charges/ch_1KEqIvI5cib7rtVMYUVn5gfQ/refunds"
},
"review": null,
"shipping": null,
"source": null,
"source_transfer": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}],
"has_more": false,
"total_count": 1,
"url": "/v1/charges?payment_intent=pi_1KEqIeI5cib7rtVMcz8zsXys"
},
"client_secret": "pi_1KEqIeI5cib7rtVMcz8zsXys_secret_uZwm3uziwfaWePgTHENYXeraD",
"confirmation_method": "automatic",
"created": 1641453736,
"currency": "usd",
"customer": "cus_KufeYc1hifvZGA",
"description": null,
"invoice": null,
"last_payment_error": null,
"livemode": false,
"metadata": {},
"next_action": null,
"on_behalf_of": null,
"payment_method": "pm_1KEqIuI5cib7rtVMYPWlLV8S",
"payment_method_options": {
"card": {
"installments": null,
"mandate_options": null,
"network": null,
"request_three_d_secure": "automatic"
}
},
"payment_method_types": ["card"],
"processing": null,
"receipt_email": null,
"review": null,
"setup_future_usage": null,
"shipping": null,
"source": null,
"statement_descriptor": null,
"statement_descriptor_suffix": null,
"status": "succeeded",
"transfer_data": null,
"transfer_group": null
}
},
"livemode": false,
"pending_webhooks": 3,
"request": {
"id": "req_Y87umQuitz9WCc",
"idempotency_key": "a4b6af76-73d8-49b4-8393-9017e673af7e"
},
"type": "payment_intent.succeeded"
}
Object Received in Checkout Session Completed
{
"id": "evt_1KEqQOI5cib7rtVMRwAHWDvV",
"object": "event",
"api_version": "2020-03-02",
"created": 1641454214,
"data": {
"object": {
"id": "cs_test_a1AQ9EKIaxi8dXFAJzZ86xYm5meRkWb9Vu0eLowfkiKgUO4cyToooBzSTd",
"object": "checkout.session",
"after_expiration": null,
"allow_promotion_codes": null,
"amount_subtotal": 59700,
"amount_total": 59700,
"automatic_tax": {
"enabled": false,
"status": null
},
"billing_address_collection": null,
"cancel_url": "http://localhost:8000/payment-failure",
"client_reference_id": null,
"consent": null,
"consent_collection": null,
"currency": "usd",
"customer": "cus_Kuflo6N0n4HTzL",
"customer_details": {
"email": "test#gmail.com",
"phone": null,
"tax_exempt": "none",
"tax_ids": []
},
"customer_email": "test#gmail.com",
"expires_at": 1641540596,
"livemode": false,
"locale": null,
"mode": "payment",
"payment_intent": "pi_1KEqQ4I5cib7rtVMyND6NhQG",
"payment_method_options": {},
"payment_method_types": ["card"],
"payment_status": "paid",
"phone_number_collection": {
"enabled": false
},
"recovered_from": null,
"setup_intent": null,
"shipping": null,
"shipping_address_collection": null,
"shipping_options": [],
"shipping_rate": null,
"status": "complete",
"submit_type": null,
"subscription": null,
"success_url": "http://localhost:8000/payment-success",
"total_details": {
"amount_discount": 0,
"amount_shipping": 0,
"amount_tax": 0
},
"url": null
}
},
"livemode": false,
"pending_webhooks": 4,
"request": {
"id": null,
"idempotency_key": null
},
"type": "checkout.session.completed"
}
I'm unable to figure out how to get the Product ID and the Quantity. Could anyone suggest the right approach here?
You can find the Product and the quantity from the Checkout Session by using expand on the line_items property. The code should look like this.
// In "checkout.session.completed" event handler, get the ID of the Checkout Session
const id = event.data.object.id; // "cs_xxx"
// Retrieve the Checkout Session with expand
const session = await stripe.checkout.sessions.retrieve(id, {
expand: [ "line_items" ]
});
// Get the quantity
console.log(session.line_items.data[0].quantity);
// Get the product ID
console.log(session.line_items.data[0].price.product);
I want to copy 2 tables from blob storage to SQL Database.
I created pipeline like this:-
Get MetaData:- For capturing the files (2 csv files) in the input container
ForEach:- For iterating the files in input container
Copy activity:- Inside the ForEach. Copy both of the files in SQL database.
Now, when I started debugging, I got the error 2200 and it says userBlobDoesNotExists.
Here is the error code for the copy activity:-
"copyDuration": 3,
"errors": [
{
"Code": 9013,
"Message": "ErrorCode=UserErrorSourceBlobNotExist,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The required Blob is missing. ContainerName: https://employeestorage1.blob.core.windows.net/employeeinput, path: employeeinput/workdetail.csv.,Source=Microsoft.DataTransfer.ClientLibrary,'",
"EventType": 0,
"Category": 5,
"Data": {},
"MsgId": null,
"ExceptionType": null,
"Source": null,
"StackTrace": null,
"InnerEventInfos": []
}
],
"effectiveIntegrationRuntime": "DefaultIntegrationRuntime (East US)",
"usedDataIntegrationUnits": 4,
"billingReference": {
"activityType": "DataMovement",
"billableDuration": [
{
"meterType": "AzureIR",
"duration": 0.06666666666666667,
"unit": "DIUHours"
}
]
},
"usedParallelCopies": 1,
"executionDetails": [
{
"source": {
"type": "AzureBlobStorage",
"region": "East US"
},
"sink": {
"type": "AzureSqlDatabase",
"region": "East US"
},
"status": "Failed",
"start": "2021-06-24T17:28:09.4507134Z",
"duration": 3,
"usedDataIntegrationUnits": 4,
"usedParallelCopies": 1,
"profile": {
"queue": {
"status": "Completed",
"duration": 2
},
"transfer": {
"status": "Completed",
"duration": 0
}
},
"detailedDurations": {
"queuingDuration": 2,
"transferDuration": 0
}
}
],
"dataConsistencyVerification": {
"VerificationResult": "Unsupported"
},
"durationInQueue": {
"integrationRuntimeQueue": 0
}
}
And here is the code for the pipeline:-
{
"name": "pipeline1",
"properties": {
"activities": [
{
"name": "inputfolder",
"type": "GetMetadata",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"dataset": {
"referenceName": "employeeinputdataset",
"type": "DatasetReference"
},
"fieldList": [
"childItems"
],
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
}
},
{
"name": "for each table in input folder",
"type": "ForEach",
"dependsOn": [
{
"activity": "inputfolder",
"dependencyConditions": [
"Succeeded"
]
}
],
"userProperties": [],
"typeProperties": {
"items": {
"value": "#activity('inputfolder').output.Childitems",
"type": "Expression"
},
"activities": [
{
"name": "Copy data1",
"type": "Copy",
"dependsOn": [],
"policy": {
"timeout": "7.00:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"source": {
"type": "DelimitedTextSource",
"storeSettings": {
"type": "AzureBlobStorageReadSettings",
"recursive": true,
"wildcardFolderPath": "employeeinput",
"wildcardFileName": {
"value": "#item().name",
"type": "Expression"
},
"enablePartitionDiscovery": false
},
"formatSettings": {
"type": "DelimitedTextReadSettings"
}
},
"sink": {
"type": "AzureSqlSink",
"tableOption": "autoCreate",
"disableMetricsCollection": false
},
"enableStaging": false,
"translator": {
"type": "TabularTranslator",
"typeConversion": true,
"typeConversionSettings": {
"allowDataTruncation": true,
"treatBooleanAsNumber": false
}
}
},
"inputs": [
{
"referenceName": "employeeinputdataset",
"type": "DatasetReference"
}
],
"outputs": [
{
"referenceName": "employeeoutputsql",
"type": "DatasetReference",
"parameters": {
"OutputTableName": {
"value": "#item().name",
"type": "Expression"
}
}
}
]
}
]
}
}
],
"annotations": []
}
}
Don't choose Wildcard file path in the File path type setting, please choose File path in dataset to have a try.
And you need to create a parameter in your Source dataset. In the File path of Source dataset, type the #dataset().fileName expression. Finally, pass #item().name to the parameter of dataset is ok.
Screenshots:
I create release definitions using DevOps REST APIs. Due to lack of documentation I used to capture HTTP requests and examine JSON payload.
I'm able to set a release using Azure agent pools. It follows only the relevant node:
"deploymentInput": {
"parallelExecution": {
"parallelExecutionType": 0
},
"agentSpecification": {
"identifier": "windows-2019"
},
"skipArtifactsDownload": false,
"artifactsDownloadInput": {},
"queueId": 749,
"demands": [],
"enableAccessToken": false,
"timeoutInMinutes": 0,
"jobCancelTimeoutInMinutes": 1,
"condition": "succeeded()",
"overrideInputs": {},
"dependencies": []
}
I want to set a custom defined agent pool, but if I try to capture the request I still can't undertand how to set it. This is the full JSON of an empty release with custom agent set:
{
"id": 0,
"name": "New release pipeline",
"source": 2,
"comment": "",
"createdOn": "2020-10-31T10:02:19.034Z",
"createdBy": null,
"modifiedBy": null,
"modifiedOn": "2020-10-31T10:02:19.034Z",
"environments": [
{
"id": -1,
"name": "Stage 1",
"rank": 1,
"variables": {},
"variableGroups": [],
"preDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false,
"id": 0
}
],
"approvalOptions": {
"executionOrder": 1
}
},
"deployStep": {
"tasks": [],
"id": 0
},
"postDeployApprovals": {
"approvals": [
{
"rank": 1,
"isAutomated": true,
"isNotificationOn": false,
"id": 0
}
],
"approvalOptions": {
"executionOrder": 2
}
},
"deployPhases": [
{
"deploymentInput": {
"parallelExecution": {
"parallelExecutionType": 0
},
"agentSpecification": null,
"skipArtifactsDownload": false,
"artifactsDownloadInput": {},
"queueId": 1039,
"demands": [],
"enableAccessToken": false,
"timeoutInMinutes": 0,
"jobCancelTimeoutInMinutes": 1,
"condition": "succeeded()",
"overrideInputs": {},
"dependencies": []
},
"rank": 1,
"phaseType": 1,
"name": "Agent job",
"refName": null,
"workflowTasks": [],
"phaseInputs": {
"phaseinput_artifactdownloadinput": {
"artifactsDownloadInput": {},
"skipArtifactsDownload": false
}
}
}
],
"runOptions": {},
"environmentOptions": {
"emailNotificationType": "OnlyOnFailure",
"emailRecipients": "release.environment.owner;release.creator",
"skipArtifactsDownload": false,
"timeoutInMinutes": 0,
"enableAccessToken": false,
"publishDeploymentStatus": true,
"badgeEnabled": false,
"autoLinkWorkItems": false,
"pullRequestDeploymentEnabled": false
},
"demands": [],
"conditions": [
{
"conditionType": 1,
"name": "ReleaseStarted",
"value": ""
}
],
"executionPolicy": {
"concurrencyCount": 1,
"queueDepthCount": 0
},
"schedules": [],
"properties": {
"LinkBoardsWorkItems": false,
"BoardsEnvironmentType": "unmapped"
},
"preDeploymentGates": {
"id": 0,
"gatesOptions": null,
"gates": []
},
"postDeploymentGates": {
"id": 0,
"gatesOptions": null,
"gates": []
},
"environmentTriggers": [],
"owner": {
"displayName": "Giacomo Stelluti Scala",
"id": "3617734a-1751-66f2-8343-c71c1398b5e6",
"isAadIdentity": true,
"isContainer": false,
"uniqueName": "giacomo.stelluti#dev4side.com",
"url": "https://dev.azure.com/dev4side/"
},
"retentionPolicy": {
"daysToKeep": 30,
"releasesToKeep": 3,
"retainBuild": true
},
"processParameters": {}
}
],
"artifacts": [],
"variables": {},
"variableGroups": [],
"triggers": [],
"lastRelease": null,
"tags": [],
"path": "\\test-poc",
"properties": {
"DefinitionCreationSource": "ReleaseNew",
"IntegrateJiraWorkItems": "false",
"IntegrateBoardsWorkItems": false
},
"releaseNameFormat": "Release-$(rev:r)",
"description": ""
}
Where do this is agent is set? Anyone knows how to do it properly?
Any help really appreciated.
Giacomo S. S.
I've found the solution in this question.
"deploymentInput": {
"parallelExecution": {
"parallelExecutionType": 0
},
"agentSpecification": null,
"skipArtifactsDownload": false,
"artifactsDownloadInput": {},
"queueId": 1039,
"demands": [],
"enableAccessToken": false,
"timeoutInMinutes": 0,
"jobCancelTimeoutInMinutes": 1,
"condition": "succeeded()",
"overrideInputs": {},
"dependencies": []
}
agentSpecification must be null and queueId must be set.
Hello Azure gurus I am new one in Azure and ARM templates so I need Your professional help with my ARM template. I create ASE with web app and deployment slot on Azure and than exported ARM template from Azure and tried to redeploy it in another resource group, but I got an issue with deployment slot type. When I try to deploy I got an error :
Error: Code=InvalidTemplate; Message=Deployment template validation
failed: 'The template resource
'ASEv2-WEB-APP2/WEB-APP-deployment-slot1/web' at line '436' and column
'10' is not valid: Unable to evaluate template language function
'resourceId': function requires exactly one multi-segmented argument
which must be resource type including resource provider namespace.
Current function arguments
'Microsoft.Web/sites/slots,ASEv2-WEB-APP2/WEB-APP-deployment-slot1'.
Please see https://aka.ms/arm-template-expressions/#resourceid for
usage details.. Please see https://aka.ms/arm-template-expressions for
usage details.'.
Could some one tell me why I get this error.
Here is my template.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"virtualNetworks_ASEv2_VNet_name": {
"defaultValue": "ASEv2-VNet",
"type": "String"
},
"hostingEnvironments_ASE_v2_name": {
"defaultValue": "ASE-v2",
"type": "String"
},
"serverfarms_ASEv2_SERVICE_PLAN_name": {
"defaultValue": "ASEv2-SERVICE-PLAN",
"type": "String"
},
"sites_ASEv2_WEB_APP_name": {
"defaultValue": "ASEv2-WEB-APP",
"type": "String"
},
"subnets_ASE_v2_subnet_name": {
"defaultValue": "ASEv2-VNet/ASE-v2-subnet",
"type": "String"
},
"multiRolePools_default_name": {
"defaultValue": "ASE-v2/default",
"type": "String"
},
"config_web_name": {
"defaultValue": "ASEv2-WEB-APP/web",
"type": "String"
},
"hostNameBindings_asev2_web_app.ase_v2.p.azurewebsites.net_name": {
"defaultValue": "ASEv2-WEB-APP/asev2-web-app.ase-v2.p.azurewebsites.net",
"type": "String"
},
"slots_WEB_APP_deployment_slot1_name": {
"defaultValue": "ASEv2-WEB-APP/WEB-APP-deployment-slot1",
"type": "String"
},
"config_web_name_1": {
"defaultValue": "ASEv2-WEB-APP/WEB-APP-deployment-slot1/web",
"type": "String"
},
"hostNameBindings_asev2_web_app_web_app_deployment_slot1.ase_v2.p.azurewebsites.net_name": {
"defaultValue": "ASEv2-WEB-APP/WEB-APP-deployment-slot1/asev2-web-app-web-app-deployment-slot1.ase-v2.p.azurewebsites.net",
"type": "String"
}
},
"variables": {},
"resources": [
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Network/virtualNetworks/ASEv2-VNet'.",
"type": "Microsoft.Network/virtualNetworks",
"name": "[parameters('virtualNetworks_ASEv2_VNet_name')]",
"apiVersion": "2017-06-01",
"location": "northeurope",
"scale": null,
"properties": {
"provisioningState": "Succeeded",
"resourceGuid": "91980e04-c707-4acb-ab83-4283ca29fdf6",
"addressSpace": {
"addressPrefixes": [
"192.168.250.0/23"
]
},
"subnets": [
{
"name": "ASE-v2-subnet",
"etag": "W/\"1f4dca2a-e8e2-4b92-add6-72bad6aa40a9\"",
"properties": {
"provisioningState": "Succeeded",
"addressPrefix": "192.168.250.0/24",
"resourceNavigationLinks": [
{
"name": "MicrosoftWeb_HostingEnvironments_ASE-v2",
"properties": {
"linkedResourceType": "Microsoft.Web/hostingEnvironments",
"link": "[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
}
}
]
}
}
],
"virtualNetworkPeerings": []
},
"dependsOn": [
"[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/hostingEnvironments/ASE-v2'.",
"type": "Microsoft.Web/hostingEnvironments",
"kind": "ASEV2",
"name": "[parameters('hostingEnvironments_ASE_v2_name')]",
"apiVersion": "2016-09-01",
"location": "North Europe",
"tags": {},
"scale": null,
"properties": {
"name": "[parameters('hostingEnvironments_ASE_v2_name')]",
"location": "North Europe",
"vnetName": "ASEv2-VNet",
"vnetResourceGroupName": "ASEv2-test",
"vnetSubnetName": "[concat(parameters('hostingEnvironments_ASE_v2_name'),'-subnet')]",
"virtualNetwork": {
"id": "[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_ASEv2_VNet_name'))]",
"subnet": "[concat(parameters('hostingEnvironments_ASE_v2_name'),'-subnet')]"
},
"internalLoadBalancingMode": "None",
"multiSize": "Standard_D1_V2",
"multiRoleCount": 2,
"workerPools": null,
"ipsslAddressCount": 2,
"dnsSuffix": "[concat(parameters('hostingEnvironments_ASE_v2_name'),'.p.azurewebsites.net')]",
"networkAccessControlList": [],
"frontEndScaleFactor": 15,
"apiManagementAccountId": null,
"suspended": false,
"dynamicCacheEnabled": null,
"clusterSettings": null
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_ASEv2_VNet_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/serverfarms/ASEv2-SERVICE-PLAN'.",
"type": "Microsoft.Web/serverfarms",
"sku": {
"name": "I1",
"tier": "Isolated",
"size": "I1",
"family": "I",
"capacity": 1
},
"kind": "app",
"name": "[parameters('serverfarms_ASEv2_SERVICE_PLAN_name')]",
"apiVersion": "2016-09-01",
"location": "North Europe",
"scale": null,
"properties": {
"name": "[parameters('serverfarms_ASEv2_SERVICE_PLAN_name')]",
"workerTierName": null,
"adminSiteName": null,
"hostingEnvironmentProfile": {
"id": "[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
},
"perSiteScaling": false,
"reserved": false,
"targetWorkerCount": 0,
"targetWorkerSizeId": 0
},
"dependsOn": [
"[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/sites/ASEv2-WEB-APP'.",
"type": "Microsoft.Web/sites",
"kind": "app",
"name": "[parameters('sites_ASEv2_WEB_APP_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"tags": {
"hidden-related:/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourcegroups/ASEv2-test/providers/Microsoft.Web/serverfarms/ASEv2-SERVICE-PLAN": "empty"
},
"scale": null,
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "[concat(parameters('sites_ASEv2_WEB_APP_name'),'asev2-web-app.ase-v2.p.azurewebsites.net')]",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
},
{
"name": "[concat(parameters('sites_ASEv2_WEB_APP_name'),'asev2-web-app.scm.ASE-v2.p.azurewebsites.net')]",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Repository"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_ASEv2_SERVICE_PLAN_name'))]",
"reserved": false,
"siteConfig": null,
"scmSiteAlsoStopped": false,
"hostingEnvironmentProfile": {
"id": "[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
},
"clientAffinityEnabled": true,
"clientCertEnabled": false,
"hostNamesDisabled": false,
"containerSize": 0,
"dailyMemoryTimeQuota": 0,
"cloningInfo": null
},
"dependsOn": [
"[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_ASEv2_SERVICE_PLAN_name'))]",
"[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Network/virtualNetworks/ASEv2-VNet/subnets/ASE-v2-subnet'.",
"type": "Microsoft.Network/virtualNetworks/subnets",
"name": "[parameters('subnets_ASE_v2_subnet_name')]",
"apiVersion": "2017-06-01",
"scale": null,
"properties": {
"provisioningState": "Succeeded",
"addressPrefix": "192.168.250.0/24",
"resourceNavigationLinks": [
{
"name": "MicrosoftWeb_HostingEnvironments_ASE-v2",
"properties": {
"linkedResourceType": "Microsoft.Web/hostingEnvironments",
"link": "[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
}
}
]
},
"dependsOn": [
"[resourceId('Microsoft.Network/virtualNetworks', parameters('virtualNetworks_ASEv2_VNet_name'))]",
"[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/hostingEnvironments/ASE-v2/multiRolePools/default'.",
"type": "Microsoft.Web/hostingEnvironments/multiRolePools",
"sku": {
"name": "Q1",
"tier": "Quantum",
"size": "Q1",
"family": "Q",
"capacity": 2
},
"name": "[parameters('multiRolePools_default_name')]",
"apiVersion": "2016-09-01",
"location": "North Europe",
"scale": null,
"properties": {
"workerSize": "Standard_D1_V2",
"workerCount": 2,
"instanceNames": [
"192.168.250.7",
"192.168.250.6"
]
},
"dependsOn": [
"[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/sites/ASEv2-WEB-APP/config/web'.",
"type": "Microsoft.Web/sites/config",
"name": "[parameters('config_web_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"tags": {
"hidden-related:/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourcegroups/ASEv2-test/providers/Microsoft.Web/serverfarms/ASEv2-SERVICE-PLAN": "empty"
},
"scale": null,
"properties": {
"numberOfWorkers": 1,
"defaultDocuments": [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php",
"hostingstart.html"
],
"netFrameworkVersion": "v4.0",
"phpVersion": "5.6",
"pythonVersion": "",
"nodeVersion": "",
"linuxFxVersion": "",
"requestTracingEnabled": false,
"remoteDebuggingEnabled": false,
"remoteDebuggingVersion": null,
"httpLoggingEnabled": false,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": false,
"publishingUsername": "$ASEv2-WEB-APP",
"publishingPassword": null,
"appSettings": null,
"metadata": null,
"connectionStrings": null,
"machineKey": null,
"handlerMappings": null,
"documentRoot": null,
"scmType": "None",
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
"alwaysOn": false,
"javaVersion": null,
"javaContainer": null,
"javaContainerVersion": null,
"appCommandLine": "",
"managedPipelineMode": "Integrated",
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot",
"preloadEnabled": false,
"virtualDirectories": null
}
],
"winAuthAdminState": 0,
"winAuthTenantState": 0,
"customAppPoolIdentityAdminState": false,
"customAppPoolIdentityTenantState": false,
"runtimeADUser": null,
"runtimeADUserPassword": null,
"loadBalancing": "LeastRequests",
"routingRules": [],
"experiments": {
"rampUpRules": []
},
"limits": null,
"autoHealEnabled": false,
"autoHealRules": null,
"tracingOptions": null,
"vnetName": "",
"siteAuthEnabled": false,
"siteAuthSettings": {
"enabled": null,
"unauthenticatedClientAction": null,
"tokenStoreEnabled": null,
"allowedExternalRedirectUrls": null,
"defaultProvider": null,
"clientId": null,
"clientSecret": null,
"issuer": null,
"allowedAudiences": null,
"additionalLoginParams": null,
"isAadAutoProvisioned": false,
"googleClientId": null,
"googleClientSecret": null,
"googleOAuthScopes": null,
"facebookAppId": null,
"facebookAppSecret": null,
"facebookOAuthScopes": null,
"twitterConsumerKey": null,
"twitterConsumerSecret": null,
"microsoftAccountClientId": null,
"microsoftAccountClientSecret": null,
"microsoftAccountOAuthScopes": null
},
"cors": null,
"push": null,
"apiDefinition": null,
"autoSwapSlotName": null,
"localMySqlEnabled": false,
"ipSecurityRestrictions": null
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_ASEv2_WEB_APP_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/sites/ASEv2-WEB-APP/hostNameBindings/asev2-web-app.ase-v2.p.azurewebsites.net'.",
"type": "Microsoft.Web/sites/hostNameBindings",
"name": "[parameters('hostNameBindings_asev2_web_app.ase_v2.p.azurewebsites.net_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"scale": null,
"properties": {
"siteName": "ASEv2-WEB-APP",
"domainId": null,
"hostNameType": "Verified"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_ASEv2_WEB_APP_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/sites/ASEv2-WEB-APP/slots/WEB-APP-deployment-slot1'.",
"type": "Microsoft.Web/sites/slots",
"kind": "app",
"name": "[parameters('slots_WEB_APP_deployment_slot1_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"scale": null,
"properties": {
"enabled": true,
"hostNameSslStates": [
{
"name": "asev2-web-app-web-app-deployment-slot1.ase-v2.p.azurewebsites.net",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Standard"
},
{
"name": "asev2-web-app-web-app-deployment-slot1.scm.ASE-v2.p.azurewebsites.net",
"sslState": "Disabled",
"virtualIP": null,
"thumbprint": null,
"toUpdate": null,
"hostType": "Repository"
}
],
"serverFarmId": "[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_ASEv2_SERVICE_PLAN_name'))]",
"reserved": false,
"siteConfig": null,
"scmSiteAlsoStopped": false,
"hostingEnvironmentProfile": {
"id": "[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
},
"clientAffinityEnabled": true,
"clientCertEnabled": false,
"hostNamesDisabled": false,
"containerSize": 0,
"dailyMemoryTimeQuota": 0,
"cloningInfo": null
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_ASEv2_WEB_APP_name'))]",
"[resourceId('Microsoft.Web/serverfarms', parameters('serverfarms_ASEv2_SERVICE_PLAN_name'))]",
"[resourceId('Microsoft.Web/hostingEnvironments', parameters('hostingEnvironments_ASE_v2_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/sites/ASEv2-WEB-APP/slots/WEB-APP-deployment-slot1/config/web'.",
"type": "Microsoft.Web/sites/slots/config",
"name": "[parameters('config_web_name_1')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"scale": null,
"properties": {
"numberOfWorkers": 1,
"defaultDocuments": [
"Default.htm",
"Default.html",
"Default.asp",
"index.htm",
"index.html",
"iisstart.htm",
"default.aspx",
"index.php",
"hostingstart.html"
],
"netFrameworkVersion": "v4.0",
"phpVersion": "5.6",
"pythonVersion": "",
"nodeVersion": "",
"linuxFxVersion": "",
"requestTracingEnabled": false,
"remoteDebuggingEnabled": false,
"remoteDebuggingVersion": "VS2012",
"httpLoggingEnabled": false,
"logsDirectorySizeLimit": 35,
"detailedErrorLoggingEnabled": false,
"publishingUsername": "$ASEv2-WEB-APP__WEB-APP-deployment-slot1",
"publishingPassword": null,
"appSettings": null,
"metadata": null,
"connectionStrings": null,
"machineKey": null,
"handlerMappings": null,
"documentRoot": null,
"scmType": "None",
"use32BitWorkerProcess": true,
"webSocketsEnabled": false,
"alwaysOn": false,
"javaVersion": null,
"javaContainer": null,
"javaContainerVersion": null,
"appCommandLine": "",
"managedPipelineMode": "Integrated",
"virtualApplications": [
{
"virtualPath": "/",
"physicalPath": "site\\wwwroot",
"preloadEnabled": false,
"virtualDirectories": null
}
],
"winAuthAdminState": 0,
"winAuthTenantState": 0,
"customAppPoolIdentityAdminState": false,
"customAppPoolIdentityTenantState": false,
"runtimeADUser": null,
"runtimeADUserPassword": null,
"loadBalancing": "LeastRequests",
"routingRules": [],
"experiments": {
"rampUpRules": []
},
"limits": null,
"autoHealEnabled": false,
"autoHealRules": {
"triggers": null,
"actions": null
},
"tracingOptions": null,
"vnetName": "",
"siteAuthEnabled": false,
"siteAuthSettings": {
"enabled": null,
"unauthenticatedClientAction": null,
"tokenStoreEnabled": null,
"allowedExternalRedirectUrls": null,
"defaultProvider": null,
"clientId": null,
"clientSecret": null,
"issuer": null,
"allowedAudiences": null,
"additionalLoginParams": null,
"isAadAutoProvisioned": false,
"googleClientId": null,
"googleClientSecret": null,
"googleOAuthScopes": null,
"facebookAppId": null,
"facebookAppSecret": null,
"facebookOAuthScopes": null,
"twitterConsumerKey": null,
"twitterConsumerSecret": null,
"microsoftAccountClientId": null,
"microsoftAccountClientSecret": null,
"microsoftAccountOAuthScopes": null
},
"cors": null,
"push": null,
"apiDefinition": null,
"autoSwapSlotName": "production",
"localMySqlEnabled": false,
"ipSecurityRestrictions": null
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_ASEv2_WEB_APP_name'))]",
"[resourceId('Microsoft.Web/sites/slots', parameters('slots_WEB_APP_deployment_slot1_name'))]"
]
},
{
"comments": "Generalized from resource: '/subscriptions/a261b2a5-86f5-4b9e-812f-1566a7ea696a/resourceGroups/ASEv2-test/providers/Microsoft.Web/sites/ASEv2-WEB-APP/slots/WEB-APP-deployment-slot1/hostNameBindings/asev2-web-app-web-app-deployment-slot1.ase-v2.p.azurewebsites.net'.",
"type": "Microsoft.Web/sites/slots/hostNameBindings",
"name": "[parameters('hostNameBindings_asev2_web_app_web_app_deployment_slot1.ase_v2.p.azurewebsites.net_name')]",
"apiVersion": "2016-08-01",
"location": "North Europe",
"scale": null,
"properties": {
"siteName": "ASEv2-WEB-APP(WEB-APP-deployment-slot1)",
"domainId": null,
"hostNameType": "Verified"
},
"dependsOn": [
"[resourceId('Microsoft.Web/sites', parameters('sites_ASEv2_WEB_APP_name'))]",
"[resourceId('Microsoft.Web/sites/slots', parameters('slots_WEB_APP_deployment_slot1_name'))]"
]
}
]
}
for instance line 543
"[resourceId('Microsoft.Web/sites/slots', parameters('slots_WEB_APP_deployment_slot1_name'))]"
needs to be modified to be:
"[resourceId('Microsoft.Web/sites/slots', 'ASEv2-web-app', 'web-app-deployment-slot1')]"
and in several other places. That's what the error tell you to fix. there might be other mistakes.