我只是试图通过shell脚本执行AZ命令集。
az account set --subscription "test-subscription"
如果我在az login
之后直接在powershell上运行命令,它将正常工作。
但是如果我通过shell脚本运行相同的命令,则AzureCloud中不存在引发订阅的情况。
更新:
az account show命令的输出
{
"environmentName": "AzureCloud",
"homeTenantId": "xxx-xx-xx-x",
"id": "xx-xx-xx-x-xx",
"isDefault": true,
"managedByTenants": [
{
"tenantId": "xx-xx-xxx-xx-xx"
}
],
"name": "subscription-name",
"state": "Enabled",
"tenantId": "xx-xx-xx-xxx",
"user": {
"name": "fn.ln@xx.com",
"type": "user"
}
}
答案 0 :(得分:1)
尝试在登录时指定带有订阅的租户ID的request
。
from ib.ext.ScannerSubscription import ScannerSubscription
qqq_id = 0
subscript = ScannerSubscription()
subscript.numberOfRows(15)
subscript.m_scanCode = 'HIGH_OPEN_GAP'
subscript.m_instrument = 'STK'
subscript.m_averageOptionVolumeAbove ='0'
subscript.m_abovePrice = '5'
subscript.m_aboveVolume = '100000'
con.reqScannerSubscription(qqq_id, subscript)
然后使用
--tenant