Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

az synapse notebook create command is giving bad request error with json file parameter #30425

Open
khan2810 opened this issue Nov 27, 2024 · 7 comments
Assignees
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue Synapse

Comments

@khan2810
Copy link

khan2810 commented Nov 27, 2024

Describe the bug

I am trying to deploy a synapse notebook which is converted to json file by synapse git integration and stored in an ADO repo.
az synapse notebook create --file $filePath --workspace-name $workspaceName --name $notebookName
$filePath is the path to the notebook json file. I am getting following error while executing the command through Azure CLI task in a release pipeline.
ERROR: Operation returned an invalid status 'Bad Request'

Related command

az synapse notebook create

Errors

ERROR: Operation returned an invalid status 'Bad Request'

Issue script & Debug output

2024-11-27T05:13:21.9977264Z INFO: Request URL: 'https://gpsusprod.dev.azuresynapse.net/notebooks/Run_pbpObjects_AM?api-version=REDACTED'
2024-11-27T05:13:21.9977816Z Request method: 'PUT'
2024-11-27T05:13:21.9978148Z Request headers:
2024-11-27T05:13:21.9978426Z 'Content-Type': 'application/json'
2024-11-27T05:13:21.9978711Z 'Content-Length': '59'
2024-11-27T05:13:21.9978983Z 'Accept': 'application/json'
2024-11-27T05:13:21.9979288Z 'x-ms-client-request-id': '5222a6a1-ac7e-11ef-80a5-000d3a042863'
2024-11-27T05:13:21.9979975Z 'User-Agent': 'azsdk-python-synapse-artifacts/0.19.0 Python/3.12.7 (Windows-2022Server-10.0.20348-SP0) VSTS_9bff54e8-737a-47c7-a901-296511b54399_Release__6338_15268_1'
2024-11-27T05:13:21.9980368Z 'Authorization': 'REDACTED'
2024-11-27T05:13:21.9980640Z A body is sent with the request
2024-11-27T05:13:22.7197541Z INFO: Response status: 400
2024-11-27T05:13:22.7198088Z Response headers:
2024-11-27T05:13:22.7198587Z 'Transfer-Encoding': 'chunked'
2024-11-27T05:13:22.7198923Z 'Content-Type': 'application/json; charset=utf-8'
2024-11-27T05:13:22.7199258Z 'Server': 'Kestrel Microsoft-HTTPAPI/2.0'
2024-11-27T05:13:22.7199581Z 'Strict-Transport-Security': 'REDACTED'
2024-11-27T05:13:22.7199890Z 'Request-Context': 'REDACTED'
2024-11-27T05:13:22.7200220Z 'x-ms-request-id': '9b58af0b-bd8a-45fd-95d9-74a92d795386'
2024-11-27T05:13:22.7200709Z 'Date': 'Wed, 27 Nov 2024 05:13:22 GMT'
2024-11-27T05:13:22.9160477Z ERROR: Operation returned an invalid status 'Bad Request'
2024-11-27T05:13:22.9167956Z INFO: Command ran in 5.001 seconds (init: 0.320, invoke: 4.681)
2024-11-27T05:13:23.1273803Z Deploying notebook: D:\a\r1\a/_GPSUS-Synapse-Master/ASW_Drop/ARM/notebook/Run_pcMartObjects_AM.json
2024-11-27T05:13:23.1317946Z Notebook name: Run_pcMartObjects_AM
2024-11-27T05:13:24.4608684Z INFO: Request URL: 'https://gpsusprod.dev.azuresynapse.net/notebooks/Run_pcMartObjects_AM?api-version=REDACTED'
2024-11-27T05:13:24.4609178Z Request method: 'PUT'
2024-11-27T05:13:24.4609471Z Request headers:
2024-11-27T05:13:24.4609732Z 'Content-Type': 'application/json'
2024-11-27T05:13:24.4609983Z 'Content-Length': '62'
2024-11-27T05:13:24.4610226Z 'Accept': 'application/json'
2024-11-27T05:13:24.4610548Z 'x-ms-client-request-id': '53daaa64-ac7e-11ef-84a0-000d3a042863'
2024-11-27T05:13:24.4610924Z 'User-Agent': 'azsdk-python-synapse-artifacts/0.19.0 Python/3.12.7 (Windows-2022Server-10.0.20348-SP0) VSTS_9bff54e8-737a-47c7-a901-296511b54399_Release__6338_15268_1'
2024-11-27T05:13:24.4611298Z 'Authorization': 'REDACTED'
2024-11-27T05:13:24.4611538Z A body is sent with the request
2024-11-27T05:13:25.0785479Z INFO: Response status: 400
2024-11-27T05:13:25.0786287Z Response headers:
2024-11-27T05:13:25.0786900Z 'Transfer-Encoding': 'chunked'
2024-11-27T05:13:25.0787538Z 'Content-Type': 'application/json; charset=utf-8'
2024-11-27T05:13:25.0788126Z 'Server': 'Kestrel Microsoft-HTTPAPI/2.0'
2024-11-27T05:13:25.0788684Z 'Strict-Transport-Security': 'REDACTED'
2024-11-27T05:13:25.0789223Z 'Request-Context': 'REDACTED'
2024-11-27T05:13:25.0789783Z 'x-ms-request-id': '61674127-566f-452b-b2eb-15b012519dd5'
2024-11-27T05:13:25.0790407Z 'Date': 'Wed, 27 Nov 2024 05:13:24 GMT'
2024-11-27T05:13:25.0982964Z ERROR: Operation returned an invalid status 'Bad Request'
2024-11-27T05:13:25.0986710Z INFO: Command ran in 1.907 seconds (init: 0.410, invoke: 1.496)

Expected behavior

Notebook should be deployed to the mentioned synapse environment correctly.

Environment Summary

2024-11-27T05:12:35.9847113Z azure-cli 2.67.0
2024-11-27T05:12:35.9847555Z
2024-11-27T05:12:35.9848009Z core 2.67.0
2024-11-27T05:12:35.9848290Z telemetry 1.1.0
2024-11-27T05:12:35.9848471Z
2024-11-27T05:12:35.9848733Z Extensions:
2024-11-27T05:12:35.9849002Z azure-devops 1.0.1
2024-11-27T05:12:35.9849192Z
2024-11-27T05:12:35.9849444Z Dependencies:
2024-11-27T05:12:35.9849713Z msal 1.31.0
2024-11-27T05:12:35.9849981Z azure-mgmt-resource 23.1.1
2024-11-27T05:12:35.9850166Z
2024-11-27T05:12:35.9850463Z Python location 'C:\Program Files\Microsoft SDKs\Azure\CLI2\python.exe'
2024-11-27T05:12:35.9850855Z Extensions directory 'C:\Program Files\Common Files\AzureCliExtensionDirectory'
2024-11-27T05:12:35.9851082Z
2024-11-27T05:12:35.9851446Z Python (Windows) 3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]

Additional context

No response

@khan2810 khan2810 added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Nov 27, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 27, 2024
@yonzhan
Copy link
Collaborator

yonzhan commented Nov 27, 2024

Thank you for opening this issue, we will look into it.

@microsoft-github-policy-service microsoft-github-policy-service bot added Auto-Assign Auto assign by bot Service Attention This issue is responsible by Azure service team. Synapse labels Nov 27, 2024
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wanyang7, @v-yanjungao.

1 similar comment
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wanyang7, @v-yanjungao.

Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wanyang7, @v-yanjungao.

Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Solution 1:

BadRequest usually means there are errors in the payload. Please check your request or provide content of the definition file.

Reference:

Solution 2:

This is working now. I've verified by first doing an export of a notebook and then performing a create (and it also works with import). Here are the commands I used:
az synapse notebook export --workspace-name syn-ggtest1 --name mynotebook --output-folder ./
az synapse notebook import --workspace-name syn-ggtest1 --name mynotebook --file @./mynotebook.ipynb

A few things to be aware of (this needs to be added to the docs):

  1. The notebook will only be visible in synapse studio if you're in "live mode". If your workspace is connected to a git repo, you need to import a notebook by adding the json file to the "notebook" folder in your repo.
  2. You have to use the .ipynb format (this is the format you get when you do an export via cli) to do the import/create, not the .json (this is the format you get when you commit to git)
  3. The notebook will created at the root level in Synapse studio (the "folder" property in the .ipynb is ignored)

Reference:

@Azure Azure deleted a comment from github-actions bot Dec 19, 2024
@wangzelin007 wangzelin007 added Test Test and removed Test Test labels Dec 20, 2024
Copy link
Contributor

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @wanyang7, @v-yanjungao.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Auto-Assign Auto assign by bot bug This issue requires a change to an existing behavior in the product in order to be resolved. customer-reported Issues that are reported by GitHub users external to the Azure organization. Possible-Solution Service Attention This issue is responsible by Azure service team. Similar-Issue Synapse
Projects
None yet
Development

No branches or pull requests

5 participants