I’m trying to change the tier of a blob in storage account through ADF using Web Activity:
I am refering to this link – https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-tier?tabs=azure-ad
The required values used are as below:
URL :https://myaccount.blob.core.windows.net/mycontainer/myblob?comp=tier
(modified to my account and blob names)
ADF JSON:
{
"name": "changeTIER",
"properties": {
"activities": [
{
"name": "Web1",
"type": "WebActivity",
"dependsOn": [],
"policy": {
"timeout": "0.12:00:00",
"retry": 0,
"retryIntervalInSeconds": 30,
"secureOutput": false,
"secureInput": false
},
"userProperties": [],
"typeProperties": {
"url": "https://myaccount.blob.core.windows.net/mycontainer/combinedOutput.json?comp=tier",
"method": "PUT",
"headers": {
"x-ms-version": "2014-02-14",
"x-ms-access-tier": "Cool",
"x-ms-date": {
"value": "@utcNow(‘dddd, dd MMM yyyy HH:mm:ss’)",
"type": "Expression"
},
"Authorization": ""
},
"body": ""tier": "Cool"",
"authentication": {
"type": "MSI",
"resource": "https://storage.azure.com/"
}
}
}
],
"annotations": [],
"lastPublishTime": "2023-04-11T05:08:13Z"
},
"type": "Microsoft.DataFactory/factories/pipelines"
I’m using the date format as this -@utcNow(‘dddd, dd MMM yyyy HH:mm:ss’) and a SAS Key along with MSI Authentication
I am getting the error:
Error calling the endpoint ‘https://myaccount.blob.core.windows.net’. Response status code: ‘NA – Unknown’. More details: Exception message: ‘NA – Unknown [ClientSideException] The format of value ”.
Request didn’t reach the server from the client. This could happen because of an underlying issue such as network connectivity, a DNS failure, a server certificate validation or a timeout.
Please help me with the right format and settings to connect and update the tier using the Web Activity in ADF-Am I missing any changes in the BLOB?
I have tried all stackoverflow articles and MS documentations.
2
Answers
It works with Web Activity also -only error was in format of the date header. Using this -@concat(utcNow('ddd, dd MMM yyyy HH:mm:ss'),' GMT') is working now.
The correct format should be like this for eg -Wed, 19 Apr 2023 05:15:42 GMT
Three way’s you can change the Azure Storage account tier.
First, you can manually change the tier in the Azure storage account like this:
Use custom activity in Azure data factory run PowerShell script and change the tier.
Upload power shell file in Azure storage account and perform the custom activity in Azure data factory.
For more information refer to this link.
Use
CopyActivity
, to set blob tier, and also use Header: like thisFor information refer this SO thread by KarthikBhyresh-MT