使用 COS 上传腾讯云 SCF 云函数 - 腾讯云开发者社区-腾讯云

使用 COS 上传腾讯云 SCF 云函数

安装 CLI

通过 cmd 安装:pip install scf

执行 scf --version 命令进行验证 => scf CLI, version 0.0.1

配置账号信息


$ scf configure set
[-] appid = 1255720000
[-] region = ap-guangzhou
[-] secret-id = ********************************cEr7
[-] secret-key = ****************************mkYA
[-] using-cos = True (By default, it is deployed by COS.)
Allow report information to help us optimize scfcli(Y/n):
复制

或者


$ scf configure set --region ap-beijing --appid xxxxxxxxxx --secret-id xxxxxxxxxxxxxx --secret-key xxxxxxxxxxxxxx
复制

开启 COS 上传

查看配置


scf configure get
复制

返回using-cosTrue 表示已开启


$ scf configure get
[>] USER_1
[>] appid = 1255721742
[>] region = ap-guangzhou
[>] secret-id = ********************************cEr7
[>] secret-key = ****************************mkYA
[>] using-cos = True (By default, it is deployed by COS.)
[>] python2-path = None
[>] python3-path = None
[>] no-color = False
复制

开启 COS 上传


scf configure set --using-cos y
复制

部署函数

在当前目录下创建 hello_world 函数

说明:

如果您已经有创建好的云函数,请执行 步骤2


scf init
复制

进入对应的函数目录


$ cd hello_world/
复制

在腾讯云账号下创建 COS bucket ,并从该 bucket 拉取函数并部署


$ scf deploy
复制

DONE!

本文参与 腾讯云自媒体分享计划 ,欢迎热爱写作的你一起参与!
本文分享自作者个人站点/博客:https://www.yuque.com/zephyr1/web 复制
如有侵权,请联系 cloudcommunity@tencent.com 删除。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值