Function disappearing in VS Code parallelly in azure portal also.
Arukula Maheshwar
0
Reputation points
Hi Folks,
Recently I started using VS Code for python programming in D365 CE/CRM development.
In my case when I use the code as shown below for getting contact entity details, it is giving me the Json result, but when I try to add this function in VS Code to Azure after signing in to it, this function is getting disappeared.
Please suggest me some solution.
Thanks in Advance
PFA code down
# !pip install adal , If Required
import adal
import requests
import json
# Global configs.
CLIENT_ID = 'd890e79e-------------------------'
RESOURCE_URI = '
https://---------------------.crm4.dynamics.com'
AUTHORITY_URI = '
https://login.microsoftonline.com/------------'
CLIENT_SECRET = 'F------------------------------------p'
ENTITY = 'contact'
# Get an access token.
context = adal.AuthenticationContext(AUTHORITY_URI, api_version=None)
token = context.acquire_token_with_client_credentials(RESOURCE_URI, CLIENT_ID, CLIENT_SECRET)
session = requests.Session()
session.headers.update(dict(Authorization='Bearer {}'.format(token.get('accessToken'))))
# Request image.
request_uri = '
https://------------------------------contacts?$select=fullname,contactid'
r = session.get(request_uri)
rawJson = r.content.decode('utf-8')
print(rawJson)
Sign in to answer