admin管理员组文章数量:1302895
I am running the following command in bash
terminal
scope=$(az cognitiveservices account list --query "[?
contains(properties.endpoint, '/')]
| [0].id" -o tsv)
I have copied it from .sh.
I expect it to run. However, the value of scope
is empty which is failing the function assignAOAIRoleToManagedIdentity
and interrupting the rest of the bicep
script.
Is the command wrong? I am not experienced in the topic. Thus , would appreciate help in understanding what the command is failing and how I fix it.
I am running the following command in bash
terminal
scope=$(az cognitiveservices account list --query "[?
contains(properties.endpoint, 'https://aiservices-2025learnresolution760978729403.openai.azure/')]
| [0].id" -o tsv)
I have copied it from https://github/Azure-Samples/graphrag-accelerator/blob/main/infra/deploy.sh.
I expect it to run. However, the value of scope
is empty which is failing the function assignAOAIRoleToManagedIdentity
and interrupting the rest of the bicep
script.
Is the command wrong? I am not experienced in the topic. Thus , would appreciate help in understanding what the command is failing and how I fix it.
Share Improve this question asked Feb 10 at 12:22 Manu ChadhaManu Chadha 16.8k24 gold badges114 silver badges242 bronze badges 2 |1 Answer
Reset to default 0Getting empty value for scope when running command az cognitive services account list:
You need to filter the query
parameter in the below way to retrieve the endpoint of a cognitive service account.
az cognitiveservices account list --query "[].{endpoint: properties.endpoint}"
Condition check for cognitive service endpoint existence:
scope=$(az cognitiveservices account list --query "[?contains(properties.endpoint, 'https://newcog.cognitiveservices.azure/')] | [].{endpoint: properties.endpoint}")
echo $scope
I have also created multiple AI services and tried applying the above logic to test if it is working on multiple services and it worked as expected.
版权声明:本文标题:azure - getting empty value for scope when running command az cognitiveservices account list - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741717230a2394184.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
az cognitiveservices account list
, is there an account with endpointhttps://aiservices-2025learnresolution760978729403.openai.azure/
? – Thomas Commented Feb 11 at 5:45