Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
127 views
in Technique[技术] by (71.8m points)

python - "Bad Request" when creating an SQLServerLinkedService

I am trying to create an SQL Server Linked Service for Azure Data Factory from within Python. All the dependencies are imported and the data factory gets created successfully. It is failing on creating the Linked Service.

Here is my pseudo-code running from Python:

  ls_name = 'Blah'
    
  properties = SqlServerLinkedService(
        connection_string="blahblah.database.windows.net",
        connect_via={"referenceName": "AutoResolveIntegrationRuntime", "type": "IntegrationRuntimeReference"},
        user_name="my-user-name",
        password=SecureString("my-plaintext-password")
    )


    ls = adf_client.linked_services.create_or_update( resource_group_name=rg_name, factory_name=df_name, linked_service_name=ls_name, linked_service=properties)

For one, if I keep the format of the SecureString the way it is above, I get error about 2 positional arguments where only 1 is required, if i take out the password line altogether, I get "Bad Request" when create_or_update function runs at the bottom. They Microsoft Python SDK documentation is terribly lacking. Can someone help me figure out how to code this correctly?

File "/usr/local/lib/python3.8/dist-packages/azure/mgmt/datafactory/operations/_linked_services_operations.py", line 190, in create_or_update raise HttpResponseError(response=response, error_format=ARMErrorFormat) azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Bad Request'

question from:https://stackoverflow.com/questions/65948103/bad-request-when-creating-an-sqlserverlinkedservice

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...