python - 如何在 Python 中添加天蓝色标签数组
问题描述
我正在尝试将 azure 标记(数组)添加到资源中。问题在于数组或作为标签的列表,Azure SDK for python 似乎只允许 str。
System.Private.CoreLib:执行函数时出现异常:Functions.azure_tags。System.Private.CoreLib:结果:失败异常:TypeError:必须是 str,而不是 dict
我在 Azure SDK 中搜索 python 文档:链接
是否可以在 Python 中实现天蓝色标签 dict/array/list 创建?
解决方案
目前,SDK 仅限于添加/更新一个标签值,这就是为什么它在参数中提供数组时会出错。
我建议你遍历你的数组并单独添加它。
create_or_update_value(tag_name, tag_value, custom_headers=None, raw=False, **operation_config)
create_or_update(tag_name, custom_headers=None, raw=False, **operation_config)
Creates a tag in the subscription.
The tag name can have a maximum of 512 characters and is case insensitive. Tag names created by Azure have prefixes of microsoft, azure, or windows. You cannot create tags with one of these prefixes.
Parameters
tag_name
str
The name of the tag to create.
custom_headers
dict
headers that will be added to the request
default value: None
raw
bool
returns the direct response alongside the deserialized response
default value: False
operation_config
Operation configuration overrides.
Returns
TagDetails or ClientRawResponse if raw=true
Return type
TagDetails
ClientRawResponse
Exceptions
CloudError
推荐阅读
- html - Como reduzir espaços nas laterais da página usando css e substituir estilos temáticos de observação
- r - 在 R 中,有没有办法摆脱此列中的小数位?
- visual-studio-code - 无法在 vs 代码中构建马林鱼
- android - Flutter 表单构建器 - FormBuilderImagePicker
- r - 使用 ggplot2 在 Y 轴上设置 24 小时刻度
- python-3.x - 仅从 Python 中的大文件中读取特定的行号?
- php - NGINX 入口 + Wordpress-fpm = ERR_TOO_MANY_REDIRECTS
- python - 是否可以在 Scrapy 中使用熊猫?
- java - 密钥库证书链长度错误 - 如何以编程方式将整个证书链加载到 Java 密钥库中,以便使用 SSL 身份验证连接到 Kafka?
- java - 有没有办法在程序仍在运行时替换 eclipse 中的输出?