Open dbassking opened 2 years ago
use:
- task
input: ...
env:
azure_static_web_Apps_api_token: $(deploymenttoken)
saw this in this article and it worked for me... at leat until I try to build a azure function with .net 6 :(
https://docs.microsoft.com/de-de/azure/static-web-apps/publish-devops
hope at leat it helps you!
That's what I'm currently doing, unfortunately. Hopefully there is a way to do it without manually retrieving the token
I want to mention the "env" in the config of the task was important. In your example you have the 'azure_static_web_Apps_api_token' in the input section! Don't know if that will work for you.
it currently works when the token is in a pipeline variable. I'll move it to 'env' and see what happens. Good catch
I am facing the same problem. Any solution for this?
Just wanted to point out that DieselMeister has a capital "A" in his environment variable which caused his suggested solution to not work. Figure someone else reading through this may save themselves some time if they copy and pasted and didn't understand why the solution wasn't working for them. He is correct about env needing to be outside of inputs.
In your inline script, pass -o tsv
after --query properties.apiKey
because otherwise, the output of az staticwebapp secrets list
will include quotes around the key, which results in an invalid deployment token.
Unable to pass the deployment token as a parameter when using a runtime variable
for the tasks below, "./artifacts/build/" is a built reactjs site, and "./artifacts/api/" is a function app. When "deploymentToken" is defined as a library or pipeline variable the site deploys fine, but when it is retrieved from the resource on-the-fly using the azure cli, deployment fails with an "invalid token" error. The value of $(deploymentToken) is the same as the value provided when you manage tokens in the Azure Portal. I verified this in both the Azure CLI and by writing the value to the log during deployment.
Expected behavior The token should be accepted and the deployment succeed, just as when using a compile time variable
Screenshots![image](https://user-images.githubusercontent.com/22827246/142035712-a1274dc4-9bce-4687-8f15-f5f7933bf8b0.png)