Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scheduler job won't deploy from an ARM template when using the listAccountSas function #15061

Open
johndowns opened this issue Sep 16, 2018 — with docs.microsoft.com · 6 comments

Comments

Copy link
Contributor

commented Sep 16, 2018 — with docs.microsoft.com

I am trying to create a storage queue scheduler job using the new listAccountSas ARM template function to create a SAS token for a storage account. The template I'm deploying is available here.

However, when I deploy this, it fails with this error:

Deployment failed. Correlation ID: a091e077-8814-492b-b3fa-636daaee2dd8. {
  "error": {
    "code": "BadRequest",
    "message": "StorageQueue Action is missing the SAS token. This is required information."
  }
}

If I generate a SAS token myself using the exact same policies and format, and then put it into the template on line 90 instead of using the listAccountSas function, the template deploys successfully.

Any ideas on how I can deploy this template?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

@mike-urnun-msft

This comment has been minimized.

Copy link
Contributor

commented Sep 16, 2018

@johndowns Thank you for your feedback! We will investigate and get back to you with our findings.

@femsulu

This comment has been minimized.

Copy link
Member

commented Sep 19, 2018

@Adam-Smith-MSFT any idea on this?

@femsulu

This comment has been minimized.

Copy link
Member

commented Sep 21, 2018

@johndowns still investigating but one quick note...

Apologies if I missed this in your template but noticed it doesnt inlcude an object definition as stated in the sample template referenced below. An object needs to be passed to the listAccountSas function in order to retrieve the SAS token.
Can you try updating the " Variables" & "sasToken" sections of your template as highlighted below and see if that resolves your issue?

image

image

@johndowns

This comment has been minimized.

Copy link
Contributor Author

commented Sep 21, 2018

Thanks for your help @femsulu.

If you check the template I provided, you'll see that it is passing an object into the listAccountSas function. The object is defined on lines 42-47, and the function on line 90 uses it.

Just to cover all the bases, I prepared another version that uses the parameters section instead of the variables section, and as expected, it's still not working there. It gets the exact same error.

My hunch is that there's something about the way the Azure Scheduler resource provider handles ARM template function evaluation that makes this fail, but of course this is just a guess.

@femsulu

This comment has been minimized.

Copy link
Member

commented Sep 22, 2018

Thanks for the update @johndowns. Adding the content owner to see if he can shed some light on this issue. @derek1ee - any insights?

@femsulu femsulu added assigned-to-author and removed cxp labels Sep 22, 2018

@femsulu femsulu assigned derek1ee and unassigned femsulu Sep 22, 2018

@gesch80550

This comment has been minimized.

Copy link

commented May 29, 2019

Any updates on this issue? I am experiencing a similar problem when attempting to use listAccountSAS in my ARM Template. I am attempting to set a variable with the AccountSAS (and also tried just outputting the AccountSAS value) and then trying to use the variable to set Web Logging container values. But am getting:

7:32:03 AM - Error: Code=InvalidTemplate; Message=Deployment template validation failed: 'The template variable 'storageSAS' is not valid: The template function 'listAccountSas' is not expected at this location. Please see https://aka.ms/arm-template-expressions for usage details.. Please see https://aka.ms/arm-template-expressions for usage details.'.

The relevant parts of my template are:

"parameters": {
	"accountSasProperties": {
		"defaultValue": {
			"signedExpiry": "2199-12-31T23:59:99Z",
			"signedPermission": "rwdlacu",
			"signedResourceTypes": "c",
			"signedServices": "b"
		},
		"type": "object"
	}
}
"variables": {
	"storageSAS": "[listAccountSas(variables('storageName'), '2018-11-01', parameters('accountSasProperties')).accountSasToken]"
}
"DIAGNOSTICS_AZUREBLOBCONTAINERSASURL": "[concat('https://', variables('storageName'), 'blob.core.windows.net/', variables('logContainerName'), '?', variables('storageSAS'))]",

Any suggestions on how to resolve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants
You can’t perform that action at this time.