When deploying IBM Cloud Functions using a manifest file from the CLI, the API isn't created in the targeted namespace if it's in an IAM-enabled Resource Group, but it works if targeting a Cloud Foundry-based namespace. How can I deploy an API using a manifest file to a namespace inside an IAM-enabled Resource Group?
$ ibmcloud resource group-create TodoBackendRG
$ ibmcloud fn namespace create TodoBackendNamespace
ok: created namespace TodoBackendNamespace
$ ibmcloud target -g TodoBackendRG
Targeted resource group TodoBackendRG
API endpoint: https://cloud.ibm.com
Region: us-south
User: matthew@example.com
Account: Matthews Account (blah) <-> blah
Resource group: TodoBackendRG
CF API endpoint: https://api.ng.bluemix.net (API version: 2.141.0)
Org: TodoBackendOrg
Space: dev
$ ibmcloud fn property set --namespace TodoBackendNamespace
ok: whisk namespace set to TodoBackendNamespace
$ ibmcloud fn deploy -m manifest.yml
Success: Deployment completed successfully.
$ ibmcloud fn api list
ok: APIs
Action Verb API Name URL
The above deployment doesn't fail, but instead of deploying to the namespace TodoBackendNamespace
in the IAM-enabled Resource Group TodoBackendRG
, it deploys to the Cloud Foundry-based namespace TodoBackendOrg_dev
.
If I try to call out the namespace the deployment fails.
$ ibmcloud fn deploy -n TodoBackendNamespace -m manifest.yml
Error: Deployment did not complete sucessfully. Run `wskdeploy undeploy` to remove partially deployed assets.
servicedeployer.go [1656]: [ERROR_WHISK_CLIENT_ERROR]: Error code: 147: The supplied authentication is not authorized to access 'TodoBackendNamespace/TodoBackendFN'. (code 33f32f829a3d1b88e8bccd440f13ee91): HTTP Response Status: 403 Forbidden HTTP Response Body: {"code":"33f32f829a3d1b88e8bccd440f13ee91","error":"The supplied authentication is not authorized to access 'TodoBackendNamespace/TodoBackendFN'."}