Closed nakazax closed 3 years ago
I've tried pv scan createSource command like the following, the command has succeeded and the source has been created. But the resourceName has became c instead of cosdb-example.
pv scan createSource
c
cosdb-example
!pv scan createSource \ --datasource "cosdb-example" \ --kind "AzureCosmosDb" \ --accountUri "https://cosdb-example.documents.azure.com:443/" \ --subscriptionId "xxx" \ --resourceGroup "rg-hinakaza-private" \ --location "westus2" \ --resourceName "cosdb-example" \ --parentCollection "ServiceEndpoint"
{ "id": "datasources/cosdb-example", "kind": "AzureCosmosDb", "name": "cosdb-example", "properties": { "accountUri": "https://cosdb-example.documents.azure.com:443/", "createdAt": "2021-05-06T15:11:47.903815Z", "lastModifiedAt": "2021-05-06T15:13:51.304859Z", "location": "westus2", "parentCollection": { "referenceName": "ServiceEndpoint", "type": "DataSourceReference" }, "resourceGroup": "rg-hinakaza-private", "resourceName": "c", "subscriptionId": "xxx" } }
I'm wondering if [0] of "resourceName": args['--resourceName'][0] in the follwoing function is the reason. How about removing the [0]? https://github.com/tayganr/purviewcli/blob/711fa8cbf5533adc4bcf529af6948cf1d35c0396/purviewcli/client/_scan.py#L108-L132
[0]
"resourceName": args['--resourceName'][0]
@nakazax - Thanks for picking up the issue. Just pushed through a new version (0.1.10) which should fix it.
@tayganr Thanks for your quick response.
I've tried
pv scan createSource
command like the following, the command has succeeded and the source has been created. But the resourceName has becamec
instead ofcosdb-example
.Command
Response
Idea of solution
I'm wondering if
[0]
of"resourceName": args['--resourceName'][0]
in the follwoing function is the reason. How about removing the[0]
? https://github.com/tayganr/purviewcli/blob/711fa8cbf5533adc4bcf529af6948cf1d35c0396/purviewcli/client/_scan.py#L108-L132