[ISSUE] Issue with `databricks_app` resource when using `user_api_scopes`
Configuration
Note this is from asset bundle configuration, not directly from Terraform
apps:
reporting_app:
name: 'reporting-app'
description: 'Reporting application'
source_code_path: '../../apps/reporting/'
user_api_scopes:
- sql
resources:
- name: snapshot_job
job:
id: ${resources.jobs.snapshot_by_project.id}
permission: 'CAN_MANAGE_RUN'
- name: sql_warehouse
sql_warehouse:
id: ${var.warehouse_id}
permission: 'CAN_USE'
Expected Behavior
Deploys application
Actual Behavior
databricks bundle deploy --target personal_dev --profile reporting --auto-approve
Building data_platform...
Uploading resources/dist/reporting-0.0.4+45b382f-py3-none-any.whl...
Uploading bundle files to /Workspace/Users/[email protected]/.bundle/reporting-shared/personal_dev/files...
Deploying resources...
Updating deployment state...
Error: terraform apply: exit status 1
Error: Provider produced inconsistent result after apply
When applying changes to databricks_app.reporting_app, provider
"provider[\"registry.terraform.io/databricks/databricks\"]" produced an
unexpected new value: .user_api_scopes: was
cty.ListVal([]cty.Value{cty.StringVal("sql"), cty.StringVal("sql")}), but now
null.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
Steps to Reproduce
databricks bundle deploy
Terraform and provider versions
N/A as using asset bundles
Databricks CLI v0.253.0
Is it a regression?
Suspect not as a public preview feature
Debug Output
N/A
Important Factoids
Enabled preview in workspace
Databricks Apps - On-Behalf-Of User Authorization Public Preview Allows the Databricks App to act on behalf of the app user. This enhancement allows the app to honor the user's access permissions defined in Unity Catalog and in Databricks Workspace.
Would you like to implement a fix?
No
I note the bundle deployment works fine after I set the values using the cli.
databricks apps update reporting-app --json '{"user_api_scopes": ["sql"], "description": "abc"}' --profile reporting
So workaround is comment out user_api_scopes deploy, use cli to set user_api_scopes, then further bundle deployments work without error.
@pietern DABs related
Same issue
Databricks App File:
resources:
apps:
mdm_flask_app:
name: ${var.mdm_app_name}-${bundle.target}
description: "Flask app for MDM table management"
source_code_path: ../mdm-flask-app
user_api_scopes:
- sql
Error:
Error: Provider produced inconsistent result after apply
When applying changes to databricks_app.mdm_flask_app, provider
"provider[\"registry.terraform.io/databricks/databricks\"]" produced an
unexpected new value: .user_api_scopes: was
cty.ListVal([]cty.Value{cty.StringVal("sql")}), but now null.
This is a bug in the provider, which should be reported in the provider's own
issue tracker.
If I edit manually in the Databricks GUI, the change doesn't persist either. The CLI gives me an error as well, with no message
databricks apps update mdm-flask-app-da-weu-test --json '{"user_api_scopes": ["sql"]}'
Error:
Please keep us updated 😺
@PaulBurridge @krishnasism could you try again? We could not reproduce it and suspect it might have been fixed on the backend.
@denik I figured it out, sorry for not providing an update. I forgot I opened this issue. it got resolved itself. I think after changing the api scope, I had to wait for a bit. It is a weird case. But for new apps, it is working normally.
Thanks for looking into it. It got resolved by itself.
Closing as resolved